|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
twopeak Smarty Rookie
Joined: 09 Jun 2003 Posts: 12
|
Posted: Wed Jul 02, 2003 2:55 am Post subject: sections |
|
|
Hello...
I made ascript that allowed me to have full control over 3 tables of a mysqldatabasase.
Now I would like to change this script so it fits in my smarty-driven website...
The problem is this:
I do not know how many fields there will be,
I do not know the name of the fields (when making the temlate file).
When I execute the script, with mysql_get_fields I get the names of the fields, but I need the names of the fields in the template, when I create it, to make a section.
so I have something like an adresbook (name, adres, phone, ...) and an appointments calendar (event, date, time, place, ...) and a table with news (message, writer, date, ...)
I want to output a table with all the field names and then all the records of that table, in 1 template part (not wrking with if $table== contactsheet elseif $table == "appointments" and so on)
thanks for any ideas! |
|
Back to top |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Wed Jul 02, 2003 5:24 pm Post subject: |
|
|
A novel (though rather unorthodox) approach is to write a custom resource that dynamically generates the template based on the data returned back from your recordsets. |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|