Steve
I believe you're missing the closing bracket ) after $Website.
I think it's clearer if you use single quotes (') rather than double quotes
and then having to escape them.
Something like:
"INSERT INTO $table_name
(CompanyID, CompanyName, Address, City, StateorProvince,
PostalCode,Region,Country,WebSite)
VALUES ('',
'$CompanyName',
'$Address',
'$City',
'$StateorProvince',
'$PostalCode',
'$Region',
'$Country',
'$WebSite')";
regards
--
Jason Wong
Gremlins Associates
- Original Message -
From: Steve Fitzgerald <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, August 02, 2001 2:35 AM
Subject: [PHP-DB] INSERT Won't Insert
> This should be a simple insert. I must be missing something because I keep
> getting: Couldn't execute query.
>
> What am I missing?
>
> error_reporting(15);
>
> $db_name = "dbname";
> $table_name="company";
> $connection = @mysql_connect("servname","username", "password")or die
> ("Couldn't connect.");
>
> $db = @mysql_select_db($db_name, $connection) or die ("Couldn't select
> database.");
>
> $add_co_sql = "INSERT INTO $table_name
> (CompanyID, CompanyName, Address, City, StateorProvince,
> PostalCode,Region,Country,WebSite)
> VALUES
> (\"\",
>
\"$CompanyName\",\"$Address\",\"$City\",\"$StateorProvince\",\"$PostalCode\"
> ,\"$Region\",\"$Country\",\"$WebSite\"
> ";
>
> $result = @mysql_query($add_co_sql, $connection) or die ("Couldn't execute
> query.");
> ?>
>
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]