I want to create this page with a certain number of table columns based on a MAX value from query.
The query is as follows
$sql_query_catcount = "SELECT MAX(catColumn) AS maxColumn FROM tblcategories";
@mysql_connect($db_host, $db_username, $db_password) or die("Couldn't connect to MySQL server!");
@mysql_select_db($db_name) or die("Couldn't open database");
$result = mysql_query($sql_query_catcount) or die("category query failed");
the beginning of the FOR loop is as follows
for ($column = 1; $column <= $maxColumn ; $column++) {
I want that $maxColumn value to be the value of the $sql_query_catcount, which is an integer. When I try to do it, I debug with an echo of the value $result and get this string.
Anyone know how to fix this? Thanks.