Jump to content

Recommended Posts

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.
Link to comment
https://forums.phpfreaks.com/topic/31236-simple-php-sql-query/
Share on other sites

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 column

All 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 YOU
CHris
Link to comment
https://forums.phpfreaks.com/topic/31236-simple-php-sql-query/#findComment-144479
Share on other sites

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. 

Link to comment
https://forums.phpfreaks.com/topic/31236-simple-php-sql-query/#findComment-144504
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.