As I said before, (and as the comment says)PHP:$statement = "DELETE FROM commentTable WHERE ID='$ID'"; // OR $statement = "DELETE FROM commentTable WHERE ID='".$ID."'";
Both lines won't hurt, but they do the same thing. Use whichever is more readable or try PDO's prepared queries, which is the superior route. There are plenty of PDO tutorials, though some have bugs and others are just low quality.You only need one of them
The first line has an extra single quote, and the last has an unterminated string ("Error: "). Notice how the coloration is all funny? Notice how "Error" is the same color as "mysql_error()"? Read over the PHP manual section on strings. It'd also be a good idea to get a good book or find a good introductory tutorial online. O'Reilly publishes quality books ("Learning PHP 5" and "Programming PHP, Second Edition"), but (like most books) they were written before PDO. Instead, they use PEAR DB, which was also good but has been supplanted.PHP:mysql_connect('localhost', 'martynba_martynb', 'test123'') or die('Error: ' . mysql_error()); ... die('Error: .mysql_error());
And don't use "die" for web scripts. You'll get malformed HTML.
Last edited: