This code creates one of two SQL calls, which I have echoed to verify.
Code: Select all
mysql_select_db($dbdName, $Link);
$Query = "SELECT * FROM Form" . sprintf("%02d",$Row['Ver']) . " WHERE " . $Psn[$Row['Typ']] . ">0 ORDER BY " . $Psn[$Row['Typ']];
$Fres = mysql_query($Query, $Link);
while ($Frow = mysql_fetch_array($Fres)) // for all of the rest of the headings and questions
and
SELECT * FROM Form02 WHERE Phn>0 ORDER BY Phn
The second one returns a proper dataset as expected, the first one triggers an error saying that the "mysql_fetch_array(): supplied argument is not a valid MySQL result resource." Both of them, however, yield a valid result when I invoke them within phpmyadmin, producing the expected number of rows, properly ordered.
Any ideas as to wtf?