Re: [PHP-DB] php4 to php5

2008-04-03 Thread Greg Bowser
Sounds like you're talking about the register_globals functionality. It's a
php.ini setting that will cause $_POST['foo'] or $_GET['foo'] to be copied
to the global variable $foo. This is somewhat of a security risk, thus
disabled by default.

There's another superglobal array that you might find useful: $_REQUEST.
$_REQUEST consists of variables from $_GET,$_POST,$_COOKIE (in that order, I
believe).

http://us3.php.net/manual/en/reserved.variables.php

http://us3.php.net/manual/en/ini.core.php#ini.register-globals

--GREG

(note:I also posted this to the php-general list as it isn't a db-related
topic.)


Re: [PHP-DB] SELECT query with multiple WHERE Clause

2008-02-27 Thread Greg Bowser
In MySQL, both OR and || are valid logical or operators.  You can only
have one Where clause, thus your last example is correct.

--GREG

On Wed, Feb 27, 2008 at 6:44 PM, Nasreen Laghari [EMAIL PROTECTED]
wrote:

 Hi All,

 Thank you for increasing my knowledge about PHP/MYSQL.

 I am creating a SEARCH, by only using one table. The search form  is same
 as Inserting item (search has form of all fields in table ), difference is
 SEARCH page doesnt have validation . Therefore user can enter information in
 any of field. I would like to know how to write a SELECT query which has
 multiple where clause with OR operator.

 shall we write:

 $query = mysql_query(SELECT * from gig WHERE Name='$name' || WHERE
 gig_fdate='$sdate');

 OR

 $query = mysql_query(SELECT * from gig WHERE gigName='$gig_name' OR WHERE
 gig_fdate='$sdate');

 OR

 $query = mysql_query(SELECT * from gig WHERE gigName='$gig_name' ||
  gig_fdate='$sdate');


 Regards

 Nasreen



  
 
 Looking for last minute shopping deals?
 Find them fast with Yahoo! Search.
 http://tools.search.yahoo.com/newsearch/category.php?category=shopping