php - undefined index for database field -
the below code show warning undefined index database field name 'zatitle' spelling correct in both code , database. can not find out error please help.
include('connect.php'); dbconnect(); $myquery=mysql_query("select zaid,zatext, max(zatitle) announcements") or die(mysql_error()); if (mysql_num_rows($myquery) == '1') { $asession=mysql_fetch_array($myquery); $ses = $asession['zatitle']; if($ses=='1'){ $one='2013-2014'; }elseif($ses=='2'){ $one='2014-2015'; }elseif($ses=='3'){ $one='2015-2016'; }elseif($ses=='4'){ $one='2016-2017'; }
for code warning problem given below
notice: undefined index: zatitle in c:\xampp\htdocs\home\home.php on line 9
use alias
column max
.
$myquery=mysql_query("select zaid,zatext, max(zatitle) zatitle announcements") or die(mysql_error()); ^^^^^^^^^^
Comments
Post a Comment