cjbeck71081 Posted December 19, 2006 Share Posted December 19, 2006 I have a database set up on a webserver with 3 columns labled propname, beforepic & afterpic respectively. What i would like to do, is have an HTML table set up with 3 columns, in the first column i would like the HTML to query the table and insert the "propname", the 2nd column would be an image that takes its src="xxxx" information from the "beforepic" in the database and the same for the afterpic. Quote Link to comment https://forums.phpfreaks.com/topic/31236-simple-php-sql-query/ Share on other sites More sharing options...
cjbeck71081 Posted December 19, 2006 Author Share Posted December 19, 2006 I have a database set up on a webserver with 3 columns labled propname, beforepic & afterpic respectively. What i would like to do, is have an HTML table set up with 3 columns, -in the first column i would like the HTML to query the table and insert the "propname", -the 2nd column would be an image that takes its src="xxxx" information from the "beforepic" in the database -and the same for the "afterpic" and the third columnAll of this i know how to do if i were to set up a 3 column, 5 row table in HTML and then pull down 5 rows of information from the Database, what i dont know how to do is set the HTML table up so its prepared to take any number of Database entries.So for example if week 1 i have 6 houses the HTML table Queries the DB and brings down information about the 6 hours... but in week 15 i have 20 houses, the HTML table queries the DB and brings down information for 20 houses.I hope this is clear, appologize about the double post, i hit enter by accident.Thank YOUCHris Quote Link to comment https://forums.phpfreaks.com/topic/31236-simple-php-sql-query/#findComment-144479 Share on other sites More sharing options...
tracy Posted December 19, 2006 Share Posted December 19, 2006 You can achieve this using php. The table has a certain number of rows. The first step is to have php 'count' the number of rows and continue returning for the next line until it has reached the end. Displaying the results of a table using php is typically a two step process: 1. get number of rows 2. display next row until last row is reached. Quote Link to comment https://forums.phpfreaks.com/topic/31236-simple-php-sql-query/#findComment-144504 Share on other sites More sharing options...
HuggieBear Posted December 19, 2006 Share Posted December 19, 2006 Or better still, use a foreach loop and save yourself some trouble.RegardsHuggie Quote Link to comment https://forums.phpfreaks.com/topic/31236-simple-php-sql-query/#findComment-144511 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.