Jump to content


Photo

supplied argument is not a valid MySQL result reso


  • Please log in to reply
2 replies to this topic

#1 borki

borki
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 25 October 2005 - 04:06 PM

Hello,

can anyone plz have a look at my sourcecode? I do not find the error:

<?
$strSQL="SELECT customers.rabatt FROM customers INNER JOIN orders ON customers.firma = orders.firma WHERE orders.order_id=".$rechnung;
$rabatt=mysql_query($strSQL);
while ($Zeile=mysql_fetch_array($rabatt));
{
echo "<option value=".
"\"$Zeile[0]\">$Zeile[0]</option>";
}
$rab= $Zeile[0] * $rabatt;
echo $rab ?>

The error is message is:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /var/www/...

Thx for your help

#2 ryanlwh

ryanlwh
  • Staff Alumni
  • Advanced Member
  • 511 posts

Posted 25 October 2005 - 05:28 PM

your query probably just return nothing (but syntatically correct). try it out in phpmyadmin. also, do this
$rabatt=mysql_query($strSQL) or die(mysql_error());

Please use EDIT * 100...
Please use
or [php] * 1000...

PLEASE READ THE POSTED SOLUTIONS CAREFULLY * 1000000...

#3 borki

borki
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 25 October 2005 - 06:08 PM

Hey, thx a lot for your help!

I almost don't dare say what the problem was cause it's just a n00b error:

"No database selected" LOL Now everything works...

cu




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users