Welcome to WebmasterWorld Guest from 107.20.110.201

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

mysql and php to show data using ?=

     

xensor

12:46 pm on Dec 19, 2013 (gmt 0)



i am looking or wondering how to go about making a php script where i can show the records from mysql to the site using php and when i click on its link it loads up ex: family.php?id=1 and it will bring up the member of that id up with the info in the database.

i can't seem to figure it out or what to search for.

i have searched it would be thankful if someone could help me out with this.

btw if your wondering what i am talking about this is what i am talking about:

phpbb or smf has it same as wordpress. if you click on a thread it shows showforum.php?action=forum or viewtopic.php?action=forum or something like that. i know its mysql and php and it loads a record into the site by connection to the database. i got that part but how to get it to show up in pages wise.

coopster

5:17 pm on Feb 7, 2014 (gmt 0)

WebmasterWorld Administrator coopster is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Welcome to WebmasterWorld, xensor.

The next step after database connection and executing the query would be to process the result set. Have a look at the examples on this PHP manual page:

[php.net...]

This quickstart guide should get you pointed in the right direction.

xensor

6:20 pm on Feb 7, 2014 (gmt 0)



ok but still doesn't explain how to use get id and show it on a different page when you put a read more link

coopster

6:50 pm on Feb 11, 2014 (gmt 0)

WebmasterWorld Administrator coopster is a WebmasterWorld Top Contributor of All Time 10+ Year Member



You process the variable from the $_GET superglobal.

[php.net...]

Scrub the user-supplied data to be sure it is what you expect, in this case I assume an integer value. Then you can use that value in your query.
 

Featured Threads

Hot Threads This Week

Hot Threads This Month