nd, Martin" <[EMAIL PROTECTED]>
12/03/2004 02:40 PM
Please respond to
<[EMAIL PROTECTED]>
To
<[EMAIL PROTECTED]>
cc
Subject
RE: [PHP-DB] Concat 3 fields in a query
http://www.php.net/manual/
http://www.php.net/manual/en/language.types.string.php
Basically:
the concat_ws command is mysql specific...it only works in a sql statement.
if you want to do this in code then
PO_Date= $_POST['PO_Year'].'-'.$_POST['PO_Month'].'-'.$_POST['PO_Day'])';
will work
bastien
From: [EMAIL PROTECTED]
To: <[EM
http://www.php.net/manual/
http://www.php.net/manual/en/language.types.string.php
Basically:
* quoting with ' is when you just literally want that string
output.
You can't call functions or print variables values within it.
e.g.print 'hello_world() $name';
of them. Any good sites out there to
explain when to use ' and when to use " sorry kind of a newbie but
appreicate all of the help maybe one day I can return the favor.
Khris
"Norland, Martin" <[EMAIL PROTECTED]>
12/03/2004 12:03 PM
Please respond to
<[
-Original Message-
From: Bastien Koert [mailto:[EMAIL PROTECTED]
>
concat_ws('-',{$_POST['PO_Year']},{$_POST['PO_Month']},{$_POST['PO_Day']
})
I'm pretty sure this will error because of the unneccessary {}'s around
the POST array items. PHP really doesn't like you using extra curlies
arou
or use concat_ws (concatenation with separator)
concat_ws('-',{$_POST['PO_Year']},{$_POST['PO_Month']},{$_POST['PO_Day']})
bastien
ps. I strongly recommend validating data before you insert into the db
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject:
wouldn't it be
$_POST['PO_Year']."-".$_POST['PO_Month']."-".$_POST['PO_Day']
?
metin
[EMAIL PROTECTED] wrote:
Hello I have a application that has an insert query (using a mysql
database) and I am having an issue with trying to combine three fields
with a dash . Here is my code can anyone plea
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
> '{$_POST['PO_Year']}-{$_POST['PO_Month']}-{$_POST['PO_Day']}'
"{$_POST['PO_Year']}-{$_POST['PO_Month']}-{$_POST['PO_Day']}"
Variables aren't evaluated in single quotes.
- Martin Norland, Database / Web Developer, Int
Hello I have a application that has an insert query (using a mysql
database) and I am having an issue with trying to combine three fields
with a dash . Here is my code can anyone please help me out with what
else I need to add or point me to somewhere that explains how to combine
field's in a