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
|
|
|
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 |
|
|
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.
|
|
|
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 |
|
|
|