PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Hello to all. I am learning to script php/mysql using a book from HeadFirst. I have gotten to a situation where I cannot get the code in the lesson to work. One issue that I deal with is that the syntax in the book does not match what is in the book, so I have to hunt through the code until I get the correct syntax to work. On this issue, I do not get any results from running the script. Below is the code exactly as it is on the server. Please take a look and tell me where I am going wrong. Any help would be appreciated. Thanks
if (isset($_POST['submit'])
{
foreach ($_POST['todelete'] as $delete_id)
{
mysql_query("SELECT first_name FROM email_list WHERE id = $delete_id");
mysql_query($link, mysql_query);
}
echo 'Customer(s) removed.<br />';
}
There is no point in the second mysql_query() call. I also think you're going for "DELETE FROM email_list WHERE id = $delete_id" for the first query.
Thanks William for your quick response. I made the changes that you suggested and still get the same blank page. It looks like it is trying to run the while loop because there is a delay between when I call the script and then the blank screen. Any other ideas?