Yeah, you should have a single apostrophe around the $id. So it should read:

mysql_query("DELETE FROM open_trades WHERE id='$id'");

That should do it.

On Jun 16, 2004, at 12:04 AM, Justin wrote:

Hello, I have a simple script to retrieve and then delete a selected script, but it does not work.

When I hit the button I get:
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 'id' at line 11064"

Any help would be appreciated.

<form action="<? echo $PHP_SELF ?>" method="post"> <?php

$result = mysql_query("select * from open_trades");

while ($row = mysql_fetch_array($result))
    print "<tr><td>";
    print "<INPUT TYPE='RADIO' NAME='id' VALUE='id'>";
    print "</td><td>";
    print $row["id"];
    print "</td><td>";
    print $row["open_date"];
    print "</td><td>";
    print $row["short_long_trade"];
    print "</td><td>";
    print $row["expiry"];
    print "</td></tr>\n";

print "</table>\n";
<input type="submit" name="submit" value="close"></form>

                  mysql_query("DELETE FROM open_trades WHERE id=$id");
                  echo "Thank you! Information updated.";
                  echo mysql_error();
                  echo mysql_errno();

-- PHP Database Mailing List ( To unsubscribe, visit:

Reply via email to