thetick Posted February 4, 2010 Share Posted February 4, 2010 Hy ppl. I need some help with some code <? if(isset($_GET['id'])) $info = mysql_fetch_array(mysql_query("SELECT * FROM offers WHERE offerid='".$_GET['id']."' LIMIT 1")); elseif(isset($_POST['id'])) $info = mysql_fetch_array(mysql_query("SELECT * FROM offers WHERE offerid='".$_POST['id']."' LIMIT 1")); else $info = $_POST; if(isset($_POST['name'])) $errors = validate($_POST); if(empty($errors) && isset($_POST['name'])) { $success = mysql_query("UPDATE offers SET name='".$_POST['name']."', credits='".$_POST['credits']."', requirements='".$_POST['requirements']."', payout='".$_POST['payout']."', networkid='".$_POST['affnetwork']."', description='".$_POST['description']."', link='".$_POST['link']."', creative='".$_POST['creative']."' WHERE offerid='".$_POST['id']."' LIMIT 1") or die(mysql_error()); $info = mysql_fetch_array(mysql_query("SELECT * FROM offers WHERE offerid='".$_POST['id']."' LIMIT 1")); } ?> Does anyone see anything wrong with this ? I am geting error: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/a8738962/public_html/admin/viewoffer.php on line 3 UPDATE: Line 3 would be the first line in the code posted here. Quote Link to comment https://forums.phpfreaks.com/topic/190886-need-some-help/ Share on other sites More sharing options...
thetick Posted February 4, 2010 Author Share Posted February 4, 2010 PFFFFF ... nevermind .... simple mistake, "offerid" does not exist in DB. it's "id" . I think this is my que to go to sleep. Quote Link to comment https://forums.phpfreaks.com/topic/190886-need-some-help/#findComment-1006639 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.