adam291086 Posted October 16, 2009 Share Posted October 16, 2009 what is wrong with this <?php if ($_SERVER['HTTP_REFERER']) { if($_GET['id']) { $con = mysql_connect("","",""); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("rubberduckiee", $con); $result = mysql_query("SELECT * FROM email_content where id=".$_GET['id']); while($row = mysql_fetch_array($result)) { if($_GET['part'] == "body") { echo $row['email_content_body']; } elseif($_GET['part'] == "footer") { echo $row['email_content_footer']; } elseif ($_GET['part'] == "header") { echo $row['email_content_header']; } } } } ?> i am getting the error Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/rubberduckiee/webapps/editor/email_editor.php on line 17 Quote Link to comment https://forums.phpfreaks.com/topic/177895-warning-mysql_fetch_array-supplied-argument-is-not-a-valid-mysql-result/ Share on other sites More sharing options...
GingerRobot Posted October 16, 2009 Share Posted October 16, 2009 Your query is failing. Try checking for errors: $sql = "SELECT * FROM email_content where id=".$_GET['id']); $result = mysql_query($sql) or trigger_error(mysql_error() . '<br />Query was:' . $sql,E_USER_ERROR); Quote Link to comment https://forums.phpfreaks.com/topic/177895-warning-mysql_fetch_array-supplied-argument-is-not-a-valid-mysql-result/#findComment-937977 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.