Ho questo codice:
In pratica, nelle intenzioni vorrei poter selezionare, di volta in volta, gruppi di 100 dati, su cui eseguire la funzione.Codice PHP:$step1 = 0;
$step2 = 100;
$stp1 = $_POST["start"];
$stp2 = $_POST["end"];
if ($stp1 !== "") {
$step1 = $stp1;
} else if ($stp1 == "") {
$step1 = $step1;
}
if ($stp2 !== "") {
$step2 = $stp2;
} else if ($stp2 == "") {
$step2 = $step2;
}
$result = mysql_query("SELECT * FROM `test` DESC LIMIT '$step1','$step2'");
while ($row = mysql_fetch_array($result)) {
// qui va la funzione da eseguire
$step1 = $step1+100;
$step2 = $step2+100;
}
Ogni volta, ripasso i valori incrementati alla pagina, attraverso un form.
Il problema è che mi dà il solito messaggio di warning:, relativamente alla riga:Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resourceChiaro che non mi accetta le variabili $step1 e $step2 come valori.Codice PHP:$result = mysql_query("SELECT * FROM `test` DESC LIMIT '$step1','$step2'")
Allora, come posso fare a risolvere questo problema?
![]()

Rispondi quotando