[PHP] can someone explain this query to me

2005-12-20 Thread Ross
$query = delete from meetings where id IN (.implode(,, $ids).);


Just the end bit, ids is an array of values (1,2,3,4,5) what does the IN 
do??

Ross 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] can someone explain this query to me

2005-12-20 Thread David Grant
Ross,

Ross wrote:
 $query = delete from meetings where id IN (.implode(,, $ids).);
 
 Just the end bit, ids is an array of values (1,2,3,4,5) what does the IN 
 do??

It's the equivalent of WHERE id = 1 OR id = 2 OR id = 3 OR id = 4 OR id = 5.

Cheers,

David
-- 
David Grant
http://www.grant.org.uk/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] can someone explain this query to me

2005-12-20 Thread Dan Parry
WHERE id IN (1,2,3)

Is the same as saying WHERE id = 1 OR id = 2 OR id = 3

Few more details in this link

http://www.w3schools.com/sql/sql_in.asp

HTH

Dan

-Original Message-
From: Ross [mailto:[EMAIL PROTECTED] 
Sent: 20 December 2005 12:07
To: php-general@lists.php.net
Subject: [PHP] can someone explain this query to me

$query = delete from meetings where id IN (.implode(,, $ids).);


Just the end bit, ids is an array of values (1,2,3,4,5) what does the IN 
do??

Ross 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

__ NOD32 1.1328 (20051219) Information __

This message was checked by NOD32 antivirus system.
http://www.eset.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php