I have this code in a php file and it doesn't return a value (or if it does, it isn't echoing it out):
$a = "SELECT COUNT(wo_number) FROM detail WHERE cust_number = " . $_SESSION[ 'customer_ID' ] or die( mysql_error() );
$b = mysqli_query( $a );
$rows = mysqli_fetch_array( $b, MYSQLI_NUM );
echo( $_SESSION[ 'customer_ID' ] ); //This echos the expected value just fine...
print_r( "<BR>ROWS: " . $rows ) //This echos "ROWS: ", but no value... ;
echo( $a ); //Echos the query properly, with the correct value from $_SESSION[ 'customer_ID' ]
Can anyone see a reason for this?
If I paste the query into phpMyAdmin and run it with the value of $_SESSION[ 'customer_ID' ] in the query, it runs and returns the correct number of rows. I have other queries in the same document that work fine, so I know it isn't a db access problem.