borki Posted October 25, 2005 Share Posted October 25, 2005 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 Quote Link to comment https://forums.phpfreaks.com/topic/2731-supplied-argument-is-not-a-valid-mysql-result-reso/ Share on other sites More sharing options...
ryanlwh Posted October 25, 2005 Share Posted October 25, 2005 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()); Quote Link to comment https://forums.phpfreaks.com/topic/2731-supplied-argument-is-not-a-valid-mysql-result-reso/#findComment-9119 Share on other sites More sharing options...
borki Posted October 25, 2005 Author Share Posted October 25, 2005 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 Quote Link to comment https://forums.phpfreaks.com/topic/2731-supplied-argument-is-not-a-valid-mysql-result-reso/#findComment-9120 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.