954,193 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Same problem

Hi i also have the same problem:

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL
result resource in /home/digital/up51/libs/dblib.inc on line 356

here is the script:

**=======================================================================//
// Get Members based on their individual loans
// Files which uses this function: form_collections.php
//========================================================================*/


function getMembers($loan_type_ID,$loan_accnt_ID)

{
global $link;
$new_temp = "CREATE TABLE temp_collections TYPE=InnoDB SELECT * FROM upcoop.loans_outstanding WHERE loan_type_ID ='$loan_type_ID'";
$resulta = mysql_query($new_temp,$link);

$new_query = "SELECT * FROM temp_collections";
$resultb = mysql_query($new_query,$link);


while ($row = mysql_fetch_array($resultb,MYSQL_ASSOC) ){

$query = "SELECT members.members_ID, members.first_name,members.mid_name,members.last_name,
temp_collections.loan_accnt_ID,temp_collections.monthly_amornt FROM members LEFT JOIN temp_collections ON
members.members_ID = temp_collections.members_ID
WHERE temp_collections.loan_type_ID = '$row[loan_type_ID]'ORDER BY last_name";


$result = @mysql_query($query,$link);
if (!$result)
die ("getMembers fatal error: ".mysql_error());
$ret = array();
while ($row = mysql_fetch_array($result) )
array_push($ret,$row);
return $ret;
}
}

pls help me...

DigitalDre
Newbie Poster
2 posts since Jul 2006
Reputation Points: 10
Solved Threads: 0
 

Please wrap code in [ code ] tags.

Are you sure the contents of your $result variable are what you're looking for? Take a close look at your code (and maybe echo a few things out) and verify this.

Puckdropper
Posting Pro
500 posts since Jul 2004
Reputation Points: 23
Solved Threads: 23
 

The most common problem is that your query does not return anything. Also, are you sure that $link still points to the correct (and open) db?

pritaeas
Posting Expert
Moderator
5,446 posts since Jul 2006
Reputation Points: 653
Solved Threads: 874
 

The odd thing is that it worked in my friend's computer. this script didn't work in my computer... does it have something to do with my settings in php or mysql?

DigitalDre
Newbie Poster
2 posts since Jul 2006
Reputation Points: 10
Solved Threads: 0
 

Take the warning suppression marker (@) out of this line of code:

$result = @mysql_query($query,$link);


so that you can see the error.

Lafinboy
Junior Poster
172 posts since Jul 2004
Reputation Points: 16
Solved Threads: 7
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You