[thelist] MySql Update Works sometimes?

Joshua Hmielowski jhmielowski at comcast.net
Fri Feb 11 16:34:38 CST 2005


I have a php/mysql script updating my database.
By the act of some unforeseen greater force,
sometimes it works and sometimes it does not.
This has never happened to me before.

so basically I have this form where all of the information about this 
product is fed into
the input values from the database (works fine). If any values need 
updating, they can be
changed and submitted back to the DB via php/mysql UPDATE statement.
Now sometimes, I can go to this form, make changes and it updates just 
fine.
And sometimes It throws and error [no database selected].

I can go to one product, update it..and if throws an error, I can hit 
the back  button and submit it again,
and it work fine? I have done a var_dump() and all variables are 
getting passed no matter what happens
and the SQL is fine. I must be just missing something.
any thoughts?


Code:

// CONNECTION IS MADE VIA INCLUDE AND POPULATES FORM JUST FINE.

  if (isset($_REQUEST["job"]) && ($_REQUEST["job"] == "update_product")) 
{
	
  	$updateSQL = "UPDATE ".$_REQUEST['type']." SET 
id='".$_REQUEST['id']."', color='".$_REQUEST['color']."',  
size='".$_REQUEST['size']."', `vender#`='".$_REQUEST['vender#']."', 
series='".$_REQUEST['series']."', leadTime='".$_REQUEST['leadTime']."', 
items='".$_REQUEST['items']."', keywords='".$_REQUEST['keywords']."'  
WHERE number=".$_REQUEST['number']."";

   	$Result= mysql_query($updateSQL) or die(mysql_error());


echo $updateSQL;  // 	OUTPUT IS FINE.
echo "<br>";
echo $Result;  // 		WORK SSOMETIMES.
}



Joshua Hmielowski
---------------------------------
Independent Studio
[tel] 970-429-7469
[cel] 970-274-0870
www.independentstudio.net



More information about the thelist mailing list