[PHP] Re: Can anyone tell me why this code doesn't insert anything?

2004-02-23 Thread pete M
Brian Dunning wrote:

This inserts nothing into the database, but returns no error that I can 
see. How come? What's wrong with it?

$dbname = my_database;
$dbconnection = mysql_connect(mysql05.powweb.com,my_user,my_pass);
mysql_select_db($dbname, $dbconnection);
$query = INSERT INTO invoices
(ip,total,creation,first_name,email,session,last_nam')
VALUES ('0.0.0.0','0.00',NOW(),'Bob','[EMAIL PROTECTED]','12345','Smith');
$result = mysql_query($query);
also need to chack if there are add magic quotes and add slashes

pete

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Can anyone tell me why this code doesn't insert anything?

2004-02-23 Thread Nicole
I don't know if this will help, but I always do:

$result = mysql_query($query,$dbconnection);

Nicole

Brian Dunning [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 This inserts nothing into the database, but returns no error that I can
 see. How come? What's wrong with it?

 $dbname = my_database;
 $dbconnection = mysql_connect(mysql05.powweb.com,my_user,my_pass);
 mysql_select_db($dbname, $dbconnection);
 $query = INSERT INTO invoices
 ('ip','total','creation','first_name','email','session','last_name')
 VALUES
 ('0.0.0.0','0.00',NOW(),'Bob','[EMAIL PROTECTED]','12345','Smith');
 $result = mysql_query($query);

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php