Re: Can anyone tell me why this code doesn't insert anything?
| From: | Nicole | Date: | Mon, 23 Feb 2004 17:24:24 +0000 |
| Subject: | Re: Can anyone tell me why this code doesn't insert anything? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-178547@lists.php.net to get a copy of this message | ||
I don't know if this will help, but I always do:
$result = mysql_query($query,$dbconnection);
Nicole
"Brian Dunning" <brian@briandunning.com> wrote in message
news:61E5E95C-6623-11D8-BDB2-003065B5CB62@briandunning.com...
> 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','name@domain.com','12345','Smith')";
> $result = mysql_query($query);