Quote:
Originally Posted by smirkley
I love the way this mod works, and am building a functionality for my forum with it.
I have played with many variations of what I can do, but I found myself stuck in using my example.php page file to fill a variable array from a list in a custom database, and then get it to printout the list of database contents on the template form.
I will admit I havent read every page here (still workin on that lol), but I so far have not been able to figure this one out.
If anyone has sucessfully done something like this with this mod, throw me a clue of what I am not able to figure out. Thanks big time.
|
Ok, I am available now to address my intended integration of this tutorial into a custom product. (every time I tell my wife I want to do some coding, she always says "fine", but I always end up repainting a bedroom or remodeling a bathroom instead. I havent figured out how that works yet. lol)
This is what I have so far....
1 - I created a product xml that creates a database and supporting template very similar to the one posted by Lynne. The template has several if ($_REQUEST['do'] =='s installed for different page renderings depending on function desired. IE: home,list,add,edit,delete of database entries. So far, works perfectly.
Now I am working on the list part of the database. I have entered several rows of test data into the database manually through phpmyadmin. As I ventured into using if ($_REQUEST['do'] == 'history') in the php file I know that I have to build an array to send to the template (sorted by date).
Database structure: date field, data1, data2, data3, data4, data5, data6
I tried to build a loop to fill a variable array and it seemed that it was working, but I couldnt figure out how to list that array in the template. I am unsure if I have to register the variable, it is only used on this feature I am making.
When I tried to output the array in the template, it would print out one row of data (correctly), not the whole database, and it would be on the very top of my page above the header.
I am going to have to reconstruct it again to get to that point, I seemed to have trashed the experimental code in frustration of not getting it to work, and having to start the bedroom remodel.