Hi, Looking for a template loop function for php. I don't want a complete template engine, just a function to do loops. The loop data will be from a MySQL table, and put in to an html table. So, if anyone has a function I could have, or a tutorial on writing my own, or other resources you could point me to, I would appreciate it. Thanks, Michael
try using Loop by this http://www.jooria.com/Tutorials/Web...plating-Your-Site-with-RainTPL-141/index.html
As in you just want the php for the mysql looping and output? can you provide the code you have so far for the mysql just so that we know where you are up to
I already have the loopping for the mysql with php, I was trying to figure out how to get the looped data into an html page without putting in a lot of php code. I did figure out some code to do this. Thanks, Michael
The following works, but this could be inefficient, could save template in variable and str_replace markers: ob_start(); foreach($aResults as $aResult) { require('templates/display_results.html'); } $htmlResults = ob_get_clean(); PHP: