I am trying to run this query:
$query="SELECT max(templateid) FROM vtiger_emakertemplates";
$sql_result = mysql_query($query);
the error it shows is:
Warning : mysql_fetch_array() expects parameter 1 to be resource, boolean given
It was supposed to give me an integer value but it is returning a boolean value.
The column templateid contains only integer values. I can't understand where the boolean value is coming from. Any ideas?
Here is the full code
$conncity=mysql_connect($dbconfig['db_hostname'],$dbconfig['db_username'],$dbconfig['db_password']);
mysql_select_db($dbconfig['db_name'],$conncity);
$query="SELECT max(templateid) FROM vtiger_emakertemplates";
$sql_result = mysql_query($query);
$id=mysql_fetch_array($sql_result);