Same problem

Reply

Join Date: Jul 2006
Posts: 2
Reputation: DigitalDre is an unknown quantity at this point 
Solved Threads: 0
DigitalDre DigitalDre is offline Offline
Newbie Poster

Same problem

 
0
  #1
Jul 27th, 2006
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...
Reply With Quote Quick reply to this message  
Join Date: Jul 2004
Posts: 494
Reputation: Puckdropper is an unknown quantity at this point 
Solved Threads: 21
Puckdropper Puckdropper is offline Offline
Posting Pro in Training

Re: Same problem

 
0
  #2
Jul 27th, 2006
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.
www.uncreativelabs.net

Old computers are getting to be a lost art. Here at Uncreative Labs, we still enjoy using the old computers. Sometimes we want to see how far a particular system can go, other times we use a stock system to remind ourselves of what we once had.
Reply With Quote Quick reply to this message  
Join Date: Jul 2006
Posts: 811
Reputation: pritaeas is on a distinguished road 
Solved Threads: 132
Sponsor
pritaeas's Avatar
pritaeas pritaeas is offline Offline
Practically a Posting Shark

Re: Same problem

 
0
  #3
Jul 27th, 2006
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?
"If it is NOT source, it is NOT software."
-- NASA
Reply With Quote Quick reply to this message  
Join Date: Jul 2006
Posts: 2
Reputation: DigitalDre is an unknown quantity at this point 
Solved Threads: 0
DigitalDre DigitalDre is offline Offline
Newbie Poster

Re: Same problem

 
0
  #4
Jul 28th, 2006
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?
Reply With Quote Quick reply to this message  
Join Date: Jul 2004
Posts: 166
Reputation: Lafinboy is an unknown quantity at this point 
Solved Threads: 7
Lafinboy's Avatar
Lafinboy Lafinboy is offline Offline
Junior Poster

Re: Same problem

 
0
  #5
Jul 28th, 2006
Take the warning suppression marker (@) out of this line of code:
  1. $result = @mysql_query($query,$link);
so that you can see the error.
If I've been a help please confirm by clicking the Add to Lafinboy's Reputation link in the header of this reply.

Lafinboy Productions
:: Website Design :: Website Development ::

Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the PHP Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC