Jump to content

mysql fetch array error driving me batty!


foreverhex

Recommended Posts

I don't know if its because Im tired or something but I seem to be over looking something. Could some one please help... I think I just lost all sanity. I keep getting

 

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in ...shop.php on line 102

 

This is a normal error, so I go back to see if somethings wrong with my coding in SQL and I can find it. Here is the code

 

<?php
//There is other crap before this that in theory shouldn't matter.

	elseif ($_GET[action] == 'close') {
		//First get the order and make it nice and viewable
		include 'rhf_db.php';
		mysql_select_db('rhf_orders') or die('Could not select database');
		$dbnum = $_SESSION[number];
		$sql_getord = ("SELECT * FROM $dbnum WHERE status = 'open' ORDER BY date DESC") or die("Error getting order: " . mysql_error());

		$sqlnum = '0';
		while ($row_getorder = mysql_fetch_array($sql_getord)) {
			$preorder = $preorder . $row_getorder[item][$sqlnum] . ' | ' . $row_getorder[quantity][$sqlnum] . '<br>';
			$sqlnum++;
		}

		echo 'preorder: <br><br>' . $preorder;
?>

 

Thanks in advance!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.