CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 mysql_fetch_array not a valid resource ?

Print topic Send  topic

Author Message
wlad

Posts: 7
Posted: 04/28/2004, 3:19 AM

I am using mysql_fetch_array with CCS query and I cant make it work, here is my class function:

function getTable(){
$detailsCategories= $this->con->query("SELECT detail_categorie_id FROM details_categories WHERE categorie_id=".
$this->con->ToSQL($this->category, ccsInteger));

$catCount= CCDLookup("COUNT(detail_categorie_nom)","details_categories","categorie_id=".
$this->con->ToSQL($this->category, ccsInteger), $this->con);

$grid="<table border=\"1px\">";
$grid.="<tr><td colspan=\"$catCount\">". CCDLookup("categorie_nom","categories","categorie_id=".
$this->con->ToSQL($this->category, ccsInteger), $this->con) . "</td>";
$grid.="</tr><tr>";

while($row=mysql_fetch_array($detailsCategories)){ << HERE IS MY PROBLEME
$title= CCDLookup("detail_categorie_nom","details_categories","detail_categorie_id=".
$this->con->ToSQL($row[0], ccsInteger), $this->con);

$grid.="<td>". $title . "</td>";
$grid.="";
}
...

And I always get the error:
Warning: mysql_fetch_array(): 11 is not a valid MySQL result resource

Maybe is it a matter of scope, it seems that the $detailsCategories is not initialize when it comes to the while loop ?

wlad
View profile  Send private message
peterr


Posts: 5971
Posted: 04/28/2004, 12:28 PM

I'm not very familiar with PHP but I tried this Google query and it returned 100,000 results:
http://www.google.com/search?q=%22mysql_fetch_array%28%...ult+resource%22
, which looks like some common issue. There seem to be some helpful answers as well.
Also see:
http://groups.google.com/groups?q=%22mysql_fetch_array(...t%20resource%22
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
Timotheos

Posts: 4
Posted: 05/03/2004, 3:49 PM

I could be mistaken but I believe the CCDLookup function runs an sql query. If this is the case then the previous query you ran for $detailsCatagories is gone.
View profile  Send private message
peterr


Posts: 5971
Posted: 05/03/2004, 9:56 PM

True that CCDLookup runs an sql query. In this case looks like wlad could use another DB connection to run queries that should not be affected by CCDLookup.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.