INSERT Won't Insert
| From: | Steve Fitzgerald | Date: | Wed, 01 Aug 2001 18:35:33 +0000 |
| Subject: | INSERT Won't Insert | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-10965@lists.php.net to get a copy of this message | ||
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.");
?>