Jump to content


Photo

"select" statement


  • Please log in to reply
4 replies to this topic

#1 AdrianR

AdrianR
  • New Members
  • Pip
  • Newbie
  • 9 posts

Posted 10 March 2006 - 08:35 PM

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

#2 php_b34st

php_b34st
  • Members
  • PipPipPip
  • Advanced Member
  • 168 posts

Posted 10 March 2006 - 08:42 PM

Try:

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


#3 AdrianR

AdrianR
  • New Members
  • Pip
  • Newbie
  • 9 posts

Posted 10 March 2006 - 08:52 PM

hmm,,yes...it works.thanks a lot :)

#4 AdrianR

AdrianR
  • New Members
  • Pip
  • Newbie
  • 9 posts

Posted 10 March 2006 - 09:16 PM

:( oh no,it dosen`t work.i was misstaking.the script dosen`t return any information

#5 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 10 March 2006 - 09:36 PM

[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

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


or

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


Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users