#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    Norcross, GA
    Posts
    458
    Rep Power
    14
    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. #2
  3. No Profile Picture
    Gödelian monster
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jul 1999
    Location
    Central Florida, USA
    Posts
    2,307
    Rep Power
    62
    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.

Similar Threads

  1. displaying mysql data in excel sheet
    By softsolvers in forum PHP Development
    Replies: 0
    Last Post: February 17th, 2004, 05:39 AM
  2. displaying data using select
    By tabashishi in forum PHP Development
    Replies: 2
    Last Post: February 9th, 2004, 03:05 PM
  3. inserting data after displaying it
    By jackass in forum PHP Development
    Replies: 3
    Last Post: January 28th, 2004, 12:44 AM
  4. displaying the binary picture data from mysql
    By iso in forum PHP Development
    Replies: 0
    Last Post: January 9th, 2004, 08:43 PM
  5. my comp sux lately , need help from pro's
    By Hykinsel007 in forum Windows Help
    Replies: 2
    Last Post: January 5th, 2004, 01:52 PM

IMN logo majestic logo threadwatch logo seochat tools logo