Re: Why would this command just Die!
| From: | Julie Meloni | Date: | Sun, 19 May 2002 22:39:34 +0000 |
| Subject: | Re: Why would this command just Die! | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-98390@lists.php.net to get a copy of this message | ||
PD> <?php
PD> $answers="$band, $middlename, $pot";
PD> $date=date ("l dS of F Y h:i:s A");
PD> $sql = "INSERT INTO prizeline (id, email, name, address, answers, date) VALUES
PD> ('', '$email', '$name', '$address', '$answers',
PD> '$date')";
PD> echo $sql;
PD> mysql_query($sql) or die ("There has been an error");
PD> ?>
If this is all of your script, then you are missing those pesky
"connect to server" and "select database" functions.
If you replace your die message with die(mysql_error()) you will
probably see a very helpful error message such as "no database
selected" or "hey buddy, not connected".
- Julie
--> Julie Meloni
--> julie@thickbook.com
--> www.thickbook.com
Find "Sams Teach Yourself MySQL in 24 Hours" at
http://www.amazon.com/exec/obidos/ASIN/0672323494/thickbookcom-20