vinpkl Posted June 23, 2009 Share Posted June 23, 2009 hi all i m updating my database table with the below code but its not updating. In database field name is "track_id" VARCHAR (60) $track_id=$_REQUEST['track_id']; if(isset($_REQUEST['submit'])) { $track_id=$_REQUEST['track_id']; $qry_trk="update new_order set track_id = '$track_id' where order_id = $id "; echo $qry_trk; if(mysql_query(qry_trk)) { $msg2="tracking id added & updated in database"; } else { $msg2="tracking id not updated"; } } on echo it displays corect information but it doesnt updates. update new_order set track_id = 'AS12345678' where order_id = 370 when i insert the above line in sql then it updates corectly but why is it not updating from php code. vineet Quote Link to comment Share on other sites More sharing options...
gevans Posted June 23, 2009 Share Posted June 23, 2009 Turn error reporting on and see if you get an error when attempting the query. Check you db connection (can't see it here). Quote Link to comment Share on other sites More sharing options...
vinpkl Posted June 23, 2009 Author Share Posted June 23, 2009 HI GEVANS Thanks for the reply. i found the error mysql_query(qry_trk)) should be mysql_query($qry_trk)) vineet 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.