|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
Reference URL:
http://www.georgiaoffroad.com/mss/new/pms.php3 What I'd like to do is keep the HTML source code like it is, and add PHP statements where the 'data' cells are. I.E., there would be a variable inserted for each 'data' cell which would display information pulled from the database. The only known way I can do this is to set up a loop where a TR & TD would be ECHO'ed to the browser until there is no more data to show. That would kill the formatting, and I don't think I would have columns for each ACME Version (one version on top of another, as the loop would go). Doing this way I would have a very long html page that would be difficult to find information quickly and efficiently. Is there a way in which I could make a query to each table (where something == ACME version 7.43) and have the array of data stored in variables? The variables could then be echo'ed to the 'data' cells like: {TD} {?php echo $versionid ?} {/TD} precicely where I want them. Here's my delimma. Some HTML pages will have software makers with more than one Version of their product. Meaning that there will be more than one column of information (though it is the same info all the way across). The page I referenced, www.georgiaoffroad.com/mss/new/pms.php3 ... is set up with 5 versions of software. Most pages will have two or three. Will I be able to work this out with individual <?php echo $data ?> tags throughout? The more I think on it the more it sounds like this is going to be impossible when I have more than one 'version' per page. - Mike |
|
#2
|
|||
|
|||
|
Nothing is impossible with code. Yes, you can create an array of all the records with mysql_fetch_array, and then call the specific variables, instead of using a loop, but for all that work, you may as well just stick to manually updating your page, because every time your database changes, your formatting will be ruined.
So, you might use different SQL queries for each subcategory, and create an array from each query, which you loop into an individual HTML table, which you place inside the appropriate cell of the main table, thus maintaining the continuity of your loops. You could also query the database for the number of subcategories on that page, and build your main table with the appropriate number of cells. With a bit more work, you could create a two-dimensional array that would solve your problem WITHOUT needing tables inside cells. |
![]() |
| Viewing: Dev Shed Forums > Databases > MySQL Help > Alternate ways of displaying data |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|