简体   繁体   English

使用PHP和MYSQL对已知列进行搜索

[英]Using PHP and MYSQL to do a search with a known Column

I'm been trying to help an uncle of mine do some PHP and MYSQL Coding. 我一直在尝试帮助我的叔叔进行一些PHP和MYSQL编码。 His task is to take a PO Number, refer to a table that lists that PO, and return to the browser specific columns of each row. 他的任务是获取一个PO编号,引用列出该PO的表格,然后返回到浏览器每一行的特定列。 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 PO Now there are usually multiple rows that have the same PO so we need it to be able to send back all the different rows. 基本上,我们正在构建的是一个Web应用程序,用户可以在其中输入采购订单号,它将运行一个脚本,该脚本将在表中的特定列中搜索该PO现在通常有多个具有相同PO的行,因此我们需要它能够发送回所有不同的行。 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. 我们有一个访问数据库可以为我们完成所有这些工作,但是我们正在考虑使用MYSQL和PHP来查看它是否更容易。 Any help would be appreciative, just a point in the right direction would help! 任何帮助都将是有意义的,只是朝着正确方向迈出的一步会有所帮助! Thanks guys! 多谢你们!

您可以在SELECT语句中指定特定的列名称,这就是您要查找的内容吗?

SELECT column_name_1, column_name_2, etc... FROM table_name WHERE po_column_name = 'P.O. NUMBER HERE';

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM