Thursday, December 5, 2002, 3:24:15 PM, you wrote:
BC> I am struggling with the code below.  I keep getting the error "Couldn't
BC> execute query".  Please help me out, let me know where I am going wrong.

BC> <?

BC> $db_name = "db1";
BC> $table_name = "user";

BC> $connection = @mysql_connect("localhost", "user", "password") or
BC> die("Couldn't connect.");

BC> $db = @mysql_select_db($db_name, $connection) or die("Couldn't select
BC> database.");

BC> $sql = "UPDATE $table_name
BC>         SET
BC>         name = \"$name\",
BC>         lname = \"$lname\",
BC>         mobil = \"$mobil\",
BC>         email = \"$email\",
BC>         url = \"$url\",
BC>         WHERE id= \"$id\"
BC> ";

BC> $result = @mysql_query($sql,$connection) or die("Couldn't execute query.");


BC> --------------------------------------------------------------------------
BC> The content of this email message and any attachments are confidential and
BC> may be legally privileged, intended solely for the addressee.  If you are
BC> not the intended recipient, be advised that any use, dissemination,
BC> distribution, or copying of this e-mail is strictly prohibited.  If you
BC> receive this message in error, please notify the sender immediately by reply
BC> email and destroy the message and its attachments.

do this to debug your code:

$result = @mysql_query($sql,$connection) or die("Couldn't execute query 


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

Reply via email to