ciao, ho questo codice che sto provando che mi torna un errore, che reputo a $offset, come dice appunto l'errore stesso:
codice php:
Codice PHP:
$offset = $_REQUEST['offset'];
$query = "SELECT movie_name, movie_year
FROM movie
ORDER BY movie_name
LIMIT $offset,1";
$results = mysql_query($query)
or die(mysql_error());
echo "<table>\n";
while ($rows = mysql_fetch_assoc($results)) {
echo "<tr>\n";
foreach($rows as $value) {
echo "<td>\n";
echo $value;
echo "</td>\n";
}
echo "</tr>
\n";
}
echo "</table>\n";
echo "[url='page.php?offset=0']Page 1[/url]
";
echo "[url='page.php?offset=1']Page 2[/url]
";
echo "[url='page.php?offset=2']Page 3[/url]
";
errore:
codice:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1' at line 4
linea 4:
Codice PHP:
LIMIT $offset,1";
grazie