monkeypaw201 Posted February 19, 2008 Share Posted February 19, 2008 Here is the code: <?php $con = mysql_connect("localhost","user","pass"); if (!$con) { die('Could not connect: ' . mysql_error()); }mysql_select_db("database", $con); mysql_query("UPDATE private_messages SET read = 'Yes' WHERE id = '$_GET[id]'");mysql_close($con); ?> Its not working... no errors, the page loads fine, it just doesnt update Quote Link to comment Share on other sites More sharing options...
revraz Posted February 19, 2008 Share Posted February 19, 2008 Put the query in a string, echo the query to make sure it is reading your id, and use mysql_error() after your query to see if there are any errors. Quote Link to comment Share on other sites More sharing options...
monkeypaw201 Posted February 19, 2008 Author Share Posted February 19, 2008 Put the query in a string, echo the query to make sure it is reading your id, and use mysql_error() after your query to see if there are any errors. Query in string outputs: UPDATE private_messages SET read = 'Yes' WHERE id = '1' mysql_error after query outputs: (nothing) Soooo Lost... Quote Link to comment Share on other sites More sharing options...
monkeypaw201 Posted February 19, 2008 Author Share Posted February 19, 2008 can anyone help? Quote Link to comment Share on other sites More sharing options...
revraz Posted February 19, 2008 Share Posted February 19, 2008 Remove the single quotes around 1 and see if it works. Quote Link to comment Share on other sites More sharing options...
monkeypaw201 Posted February 19, 2008 Author Share Posted February 19, 2008 did help... i'm pretty much clueless on whats wrong.. Quote Link to comment Share on other sites More sharing options...
monkeypaw201 Posted February 19, 2008 Author Share Posted February 19, 2008 UPDATE:: Typo on post above, DIDN'T HELP... Anyone? ??? Quote Link to comment Share on other sites More sharing options...
Coreye Posted February 19, 2008 Share Posted February 19, 2008 Try: <?php $con = mysql_connect("localhost","user","pass"); if (!$con) { die('Could not connect: ' . mysql_error()); }mysql_select_db("database", $con); mysql_query("UPDATE `private_messages` SET `read`='Yes' WHERE `id`='" . $_GET['id'] . "')or die(mysql_error()); mysql_close($con); ?> 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.