Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2005-11-07 20:20:35

simonaut
Member
Registered: 2005-06-28
Posts: 16
Website

new plugin [list in mysql]

I’m trying to create a MySQL query in my plugin to select all the Teachers in the table and output it to a list here is the code I can never get it to work!

$result = safe_query(“SELECT * FROM teachers” ,$debug);

$rs = mysql_fetch_array($result);

$Out = “”;
$Out .= $rs[LastName];
$Out .= “<br />\n”;

return($Out);


Chat with me here!
AIM: s1monaut
http://www.simonaut.com/

Offline

#2 2005-11-07 21:24:11

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Re: new plugin [list in mysql]

Don’t call the mysql_* functions directly. Use safe_rows() or safe_rows_start()/nextRow(). Look for examples in taghandlers.php.


Alex

Offline

Board footer

Powered by FluxBB