Zyncmaster2006 Posted July 28, 2006 Share Posted July 28, 2006 I have a problem on this script. i think its not working...Warning: mysql_fetch_array(): supplied argument is not a valid MySQLresult resource in /home/digital/up51/libs/dblib.inc on line 356here 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 ONmembers.members_ID = temp_collections.members_IDWHERE 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;}} Link to comment https://forums.phpfreaks.com/topic/15849-need-help-on-this-code/ Share on other sites More sharing options...
redarrow Posted July 28, 2006 Share Posted July 28, 2006 wheres the wheres cluse at the end of here.$new_query = "SELECT * FROM temp_collections";also where your OR DIE("there is a mysql problam"); on all querys.$resultb = mysql_query($new_query,$link);also use mysql_fetch_assoc ok.while ($row = mysql_fetch_array($resultb,MYSQL_ASSOC) ){and get rid of @ if theres an error fix it.and last of all echo out all your querys for debugging ok. Link to comment https://forums.phpfreaks.com/topic/15849-need-help-on-this-code/#findComment-64956 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.