<?php
$db = mysql_connect("localhost", "root","")
or die("Could not connect: " . mysql_error());
mysql_select_db("corp2",$db);
$currConnEncode = mysql_client_encoding($db);
echo $currConnEncode;
$q = "SET NAMES 'utf8' ";
$result = mysql_query($q,$db);
$q="SELECT * FROM mos_categories limit 50";
//$q = "show tables";
$result = mysql_query($q,$db)
or die("Could not query: ". mysql_error());
$numrows=mysql_num_rows($result);
if ($myrow = mysql_fetch_array($result)) {
echo("<table border=1>\n");
while ($myrow = mysql_fetch_array($result))
{
printf("<tr><td>%s</td><td>%s</td><td>%s</td></tr>\n", $myrow[0], $myrow[1], $myrow[2]);
}
echo "</table>\n";
}
else{
echo("sorry no record was found");
}
echo ("the affected rows was $numrows");
?>