jeffshen Posted August 9, 2006 Share Posted August 9, 2006 Dear All,at the moment I have this[code]echo $stockname;echo "<br>";echo $array[0];echo "<br>";echo $numstocks;echo "<br>";echo $inprice;echo "<br>";echo $currtime;echo "<br>";echo $uniqueid;echo "<br>";$mysqlinsert = "UPDATE `stocks` SET `code` = $stockname , `name` = $array[0] , `owned` = $numstocks , `buy_price` = $inprice , `timestamp` = $currtime WHERE `key` = $uniqueid";echo $mysqlinsert;echo"<br>";mysql_query($mysqlinsert) or die ("Error inserting records");[/code]where all the random echos are used for debugging... I still cant find the mistake though, when I send that to the browser, the result I get is 0003HK & CHINA GAS123142115515147472UPDATE `stocks` SET `code` = 0003 , `name` = HK & CHINA GAS , `owned` = 123 , `buy_price` = 142 , `timestamp` = 1155151474 WHERE `key` = 72Error inserting recordswhere the last line indicates that the UPDATE function has failed, but I cant see whats wrong with my update function.can someone please help?thanks a lot in advanceJeff Quote Link to comment Share on other sites More sharing options...
kalivos Posted August 9, 2006 Share Posted August 9, 2006 Try this$mysqlinsert = "UPDATE `stocks` SET `code` = '$stockname' , `name` = '".$array[0]."' , `owned` = '$numstocks' , `buy_price` = '$inprice' , `timestamp` = '$currtime' WHERE `key` = '$uniqueid'"; Quote Link to comment Share on other sites More sharing options...
jeffshen Posted August 9, 2006 Author Share Posted August 9, 2006 Thanks a lot kalivos it worked =)Jeff Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.