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
https://forums.phpfreaks.com/topic/98271-mysql-fetch-array-error-driving-me-batty/
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.