0

I'm been trying to help an uncle of mine do some PHP and MYSQL Coding. His task is to take a P.O. Number, refer to a table that lists that P.O., and return to the browser specific columns of each row. I'm not sure if that made sense. Basically what we are building is a web app where a user can enter a purchase order number, and it'll run a script that will search a specific column in a table for that P.O. Now there are usually multiple rows that have the same P.O. so we need it to be able to send back all the different rows. Now to make it more fun we only need specific columns of those rows for data processing. We have an access database that does all this for us but we are looking at using MYSQL and PHP to see if it's easier. Any help would be appreciative, just a point in the right direction would help! Thanks guys!

  • The 1st question is what have you tried so far? You still have a lot to learn but you can start from [here](http://php.net/manual/en/tutorial.php). – Mark Jun 25 '13 at 02:07
  • To be honest I don't even know where to start. I've gotten as far as uploading the tables into the MYSQL database and setting up the html and form on the web page. That's it. I have a book called Headfirst MYSQL and PHP but they don't seem to reference searching specific columns all too well. – Jonathan Varela Jun 25 '13 at 02:12
  • Are you sir referring to data mining? – Mark Jun 25 '13 at 02:17
  • I'm sorry I thought it would be adv. Nevertheless, here's more reference regarding [Pattern matching in MySQL](http://dev.mysql.com/doc/refman/5.0/en/pattern-matching.html) and another for [Search for string within text column in MySQL](http://stackoverflow.com/questions/2526772/search-for-string-within-text-column-in-mysql) – Mark Jun 25 '13 at 02:26

1 Answers1

0

You can specify specific column names in your SELECT statement, is that what you're looking for?

SELECT column_name_1, column_name_2, etc... FROM table_name WHERE po_column_name = 'P.O. NUMBER HERE';
M Sost
  • 1,133
  • 7
  • 15
  • *Now there are usually multiple rows that have the same P.O. so we need it to be able to send back all the different rows* - from OP's question; so where is the distinct here? – Ohgodwhy Jun 25 '13 at 02:09
  • Yes! I'm sorry this must seem very basic. I'm very new to this. I have a background in C++ but I lack any reference material for MYSQL. DO you happen to have any suggestions as to where I could find some reference material that would help me understand that specific call? – Jonathan Varela Jun 25 '13 at 02:10
  • You can check the manual here http://dev.mysql.com/doc/refman/5.0/en/select.html as well as searching the web for something along the lines of "SELECT statements". @Ohgodwhy might be misunderstanding, but I thought the OP wants all rows matching the P.O. Number, so why would distinct be needed in that case? – M Sost Jun 25 '13 at 02:12
  • @MSost That's right. I'll need all the rows with that same P.O. Thank-you so much for your help. – Jonathan Varela Jun 25 '13 at 02:14