开发者

PHP read specific row [closed]

开发者 https://www.devze.com 2023-04-05 19:16 出处:网络
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.

Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.

Closed 9 years ago.

Improve this question

I have a PHP script that display开发者_如何学运维s data read from a MySQL database. I want to filter the output to only show rows where two columns contain specific values. How do I do this?


Add a WHERE clause, e.g., WHERE column1 = 'specific-value1' AND column2 = 'specific-value2'

Here's a link to MySQL's SELECT syntax:

http://dev.mysql.com/doc/refman/5.1/en/select.html

(and in German):

http://dev.mysql.com/doc/refman/5.1/de/select.html


no idea why you are posting in german on an english site and then translating it to english. But what you need to do is something like "select * from table where column1='val' and column2='val'". Though it sounds like you have a large set of data pulled off already and you want to filter that. I don't see why you shouldn't just query what you need from the database instead of pulling everything off and then filtering.

0

精彩评论

暂无评论...
验证码 换一张
取 消