Hi all,
I'm having a real problem with a mysql query from a php script. It works absolutely perfectly from the mysql consol but I get crap when I try to do it from php.
$sQuery = "SELECT * FROM Document_Fields WHERE doc_type_id = '$iDocumentType'";
$oResult = mysql_query($sQuery)
or DIE("Couldn't query database in getFieldNames: ".mysql_error());
for($i=0; $aRow = mysql_fetch_array($oResult); $i++)
{
$aDocumentFieldNames[$i] = $aRow;
return $aDocumentFieldNames;
}
I get three rows returned from mysql consol but only the first one from the php script. Also, any comments on loading the result set into an array - I mean how efficient is that "for" loop?.
Thanks,
Billy