I suspect it's something to do with the userid = $userid[$k] bit but not sure what the correct suntax is.PHP Code:$result2 = mysql_query("SELECT * FROM userpayments WHERE userid = $userid[$k] ORDER BY id ASC");
Can someone help me out?? Cheers
I suspect it's something to do with the userid = $userid[$k] bit but not sure what the correct suntax is.PHP Code:$result2 = mysql_query("SELECT * FROM userpayments WHERE userid = $userid[$k] ORDER BY id ASC");
Can someone help me out?? Cheers
It has to be like this:
Other than simple variable calls, curly braces are needed.PHP Code:$result2 = mysql_query("SELECT * FROM userpayments WHERE userid = {$userid[$k]} ORDER BY id ASC");
Last edited by Twinkie; 07-27-2009 at 05:18 PM.
Thanks. Got another prob now:
using this code:
Gives me this error:PHP Code:$result2 = mysql_query("SELECT * FROM userpayments WHERE userid = {$userid[$k]} AND paymentid = $payid ORDER BY paymentid ASC");
while($row2 = mysql_fetch_array($result2))
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/miocene1/public_html/includes/getdata.php on line 52
Edit: Nevermind got one of my column names wrong
Last edited by miocene2; 07-27-2009 at 05:32 PM.
That would be because the mysql query is coming back with no results. You will have to go into PHPmyAdmin and see what wrong. Or, you can post whats in those variables (what the query resolves to, $userid, and page link), and the mysql database entry you are trying to find here as well as the table structure. To me, the first one is easier![]()
Thanks all sorted now!
This helped me also thank you