Not logged in. · Lost password · Register
Forum: General Help and Support Syntax and Usage RSS
Create tables using PHP/XHTML renderer
Avatar
azulay #1
Member since Feb 2013 · 1 post
Group memberships: Members
Show profile · Link to this post
Subject: Create tables using PHP/XHTML renderer
Hi,

I am trying to access a mysql database to get some information using php code. I am able to get the information that I need, but I have no idea how to put it into a table format.

I am using this renderer:
https://github.com/splitbrain/dokuwiki/blob/master/inc/par…

But I'm not sure how to use the table functions. Can anybody help explaining how it works?

Or suggest another way to create tables with php code inside Dokuwiki

Thanks!
Avatar
tom_c #2
Member since Jan 2011 · 33 posts · Location: Hackettstown, NJ, US
Group memberships: Members
Show profile · Link to this post
Take a look at the plugins that can create a table from mysql queries either plugin:sql or plugin:sqlcomp. Maybe they do what you need.
Avatar
turnermm (Moderator) #3
Member since Oct 2009 · 4696 posts · Location: Canada
Group memberships: Global Moderators, Members, Super Mods
Show profile · Link to this post
You should be able to create tables directly using php:

<php>
echo "<table>\n";
for ( $counter = 1; $counter <= 3; $counter += 1) {
 echo "<tr><td>data $counter</td><td>data_2 $counter</td></tr>\n";     
  
}
echo "</table>";
</php>

You must be collecting the sql data in rows, so parse it as needed and feed it into the table.  Or am I missing something?
Myron Turner
github: https://github.com/turnermm
plugins, templates: http://www.mturner.org/devel
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
Imprint
This board is powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2015 by Yves Goergen
Current time: 2019-09-16, 22:51:12 (UTC +02:00)