Reputation: 21396
I have a mysql table as below:
--------------------
| Sl | col1 | col2 |
--------------------
| 1 | data1| msg1 |
--------------------
| 2 | data2| msg2 |
--------------------
| 3 | data1| msg3 |
--------------------
| 4 | data2| msg4 |
--------------------
| 5 | data1| msg5 |
--------------------
I have a php string $query = "select * from table WHERE col1='data1'";
, which fetch array 3 results (row number 1, 3, and 5). But i want to get a specific row containing "data1"
in "col1"
and "msg3"
in "col2"
(which is row number 3) in a single query. How can I make this possible?
Upvotes: 1
Views: 3226