|Join Nairaland / LOGIN! / Trending / Recent / New|
Stats: 2,775,640 members, 6,612,155 topics. Date: Wednesday, 01 December 2021 at 07:17 PM
|Help With This Php Problem by Aybee92(m): 3:47pm On Oct 23, 2018|
Good day guys, am a newbie and I need your help. Am currently learning php and Mysql.
I have a database table titles 'threads' with four columns (Id, subject, body, postdate).
This is what I wanted to accomplish, I want to display all the subject column as a link so that when someone click on it, it will take you to a page where it will display the "post subject and the body". similar to nairand.
Please guys how do I go about this?
Am trying to create a simple forum just for learning sake. Thanks
|Re: Help With This Php Problem by Doughboysss: 4:05pm On Oct 23, 2018|
can u post ur code
|Re: Help With This Php Problem by webapi: 7:01pm On Oct 23, 2018|
Aybee92:Loop through them
|Re: Help With This Php Problem by Ayemileto(m): 7:55pm On Oct 23, 2018|
Fetch subject from database using the normal way you use to fetch database result.
Loop through the result the Normal way you loop through your db result but in this case, you put your link in the HTML link tag.
To read contents, you can create a new page, say details.php and pass subject as a get variable.
Your links will look like
In your php loop, it might just be:
Echo "<a href="details.php?$row[" Subject"]>$row[" subject" ]</a>
In your details.php file, use get to get the subject, and using where clause in your query, get the db row with that subject.
|Re: Help With This Php Problem by Aybee92(m): 11:08am On Oct 25, 2018|
Ayemileto:waw thanks so much. this is really helpful.
|Re: Help With This Php Problem by Ayemileto(m): 3:03pm On Oct 25, 2018|
You are welcome bro.
|Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health |
religion celebs tv-movies music-radio literature webmasters programming techmarket
Nairaland - Copyright © 2005 - 2021 Oluwaseun Osewa. All rights reserved. See How To Advertise. 52