anton_1 Posted August 13, 2011 Share Posted August 13, 2011 values are prceeding into update script but not changing the values in the db Any help is greatly appreciated! <?php mysql_connect('localhost', 'web101-db1-1', ''pass''); mysql_select_db('web101-db1-1'); ini_set('display_errors', 1); error_reporting(-1); $valueFrom = $_POST['Assign']; $id=mysql_real_escape_string($_POST["id"]); $query="UPDATE Helpdesk SET AssignedTo ='$valueFrom' WHERE id='$id'"; //not sure what goes after where? mysql_query($query); echo $query; echo "The Ticket is Now Assigned to" . $valueFrom; ?> i echo the query and get UPDATE Helpdesk SET AssignedTo ='Anthony Spence' WHERE id='2'The Ticket is Now Assigned toAnthony Spence cant see why its not updating :s Quote Link to comment https://forums.phpfreaks.com/topic/244683-update-database/ Share on other sites More sharing options...
jcbones Posted August 13, 2011 Share Posted August 13, 2011 Change: mysql_query($query); To: mysql_query($query) or trigger_error($query . ' has encountered an error.<br />' . mysql_error()); Make sure you have errors at max, and display errors on. Top of script (right after opening <?php tag). Add: error_reporting(E_ALL); ini_set('display_errors',1); Quote Link to comment https://forums.phpfreaks.com/topic/244683-update-database/#findComment-1256777 Share on other sites More sharing options...
anton_1 Posted August 13, 2011 Author Share Posted August 13, 2011 Thank you ever so much lol! Iv been trying to update the wrong table. turning all errors ON showed me lol Quote Link to comment https://forums.phpfreaks.com/topic/244683-update-database/#findComment-1256778 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.