Jump to content

PHP code to pull data our of mysql


billisnice

Recommended Posts

where exactly are you stuck at when you tried to do this? programming help forums are not here to find, give, or write code for you. without knowing what sort of problem you had when you tried this, the answer could range from a) you need to buy a good php/mysql book and/or take a programming class to z) you have a logic or syntax problem in your code that we could help with if you posted your code and told us what sort of error or symptom you got from that code.

 

the thing you stated you want, will require that you lean enough html, php, and mysql to do the following steps -

 

1) create a form or link(s) that let the user pick which item he wants, that submits the corresponding id value as a get request to the display page.

 

2) on the display page, detect and validate the id value that was passed in the get request.

 

3) create a database connection, checking for connection errors.

 

4) form and run the sql query statement to retrieve the correct row using the submitted id value, protecting against sql injection in the id value and checking for query errors.

 

5) check if the query matched a row and if so, fetch the row. if not, display a message to the user.

 

6) if a row was found, display the data from the fetched row the way you want it to be displayed.

Link to comment
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.