This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This is my Angular2 Component | |
class ItemList { | |
offset = 0; | |
items:ListItem[] = []; | |
// inject MyApi and set it as a private property on the class, automatically | |
// then get the initial items by default | |
constructor(private api:MyApi) { | |
this.getNextItems(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$conn = mysql_connect("localhost", "username", "password" ) or die (mysql_error()) ; | |
mysql_select_db("database", $conn); | |
if( !isset( $_GET['p']) ) {$_GET['p']=0;} // Ideally check if it's numeric also | |
$per_page= 9; | |
$sql= "SELECT * FROM black"; // You don't use this one ... | |
// The first int in LIMIT specifies the start row, thus you need to do $_GET['p'] * $per_page | |
// More importantly you're trying to use both ID and IMAGE columns from your database, but you only select image ??? | |
$sql2= "SELECT * FROM black ORDER BY id Asc LIMIT ".$_GET['p'] * $per_page."," . $per_page; | |
$query= mysql_query( $sql2 ); |