MySQL Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesMySQL Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
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  
Old August 3rd, 2000, 11:21 AM
mstembri mstembri is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2000
Location: Norcross, GA
Posts: 458 mstembri User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
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



Reply With Quote
  #2  
Old August 5th, 2000, 02:07 AM
rycamor rycamor is offline
Gödelian monster
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jul 1999
Location: Pembroke Pines, Florida, USA
Posts: 2,300 rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level)rycamor User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 3 Days 3 h 2 m 4 sec
Reputation Power: 43
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.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMySQL Help > Alternate ways of displaying data


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway