php - SELECT query fails silently, no output produced -
first of need tell i'm newbie on php/mysql...
i'm trying write simple plugins using php. here php function code :
function example() { global $db; $examplesql = $db['db_database']->query("select tid, added table group tid order added desc limit 5"); while ($row = $db['db_database']->fetch_assoc($examplesql)) { $time = date('y-m-d h:i:s',$row['added']); $torid = $row['tid']; } eval("\$exampletemplate = \"" . $db['db_template']->loadtemplate('exampletemplate') . "\";"); return $example; }
so when create template named exampletemplate
, insert template this;
<table width="200" border="1"> <tr> <td>$time</td> <td>$torid;</td> </tr> </table>
it must show list of last 5 tid
sorted added
white page. no database error, nothing. white page.
can tell me doing wrong?
a white page means have error_reporting turned off. php wants tell error won't let it. put following line of code @ top of file, or in config file, enable error reporting:
error_reporting(e_all);
also make sure display_errors on in php.ini file.
Comments
Post a Comment