jaa312 Posted October 24, 2011 Share Posted October 24, 2011 I have been banging my head for quite a number of hours on this.........I am getting the below error with firefox 7 or chrome but NOT with IE Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/unlockth/public_html/motorola/insertmoto.php on line 35 Here is the code.......pls can anyone help me? <?php $userip = ($_SERVER['X_FORWARDED_FOR']) ? $_SERVER['X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR']; $name = $_POST['name'] ; $email = $_POST['email'] ; $phone = $_POST['phone'] ; $operator = $_POST['operator'] ; $imei = $_POST['imei'] ; $todayis = date("l, F j, Y, g:i a") ; @mail( "[email protected]", "ORDER SUBMISSION", $message = " $userip $message = $todayis Name: $name Email: $email Phone Model: $phone Phone Operator: $operator Phone Imei: $imei", "From: MOTOROLA SUBMISSION>"); ?> <? $id = $_POST['id']; include "/home/unlockth/password.php"; mysql_select_db("unlockth_unlocking",$db); mysql_query("INSERT INTO custdetails VALUES ('','$name','$email','$phone','$operator','$imei')"); $insertid = mysql_insert_id(); include "/home/unlockth/password.php"; mysql_select_db("unlockth_unlocking",$db); $getdata = mysql_query("SELECT * FROM motorola WHERE id=$id", $db); $row = mysql_fetch_array($getdata); $title = $row["title"]; $price_1 = $row["price_1"]; $price_2 = $row["price_2"]; $price_3 = $row["price_3"]; $imageaddr = $row["imageaddr"]; $description = $row["description"]; $keywords = $row["keywords"]; $time = $row["time"]; include '/home/unlockth/public_html/motorola/outputmotocode.php';?> Quote Link to comment https://forums.phpfreaks.com/topic/249731-submit-form-works-with-internet-explorer-but-not-with-firefox-7-or-chrome/ Share on other sites More sharing options...
PFMaBiSmAd Posted October 24, 2011 Share Posted October 24, 2011 Your form isn't submitting the $_POST['id'] field and probably none of the other $_POST variables. You would need to post your form to get help with what is wrong with it. Quote Link to comment https://forums.phpfreaks.com/topic/249731-submit-form-works-with-internet-explorer-but-not-with-firefox-7-or-chrome/#findComment-1281851 Share on other sites More sharing options...
cunoodle2 Posted October 24, 2011 Share Posted October 24, 2011 I'm betting you have an error in your html form. Since IE is so loose on errors it may be slipping through. I bet that "$id" is not even set or being passed in. You need to do better error checking too after you get your results from the query. Do this.. $getdata = mysql_query("SELECT * FROM motorola WHERE id=$id", $db); if (!$getdata) echo "There are no results else { $row = mysql_fetch_array($getdata); $title = $row["title"]; $price_1 = $row["price_1"]; $price_2 = $row["price_2"]; $price_3 = $row["price_3"]; $imageaddr = $row["imageaddr"]; $description = $row["description"]; $keywords = $row["keywords"]; $time = $row["time"]; } Quote Link to comment https://forums.phpfreaks.com/topic/249731-submit-form-works-with-internet-explorer-but-not-with-firefox-7-or-chrome/#findComment-1281852 Share on other sites More sharing options...
jaa312 Posted October 24, 2011 Author Share Posted October 24, 2011 Your form isn't submitting the $_POST['id'] field and probably none of the other $_POST variables. You would need to post your form to get help with what is wrong with it. I don't agree with you that the form isn't submitting the $_POST['id'] field because if i do echo $id; under $id = $_POST['id']; the id will come in IE and again not in firefox or chrome. It must be something else......... :( cunoodle2.....i followed your suggestion and received the below error: Parse error: syntax error, unexpected '"', expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/unlockth/public_html/motorola/insertmoto.php on line 41 The form i can post but it is huge........Can i send it via personal message? I would appreciate all your help. Tahnk you guysss Quote Link to comment https://forums.phpfreaks.com/topic/249731-submit-form-works-with-internet-explorer-but-not-with-firefox-7-or-chrome/#findComment-1281900 Share on other sites More sharing options...
Pikachu2000 Posted October 24, 2011 Share Posted October 24, 2011 Don't PM the form; just post it here. Quote Link to comment https://forums.phpfreaks.com/topic/249731-submit-form-works-with-internet-explorer-but-not-with-firefox-7-or-chrome/#findComment-1281902 Share on other sites More sharing options...
PFMaBiSmAd Posted October 24, 2011 Share Posted October 24, 2011 not in firefox or chrome. Which is why your form needs to be corrected so that it will submit the data in all browsers. If you aren't, can't or won't post your form, I recommend starting by validating the form page at validator.w3.org Quote Link to comment https://forums.phpfreaks.com/topic/249731-submit-form-works-with-internet-explorer-but-not-with-firefox-7-or-chrome/#findComment-1281907 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.