On 17 Jun 2003 09:37:12 -0500, Tom Woody [EMAIL PROTECTED] wrote:
On Tue, 2003-06-17 at 09:09, nabil wrote:
A side question along with this ,,, how can I include $_POST['foo'] in
the
:
$sql =select * from db where apple = '$_POST['foo']' ;
without getting an error ??
should I append it as
On Tue, 2003-06-17 at 07:47, Chris Hayes wrote:
At 16:37 17-6-03, you wrote:
On Tue, 2003-06-17 at 09:09, nabil wrote:
A side question along with this ,,, how can I include
$_POST['foo'] in the
:
$sql =select * from db where apple = '$_POST['foo']' ;
without getting an error
print $_POST['foo']; // generates a warning
The above is only true in PHP 4.3.0-1 as there was a
bug that caused the E_NOTICE there. In all other PHP
versions, the above will cause a parse error.
Regards,
Philip
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
At 12:42 17-6-03, you wrote:
the first will generate a warning if warnings are enabled.
it could mean a constant or a string, if a constant with that name is not
available
php will use it as a string and show a warning.
the second is right as a string.
in addition to that.
In your example the
$sql = 'select * from db where apple = \'' . $_POST['foo'] . '\';';
Like that?
On Tue, 2003-06-17 at 10:09, nabil wrote:
A side question along with this ,,, how can I include $_POST['foo'] in the
:
$sql =select * from db where apple = '$_POST['foo']' ;
without getting an error ??
At 16:19 17-6-03, you wrote:
$sql = 'select * from db where apple = \'' . $_POST['foo'] . '\';';
Like that?
you missed some quotes:
$sql = 'select * from db where apple = \''' . $_POST['foo'] . '\'';
A side question along with this ,,, how can I include
$_POST['foo'] in the
:
$sql =select
On Tue, 2003-06-17 at 09:09, nabil wrote:
A side question along with this ,,, how can I include $_POST['foo'] in the
:
$sql =select * from db where apple = '$_POST['foo']' ;
without getting an error ??
should I append it as $var= $_POST['foo']; before???
The rule of thumb I follow with
At 16:37 17-6-03, you wrote:
On Tue, 2003-06-17 at 09:09, nabil wrote:
A side question along with this ,,, how can I include
$_POST['foo'] in the
:
$sql =select * from db where apple = '$_POST['foo']' ;
without getting an error ??
should I append it as $var= $_POST['foo']; before???
Actually I didn't.
The code that I gave would result in a string like:
select * from db where apple = 'blah';
For your reference:
\'' means print one single quote then end the current stream.
Then the . $_POST['foo'] appends the value of foo to the stream,
then . '\';'; prints one more single
At 16:19 17-6-03, you wrote:
$sql = 'select * from db where apple = \'' . $_POST['foo'] . '\';';
Like that?
you missed some quotes:
$sql = 'select * from db where apple = \''' . $_POST['foo'] . '\'';
Go back and count the quotes again. The original post is correct as far as
quotes go. Yours
Alternative, using concatenation:
$sql = SELECT * FROM db WHERE apple = '. $_POST['foo'] . ';
-Original Message-
From: CPT John W. Holmes [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 17, 2003 7:57 AM
To: [EMAIL PROTECTED]; Chris Hayes
Subject: Re: [PHP] Re: Difference between $_POST
This is explained in the manual with tons of examples:
http://www.php.net/types.string
http://www.php.net/types.array
http://www.php.net/types.array#language.types.array.foo-bar
Regards,
Philip
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
12 matches
Mail list logo