Affiliate Marketing
Forum Search

Reply
 
LinkBack Thread Tools Display Modes

  #1 (permalink)  
Old 09-11-04
morleymouse's Avatar
Super Member
 
Join Date: Aug 2003
Location: Costa Del Sheffield
Posts: 2,752
Thanks: 3
Thanked 10 Times in 6 Posts
morleymouse is an unknown quantity at this point
  php/mysql quickie

how do I get rows the match 2 criteria?

something like

$result = mysql_query("SELECT * FROM table WHERE username='$username' AND? otherthing='$othervar'")

?

been trying AND etc but cant guess the right answer
__________________
Dan Morley
Alpharooms.com
daniel at alpharooms dot com - Hotels, Flights, Airport Transfers, Care Hire + More! sign up
My Blog | Cheap Holidays
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 09-11-04
Super Moderator
 
Join Date: Aug 2003
Posts: 2,451
Thanks: 0
Thanked 0 Times in 0 Posts
Rich is an unknown quantity at this point
Just AND is right thing to use. Try: -
PHP Code:
$result mysql_query("SELECT * FROM table WHERE username='$username' AND otherthing='$othervar'")  or die(mysql_error()); 
That will at least output an error if part of the query is generating an error.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 09-11-04
Kandevil's Avatar
Ian Ebbs
 
Join Date: Aug 2003
Location: England
Posts: 1,070
Thanks: 0
Thanked 0 Times in 0 Posts
Kandevil is an unknown quantity at this point
Dan as far as I can see, there is nothing wrong with your mysql there.

$result = 'select * from table where username = "$username" AND otherthing = "$othervar"';

works for me.

is something else up?

Edit: Rich beat me to it
__________________

affiliates4u Fantasy Football Winner 2007/08
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 09-11-04
morleymouse's Avatar
Super Member
 
Join Date: Aug 2003
Location: Costa Del Sheffield
Posts: 2,752
Thanks: 3
Thanked 10 Times in 6 Posts
morleymouse is an unknown quantity at this point
ah got it, my stupid mistake somewhere else.

cheers
__________________
Dan Morley
Alpharooms.com
daniel at alpharooms dot com - Hotels, Flights, Airport Transfers, Care Hire + More! sign up
My Blog | Cheap Holidays
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Affiliate Marketing RSS Feeds - Contact Us - Affiliate Marketing - Archive - Privacy Statement - Top

Content Relevant URLs by vBSEO 3.2.0 RC7