Hi Everyone,
MySQL table nemed “test” is onsisted of 2 fields as shown at the 1 st screenshot hereby:
The above table contains 4 rows as shown at thescreenshot above.
My php code uploads a table that browses the above table’s rows. At the end of each row in the PHP page there is
a “submit button” to delete the current row as it shows on the2nd screenshot:
As you can see at the above screenshot, when I tap the “Delete” button I get an error that says that the delete
query is missing the “where” “counter” key.
I try to set the current row’s “counter” value but i’m afraid I dont know how to do so…
Here is the code:
[php]
" . $MyCONNECTION->error . "
"; } echo <<<_END Id _END; $MyQUE = "SELECT counter, id FROM test "; $MyRESULT = $MyCONNECTION->query($MyQUE); if (!$MyRESULT) die ("Database access failed: " . $MyCONNECTION->error); $numOfRows = $MyRESULT->num_rows; echo <<<_END table, th, td {border-collapse: collapse;} th {background-color: #f1f1c1;border: 1px solid black;} td {border: 1px solid black;} IDs _END; for ($j = 0 ; $j < $numOfRows ; $j++) { $MyRESULT->data_seek($j); $row = $MyRESULT->fetch_array(MYSQLI_NUM); echo <<<_END _END; } echo "
COUNTER | ID | action |
---|---|---|
$row[0] | $row[1] |
[/php]
Could anyone show me please how to set the current row’s counter value to the “Delete” query?
Thanks a lot !