Vaupell
01-04-2010, 09:39 PM
Is it nessesary to assign a function to simply read some data from db..
Want a plugin to read
Tablename
colum1 |colum2|colum3
------------------------------
data1 | data2 | data 3
and so on.. well you know a table..
But using a query as i would when writing a .php file for vbulletin dont work so well
with plugins.. :(
normal :
$linkstat=$db->query_first("SELECT * FROM " . TABLE_PREFIX . "Tablename WHERE Colum1='1'");
$data1 = htmlspecialchars_uni($linkstat['data1']);
$data2 = htmlspecialchars_uni($linkstat['data2']);
$data3 = htmlspecialchars_uni($linkstat['data3']);
$templater = vB_Template::create('some_template');
$templater->register('data1', $data1);
$templater->register('data2', $data2);
$templater->register('data3', $data3);
print_output($templater->render());
Howewer that just gives some
Fatal error: Call to a member function query_first() on a non-object in C:\xampp\xampp\htdocs\emod\includes\class_bootstra p.php(392) : eval()'d code on line 63
Which i just suppect is becourse the query_first should be something else .
but what. tryed looking at other plugins both from vb and from others
just cant figure them out..
help please.
Want a plugin to read
Tablename
colum1 |colum2|colum3
------------------------------
data1 | data2 | data 3
and so on.. well you know a table..
But using a query as i would when writing a .php file for vbulletin dont work so well
with plugins.. :(
normal :
$linkstat=$db->query_first("SELECT * FROM " . TABLE_PREFIX . "Tablename WHERE Colum1='1'");
$data1 = htmlspecialchars_uni($linkstat['data1']);
$data2 = htmlspecialchars_uni($linkstat['data2']);
$data3 = htmlspecialchars_uni($linkstat['data3']);
$templater = vB_Template::create('some_template');
$templater->register('data1', $data1);
$templater->register('data2', $data2);
$templater->register('data3', $data3);
print_output($templater->render());
Howewer that just gives some
Fatal error: Call to a member function query_first() on a non-object in C:\xampp\xampp\htdocs\emod\includes\class_bootstra p.php(392) : eval()'d code on line 63
Which i just suppect is becourse the query_first should be something else .
but what. tryed looking at other plugins both from vb and from others
just cant figure them out..
help please.