Concatenate your string.
"...VALUES ('".$client."','".$contact."')" (etc.)
Or just replace the double-quotes within the string with single quotes.
That should do it.
>>>>>>>>>>>>>>>>>> Original Message <<<<<<<<<<<<<<<<<<
On 4/23/01, 10:32:47 AM, "shawn" <[EMAIL PROTECTED]> wrote regarding
[PHP] insert data to mysql:
> Hello,
> I am just wondering if someone can help me out with this. This is what I
have so far, but it isnt working:
> MYSQL_CONNECT($hostname, $username, $password)
> or die("Unable to connect to database");
> @mysql_select_db( "$dbName")
> or die( "Unable to select database");
> $sql = "INSERT INTO $userstable (client, contact, email, address, city,
state, zip, phone, fax, model, country, details, type)
> VALUES("$client", "$contact", "$email", "$address", "$city", "$state",
"$zip", "$phone", "$fax", "$model", "$country", "$details", "$type")";
> $result = MYSQL_QUERY($sql) or die ("Couldn't execute query");
> MYSQL_CLOSE();
> Im new (no kidding?), so i hope this is easy, also, is there a address
anyone can point me to for a archive of this list?
> Thanks in advance,
> Shawn
--
PHP General 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]