Can someone tell me how I can find out why I am getting errors executing
queries when I try to delete items from a table?  I have 2 files...
file 1. - Queries database, displays results with option to delete record
using a check box, code is as follows...
require '../scripts/db.php';
$result = mysql_query("SELECT * FROM cur_inv",$dbh) or die("Could not
execute query, please try again later");
echo "<table border=\"0\" class=\"table-body\" width=\"100%\"><form
name=\"rem_inv\" method=\"post\" action=\"done2.php3\">
<tr><td align=\"center\" colspan=\"3\"><font size=\"4\"><B>Current
Inventory</B></font><hr color=\"333333\"></td></tr>";
$count = -1;
while ($myrow = mysql_fetch_row($result)) {
$count ++;
echo "<tr><td width=\"30%\"><B>Type Of Car: </B></td><td>";
echo "</td><td><input type=\"checkbox\" name=\"cars\"
echo "<tr><td width=\"30%\"><B>Model Of Car: </B></td><td>";
echo "</td></tr>\n";
echo "<tr><td width=\"30%\"><B>Year Of Car: </B></td><td>";
echo "</td></tr>\n";
echo "<tr><td width=\"30%\"><B>Price Of Car: </B></td><td>$";
echo "</td></tr>\n";
echo "<tr><td width=\"30%\"><B>VIN Of Car: </B></td><td>";
echo "</td></tr><tr><td colspan=\"3\"><hr color=\"333333\"></td></tr>\n";
echo "<tr><td><input type=\"submit\" name=\"delete\"
file 2. - takes variable of checkbox and then queries db trying to delete
any record based on the id.  code is as follows...
require '../scripts/db.php';
$sql = @mysql_query("DELETE FROM $table_name WHERE $id = 'id'",$dbh) or
die("Could not execute query, please try again later");
print("changes made");
I have been trying everything under the sun and cannot get this to work.
please help.

PHP Database Mailing List (
To unsubscribe, visit:

Reply via email to