billisnice Posted June 14, 2015 Share Posted June 14, 2015 (edited) I want to type in the ID and auto populate other cells like address, zip, ect from one of mysql tables. Edited June 14, 2015 by billisnice Quote Link to comment https://forums.phpfreaks.com/topic/296809-php-code-to-pull-data-our-of-mysql/ Share on other sites More sharing options...
mac_gyver Posted June 14, 2015 Share Posted June 14, 2015 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. Quote Link to comment https://forums.phpfreaks.com/topic/296809-php-code-to-pull-data-our-of-mysql/#findComment-1513859 Share on other sites More sharing options...
billisnice Posted June 14, 2015 Author Share Posted June 14, 2015 (edited) I do not write code. I have a co worker that says it is impossible. I think they do not know how to program. In excel I use index match to pull info from another sheet or workbook. Edited June 14, 2015 by billisnice Quote Link to comment https://forums.phpfreaks.com/topic/296809-php-code-to-pull-data-our-of-mysql/#findComment-1513861 Share on other sites More sharing options...
maxxd Posted June 15, 2015 Share Posted June 15, 2015 Gathering data from a MySQL database is anything but impossible with PHP. Quote Link to comment https://forums.phpfreaks.com/topic/296809-php-code-to-pull-data-our-of-mysql/#findComment-1513890 Share on other sites More sharing options...
Muddy_Funster Posted June 15, 2015 Share Posted June 15, 2015 Gathering data from a MySQL database is anything but impossible with PHP. It's pretty much the every day use of PHP these days. also, here's a fiddle that emulates the behavior you are describing using a mock data set to prove your co worker is a muppet https://jsfiddle.net/7b4u37k7/1/ Quote Link to comment https://forums.phpfreaks.com/topic/296809-php-code-to-pull-data-our-of-mysql/#findComment-1513905 Share on other sites More sharing options...
QuickOldCar Posted June 15, 2015 Share Posted June 15, 2015 It's pretty much the every day use of PHP these days. also, here's a fiddle that emulates the behavior you are describing using a mock data set to prove your co worker is a muppet https://jsfiddle.net/7b4u37k7/1/ Could have done a phpfiddle version. Quote Link to comment https://forums.phpfreaks.com/topic/296809-php-code-to-pull-data-our-of-mysql/#findComment-1513909 Share on other sites More sharing options...
Muddy_Funster Posted June 15, 2015 Share Posted June 15, 2015 Could have done a phpfiddle version. I have only been there once to try and publish some code for someone and spent ages trying to get the link to work, then gave up with it. So I'm not personally a fan of it for sharing, but it is very good for throwing up a prototype in a hurry. Quote Link to comment https://forums.phpfreaks.com/topic/296809-php-code-to-pull-data-our-of-mysql/#findComment-1513926 Share on other sites More sharing options...
QuickOldCar Posted June 15, 2015 Share Posted June 15, 2015 I agree, it seems easier to write own code than use it there. Quote Link to comment https://forums.phpfreaks.com/topic/296809-php-code-to-pull-data-our-of-mysql/#findComment-1513931 Share on other sites More sharing options...
mac_gyver Posted June 16, 2015 Share Posted June 16, 2015 sounds like the OP just wants someone to do his or his group's assignment for him/them. Quote Link to comment https://forums.phpfreaks.com/topic/296809-php-code-to-pull-data-our-of-mysql/#findComment-1514023 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.