Jump to content

Archived

This topic is now archived and is closed to further replies.

AdrianR

"select" statement

Recommended Posts

hi guys.I have a little trouble with the select statement.
I mean I have a table named 1 and in the table I have 5 fields named "a""b""c""d""e".
How can I select the content of the field "a" but only if the content of field b is "test" and the content of field c is "more test"?
:( can`t find the answer..
SELECT a from dbname where b like 'test' and c like 'more test'
dosen`t seem to work

Share this post


Link to post
Share on other sites
Try:

[code]$sql = mysql_query("SELECT a
            FROM 1
            WHERE b='test' AND c='more test'");[/code]

Share this post


Link to post
Share on other sites
:( oh no,it dosen`t work.i was misstaking.the script dosen`t return any information

Share this post


Link to post
Share on other sites
[quote name='adrianR' date='Mar 10 2006, 09:16 PM' post='353726']
:( oh no,it dosen`t work.i was misstaking.the script dosen`t return any information
[/quote]


Try this
good luck

[code]
$sql = mysql_query("SELECT a
            FROM 1
            WHERE b='test' || c='more test'");

[/code]

or

[/quote]
[code]
$sql = mysql_query("SELECT a
            FROM 1
            WHERE b='test' && c='more test'");

[/code]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.