When I execute the code below it generates an array with what appears to be no field names. If I use a loop to generate
Code: Select all
foreach ($row as $index=>$value)
echo $index." = ".$value."<br>";Any ideas? Am I doing something wrong (highest probability)?
BTW, the GetRecordset() is just a wrapper function that just checks for a connection prior to executing the SQL statement and returning the resultset.
//Code
Code: Select all
$i=1;
$sql = 'select * from user';
//a simple wrapper function
$rs = GetRecordset($context, $sql);
print "<table>\n";
while (($i <= 200) && ($row = mysql_fetch_array($rs, MYSQL_ASSOC))) {
print "\t<tr>\n";
print "\t\t<td>User: </td>\n";
print "\t\t<td>".$rowї"user"]." </td>\n";
print "\t\t<td>Host: </td>\n";
print "\t\t<td>".$rowї"host"]." </td>\n";
print "\t</tr>\n";
$i++;
}
print "</table>\n";User: Host:
User: Host:
User: Host: