I'm new to mySQL and php. I'm trying to delete the records from a database I've created. I can add and display records in this database. But when I run the following code....nothing happens. I don't know what to do because i'm not getting an error or anything from the browser and i dont know where to find a mySQL server console to look for error messages.

Please help!

-- CODE: --------

<html>
<body>

<?php

$db=mysql_connect("localhost","root");

mysql_select_db("daybreaker",$db);

$result = mysql_query("DELETE * FROM showdate",$db);

echo $result;

echo "All records have been deleted.";

?>

</body>
</html>

    try...

    DELETE * FROM table WHERE 1=1

    or

    DELETE * FROM table WHERE id>0

      I tried these and it doesnt' work. I get no reply when I do it from the mySQL command line too.

      Originally posted by tekky
      try...

      DELETE * FROM table WHERE 1=1

      or

      DELETE * FROM table WHERE id>0

        Don't put the * in there, that isn't valid.

        DELETE FROM table
        OR:
        DELETE FROM table WHERE ... etc. etc.

          That was it. Thanks!!!

          Originally posted by everknown
          I tried these and it doesnt' work. I get no reply when I do it from the mySQL command line too.

            Write a Reply...