Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP Tables

Status
Not open for further replies.

d3sol4t3

Programmer
Oct 27, 2005
40
GB
Hi all

I need help outputting data to a table which is located on my main page (/index.html).

I log into the admin area and am presented with news posting options, these options are as follows:

1) The news headline e.g. "New Microsoft Flaw"
2) The news category e.g Vulnerabilities
3) The content of the news e.g. "It was discovered this weekend that a new microsoft flaw exists blah blah blah".

When i press the button "post" it posts the information in the table corresponding to the correct category.

E.g If there are 3 categories, each category has its own table.

The microsoft example i gave above would be posted in the Vulnerability table.

As well as outputting the news into a table on the main page it will also have to be stored in a MySQL database for archiving and searching.

If you are looking for examples, goto addict3d.org

There are five tables running down the middle: Downloads, Tech news, Security, Entertainment and Stupid Videos.

I have tried on other PHP development forums, and they told me to come and try here. They said it's an easy job for someone who has time....

If you are willing to help and have msn messenger please leave your email address so i can contact you ASAP.

Alternatively just reply here.

Thanks

Tom
 
What part are you actually looking for help on?
It sounds as if you already have an admin area that is presenting you with headlines that you select to be sent to be used in your main page. If that's so then you have some sort of content management system giving you options and hitting the submit button should be sending it somewhere already but we have no idea what it is you are using, how it operates or how your index.html file receives the data that goes into it.

Or are you looking to do ALL of what you stated above creating the admin page that lets you select headlines and send them to the index page? That is a lot more complex even disregarding the idea of where the news feed is coming from.

Outputting the tables on your index.html page is simple. If you always have the same number of tables/categories then you just use static HTML and insert the content through a variable in the appropriate place assuming the data has already been passed into the page and assigned to the appropriate variable.

If the number of headlines/categories is not always the same then you need to determine the number that you need to generate and setup a loop to spit out the HTML in the proper location of the page.

There are too many unknowns about what you are attempting and what you already have to be much more specific though.



Stamp out, eliminate and abolish redundancy!
 
Heh i guess i did make my request a little complex.

Ok basically i need code example to output data to a table on any page (for arguement sakes i'll call the page index.php).

So you hit a button and it adds text to a table on /index.php.

Thats all
 
Well this is just a question of outputting the correct html tags ([blue]<table> <tr><td>data</td></tr><table>[/blue])along with the data you are getting from the DB.

Since we do not know what your tables look like in the DB what brand of DB it is(MSQL,MYSLQ etc..), how many columns they have what you want to output etc...

There is not much more we can say.



----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top