944,221 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 1254
  • PHP RSS
Jul 27th, 2006
0

Same problem

Expand Post »
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...
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
DigitalDre is offline Offline
2 posts
since Jul 2006
Jul 27th, 2006
0

Re: Same problem

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.
Reputation Points: 23
Solved Threads: 23
Posting Pro in Training
Puckdropper is offline Offline
494 posts
since Jul 2004
Jul 27th, 2006
0

Re: Same problem

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?
Sponsor
Featured Poster
Reputation Points: 557
Solved Threads: 734
Bite my shiny metal ass!
pritaeas is offline Offline
4,207 posts
since Jul 2006
Jul 28th, 2006
0

Re: Same problem

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?
Reputation Points: 10
Solved Threads: 0
Newbie Poster
DigitalDre is offline Offline
2 posts
since Jul 2006
Jul 28th, 2006
0

Re: Same problem

Take the warning suppression marker (@) out of this line of code:
PHP Syntax (Toggle Plain Text)
  1. $result = @mysql_query($query,$link);
so that you can see the error.
Reputation Points: 16
Solved Threads: 7
Junior Poster
Lafinboy is offline Offline
166 posts
since Jul 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: how to manipulate characters in strings
Next Thread in PHP Forum Timeline: php/mysql communication problem





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC