Hello, there is a small php script that I am converting from using mysql to mysqli, but I am having a bit of an issue with mysqli_fetch_fields (this is where I assume the problem lies). Basically it is a form that allows someone to enter free form queries in order to query the database. The results are printed in a nice data table. The results of the database table row return fine, but the column headings are not printing out. Instead the table headings are printing out like "Array Array", etc. Any help with this is greatly appreciated. The code is below.
if($type =="query") {
$query2 = str_replace("\\", " ", $query);
if($result = DB::inst()->query("$query2"))
_e( _t( "Successly Executed - " ) );
else
echo "<font color=red>Not able to execute the query<br>Either the
table doesnot exist or a wrong query.</font><br><br>";
_e( _t( "Query is : " ) );
echo("<font color=blue>".$query2."</font>\n");
echo "<table class=\"dynamicTable tableTools table table-striped table-bordered table-condensed table-white\">
<thead>
<tr align=center>\n";
$sds = $result->field_count;
for($ss=0; $ss<$sds; $ss++)
{
$ee = $result->fetch_fields();
echo "<td>$ee</td>";
}
echo "</tr>\n</thead>\n";
$vv = true;
while ($line = $result->fetch_assoc()) {
if($vv === true){
echo "<tr align=center>\n";
$vv = false;
}
else{
echo "<tr align=center>\n";
$vv = true;
}
foreach ($line as $col_value) {
echo "<td>".clean($col_value)."</td>\n";
}
echo "</tr>\n";
}
echo "</table>\n";
/* Free resultset */
$result->free_result();
}