Jump to content

Need some help


thetick

Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/190886-need-some-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.