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

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:…

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

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.
turnermm (Moderator) #3
Member since Oct 2009 · 4755 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:

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>";

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
plugins, templates:
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
This board is powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2015 by Yves Goergen
Current time: 2020-01-19, 08:57:37 (UTC +01:00)