Note Notice where SQL queries exist: the Useofundefinedconstantmytime-assumedmytimeinvarwwwhtmlcalsncalresult.phponline15 appears this is the last line (15 rows) $ query & quot; select * fromempoloyeewhe where SQL queries have a note
Notice: Use of undefined constant mytime-assumed 'mytime' in/var/www/html/calsn/calresult. php on line 15
This is the last line (15 rows)
$ Query = "select * from empoloyee where empid = '$ empid '";
$ Result = mysql_query ($ query) or die (mysql_error ());
$ Num = mysql_num_rows ($ result );
If ($ num> 0)
{
$ Row = mysql_fetch_array ($ result );
$ Mytime = $ row [mytime];
------ Solution --------------------
$ Row [mytime]
No quotation marks?
------ Solution --------------------
Yes. The key name must be enclosed in quotation marks.
------ Solution --------------------
Use of undefined constant mytime
A non-defined constant is used. if mytime in $ row [mytime] is not enclosed in quotation marks, php will be treated as a constant by default. if the constant cannot be found, it will be treated as a string, however, at the same time, a Notice prompt will still be thrown. although the effect is not big, the logic is indeed a little different. The performance is slightly affected by the way of thinking (although the performance does not matter)
------ Solution --------------------
$ Mytime = $ row ['mytime'];