Go Back   CodingForums.com > :: Server side development > MySQL

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Old 02-12-2005, 08:28 PM   PM User | #1
techgearfree
Regular Coder

 
Join Date: Jan 2005
Posts: 148
Thanks: 0
Thanked 0 Times in 0 Posts
techgearfree is an unknown quantity at this point
Easy quick question

Currently I have:

$query = "SELECT * FROM users WHERE ip = '$user_ip'";

how can I make is query where ip = '$user_ip'"; OR when something else is true.

So, whats the mysql/php command to have a query be able to have multiple conditions Example: I know you can do WHERE something != '$some' (where the column is not equal to the var.)

But, how do you do something like:

WHERE this is true OR where this is true. what is the command for or?
techgearfree is offline   Reply With Quote
Old 02-12-2005, 10:37 PM   PM User | #2
Brandoe85
teh Moderatorinator


 
Join Date: Sep 2004
Location: USA
Posts: 2,435
Thanks: 2
Thanked 38 Times in 38 Posts
Brandoe85 will become famous soon enough
Or(||) is the command. $query = "SELECT * FROM users WHERE ip = '$user_ip' OR something = 'something'";
__________________
-Brando
Why using tables for eating is stupid!
Brandoe85 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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 On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:23 AM.

Home - Contact Us - Archives - Link to CF - Resources - Top 

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.