RE: [PHP] I need an expert to tell me what I am doing wrong
| From: | calvin_phung at non dot agilent dot com | Date: | Sat, 24 Mar 2001 01:19:46 +0000 |
| Subject: | RE: [PHP] I need an expert to tell me what I am doing wrong | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-45377@lists.php.net to get a copy of this message | ||
YoBro,
I think you need to wrap $product, $name and $email in quotes when sending
the statement to MYSQL.
Calvin
-----Original Message-----
From: YoBro [mailto:nospam@brochures.co.nz]
Sent: Friday, March 23, 2001 4:38 PM
To: php-general@lists.php.net
Subject: [PHP] I need an expert to tell me what I am doing wrong
What could I possibly be doing wrong here. The information just will not
insert into my database.
ARGH!
Please help if you can...
<?php
$user = "xyz";
$pass = "123";
//Connect to Database xyz
$db = mysql_connect("localhost", $user, $pass)OR DIE("Unable to connect to
database");
mysql_select_db("xyz",$db) OR DIE("Unable to connect to database");
$sql = ("INSERT INTO orders VALUES
'product,name,email'($product,$name,$email)");
$result = mysql_query($sql);
echo "Order for the $product has been sent";
?>
--
Regards,
YoBro
-------------------------------------------------------------
DO NOT REPLY TO THIS VIA EMAIL
PLEASE USE THE NEWSGROUP
All emails sent to this address are automatically deleted.
This is to avoid SPAM!
-------------------------------------------------------------
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net