Re: new problem... problem with Query...
| From: | Olivier Hubert | Date: | Mon, 19 Nov 2001 22:54:48 +0000 |
| Subject: | Re: new problem... problem with Query... | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-10523@lists.php.net to get a copy of this message | ||
Hi,
If you mysql connection is the only one you're trying to maintain, I suggest you try$result = @mysql_query($sql) or die ("Couldn't execute query."); e.g. without passing the $connection parameter. Also, try using mysql_error to get the actual error message. HTH! Olivier At 16:30 2001-11-19 -0600, Todd Williamsen wrote:
Here it is.... I get the error "cannot execute query" so there is something wrong with the SQL and I cannot figure it out... <? if ((!$FirstName) || (!$LastName)) { header("Location: http://www.feminineforum.com/admin/pick_modcontact.php"); exit; } else { session_start(); } if ($valid != "yes") { header("Location: http://www.feminineforum.com/admin/contact_menu.php"); exit; } else { session_register('valid'); } $db_name = "feminineforum"; $table_name = "tblmembers"; $connection = @mysql_connect ("localhost", "feminine", "krmc33") or die ("Couldn't connect."); $db = @mysql_select_db ($db_name, $connection) or die("Couldn't select database."); $sql = "UPDATE $table_name SET FirstName = \"$FirstName\", LastName = \"$LastName\", Address1 = \"$Address1\", Address2 = \"$Address2\", City = \"$City\", State = \"$State\", Zip = \"$Zip\", HomePhone = \"$HomePhone\", WorkPhone = \"$WorkPhone\", Fax = \"$Fax\", Email = \"$Email\", UserId = \"$UserId\", Password = \"$Password\", WHERE id = \"$ID\" "; $result = @mysql_query($sql, $connection) or die ("Couldn't execute query."); -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net For additional commands, e-mail: php-windows-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net