e
- Original message -
From: David Mehler
To: php-general
Date: Wednesday, June 2, 2010, 11:20:55 PM
Subject: [PHP] Inserting, storing, outputting dates and selections
Hello,
I've got two questions which are probably fairly simple, my issue is
i'm staring at this so long it's
I can try to answer the second one but would wait for the PHP gurus to chime
in.
Can't you have Choice=1 with selected="true" by default? On the PHP end, you
can get the value of whatever was selected.
Regards,
Shreyas
On Thu, Jun 3, 2010 at 1:50 AM, David Mehler wrote:
> Hello,
> I've got two
Hello,
I've got two questions which are probably fairly simple, my issue is
i'm staring at this so long it's blurring together.
I'm working on a form to insert data in to a mysql database. I've got
a startdate and and enddate field in the database both of type DATE,
i'm needing this as i'm
Richard Quadling wrote:
On 3 May 2010 14:34, Andre Polykanine wrote:
Hello everyone,
It's not a strictly PHP question, however since I use that with PHP,
I'm asking it there.
How can I accomplish the task of inserting rows into MySql database
with missing IDs? Say, I have rows with IDs 1, 2, 3,
Richard Quadling wrote:
On 3 May 2010 14:34, Andre Polykanine wrote:
Hello everyone,
It's not a strictly PHP question, however since I use that with PHP,
I'm asking it there.
How can I accomplish the task of inserting rows into MySql database
with missing IDs? Say, I have rows with IDs 1, 2, 3,
To: Andre Polykanine
Date: Tuesday, May 4, 2010, 6:08:28 PM
Subject: [PHP] Inserting rows with missing IDs
On 3 May 2010 14:34, Andre Polykanine wrote:
> Hello everyone,
> It's not a strictly PHP question, however since I use that with PHP,
> I'm asking it there.
> How ca
On 3 May 2010 14:34, Andre Polykanine wrote:
> Hello everyone,
> It's not a strictly PHP question, however since I use that with PHP,
> I'm asking it there.
> How can I accomplish the task of inserting rows into MySql database
> with missing IDs? Say, I have rows with IDs 1, 2, 3, 5, 9, 12, 17, an
On 3 May 2010 14:34, Andre Polykanine wrote:
> Hello everyone,
> It's not a strictly PHP question, however since I use that with PHP,
> I'm asking it there.
> How can I accomplish the task of inserting rows into MySql database
> with missing IDs? Say, I have rows with IDs 1, 2, 3, 5, 9, 12, 17, an
On 3 May 2010 14:34, Andre Polykanine wrote:
> Hello everyone,
> It's not a strictly PHP question, however since I use that with PHP,
> I'm asking it there.
> How can I accomplish the task of inserting rows into MySql database
> with missing IDs? Say, I have rows with IDs 1, 2, 3, 5, 9, 12, 17, an
At 4:34 PM +0300 5/3/10, Andre Polykanine wrote:
Hello everyone,
It's not a strictly PHP question, however since I use that with PHP,
I'm asking it there.
How can I accomplish the task of inserting rows into MySql database
with missing IDs? Say, I have rows with IDs 1, 2, 3, 5, 9, 12, 17, and
195
Andre Polykanine wrote:
Hello everyone,
It's not a strictly PHP question, however since I use that with PHP,
I'm asking it there.
How can I accomplish the task of inserting rows into MySql database
with missing IDs? Say, I have rows with IDs 1, 2, 3, 5, 9, 12, 17, and
195. How do I make the check
dex.ru; Jabber: arthaelon @
jabber.org
Yahoo! messenger: andre.polykanine; ICQ: 191749952
Twitter: m_elensule
- Original message -
From: Bob McConnell
To: Andre Polykanine
Date: Monday, May 3, 2010, 4:40:18 PM
Subject: [PHP] Inserting rows with missing IDs
From: Andre Polykanine
> It
From: Andre Polykanine
> It's not a strictly PHP question, however since I use that with PHP,
> I'm asking it there.
> How can I accomplish the task of inserting rows into MySql database
> with missing IDs? Say, I have rows with IDs 1, 2, 3, 5, 9, 12, 17, and
> 195. How do I make the check that al
Hello everyone,
It's not a strictly PHP question, however since I use that with PHP,
I'm asking it there.
How can I accomplish the task of inserting rows into MySql database
with missing IDs? Say, I have rows with IDs 1, 2, 3, 5, 9, 12, 17, and
195. How do I make the check that allows to insert fir
Tedd
Thanks for your response, perhaps I was completely missing this or my powers
of expanation have gone out the window.
I have found a solution and I am going to put it in its own post.
Thanks again.
gary
"tedd" wrote in message
news:p0624080ac7e9123f4...@[192.168.1.102]...
> At 11:05 AM
At 11:05 AM -0400 4/12/10, Gary wrote:
-snip-
If normalization is so important, why is it that the INSERT INTO multiple
tables is not a standard command or procedure?.
In my view, you are mixing apples and oranges.
"Normalization" is simply cutting down on repetition. Inserting data
into mult
Nathan
Thank you for your excellent explanation! One of the reasons I love this
board is the vast knowledge that people are willing to share.
I believe I understand the importance of normalization, however one of my
original questions seems to still stand.
If normalization is so important, why
On Sun, Apr 11, 2010 at 12:21:28AM -0400, Gary wrote:
>
> Most of the information about mutilple tables deals with the retreval of
> data from, not inserting into, meaning they are more used for known data
> inserted by the database owner/administrator to be retrieved by queries into
> the DB.
Gary wrote:
> Adam
>
> Thank you for your well thought out response.
>
> Two points:
>
> I did not include any anti-injection functions because this was an
> experiment for multiple tables, it is on my machine only.
>
> Since these are php scripts, I dont think anyone will mind (not to mention
om: Gary [mailto:gwp...@ptd.net]
Sent: Saturday, April 10, 2010 2:28 PM
To: php-general@lists.php.net
Subject: [PHP] Inserting into multiple tables
I am experimenting with multiple tables, it is only a test that is my
local
machine only. This is the current code, which does not work , I have
tried
to co
Hi Gary,
> -Original Message-
> From: Gary [mailto:gwp...@ptd.net]
> Sent: Saturday, April 10, 2010 2:28 PM
> To: php-general@lists.php.net
> Subject: [PHP] Inserting into multiple tables
>
> I am experimenting with multiple tables, it is only a test that is my
&
Adam
Thank you for your well thought out response.
Two points:
I did not include any anti-injection functions because this was an
experiment for multiple tables, it is on my machine only.
Since these are php scripts, I dont think anyone will mind (not to mention
this board always provides gre
On Sat, Apr 10, 2010 at 7:56 PM, Gary wrote:
> Adam
>
> Thanks for your reply, but I think I am totally confused. Not so much by
> your answer (although I admit I did not get it to work yet), but by the
> entire multiple table issue. Several books I use talk about the importance
> of using multi
Adam
Thanks for your reply, but I think I am totally confused. Not so much by
your answer (although I admit I did not get it to work yet), but by the
entire multiple table issue. Several books I use talk about the importance
of using multiple tables, yet are thin on the insert issue. Searchi
On Sat, Apr 10, 2010 at 5:27 PM, Gary wrote:
> I am experimenting with multiple tables, it is only a test that is my local
> machine only. This is the current code, which does not work , I have tried
> to concatonate the insert statements. I have tried multiple $query
> variables, but it is just
I am experimenting with multiple tables, it is only a test that is my local
machine only. This is the current code, which does not work , I have tried
to concatonate the insert statements. I have tried multiple $query
variables, but it is just overwriting itself (only the last one gets
inserte
each ($arr as $key => $val) {
$queryvalues[] = " `" . dbclean($key) . "` = '" .
dbclean($val) . "'";
}
$query .= implode(',', $queryvalues) . ' WHERE {whereclause};';
// Added {whereclause} so if we
Hi,
I want to be able to create a function that acts as an insert mysql function
that accepts specific parameters for the fields and the values I want to
insert into those respective fields and I know I'll need to use associative
arrays to complete this task when passing values to the function, bu
Nisse Engström wrote:
> It may be the browser that is converting those line breaks.
Ah. That's probably it then. I didn't realize that was a part of the
HTML standard. Thanks!
James
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
On Fri, Sep 04, 2009 at 12:16:47PM -0700, James Colannino wrote:
> Hey everyone. I ran into a really weird issue that I was hoping I could
> find some clarification on. In short, I have javascript functions that
> operate on hidden text values. Those values may be posted, in which
> case PHP th
On Fri, 04 Sep 2009 12:16:47 -0700, James Colannino wrote:
> Hey everyone. I ran into a really weird issue that I was hoping I could
> find some clarification on. In short, I have javascript functions that
> operate on hidden text values. Those values may be posted, in which
> case PHP then pri
Andrew Ballard wrote:
> Javascript interpolates \n as a newline character inside both double
> and single quotes unlike PHP that only interpolates inside double
> quotes. If the client browser is running under Windows, it may even be
> possible that the \n is recognized by the browser as a line te
On Fri, Sep 4, 2009 at 3:16 PM, James Colannino wrote:
> Hey everyone. I ran into a really weird issue that I was hoping I could
> find some clarification on. In short, I have javascript functions that
> operate on hidden text values. Those values may be posted, in which
> case PHP then prints t
Hey everyone. I ran into a really weird issue that I was hoping I could
find some clarification on. In short, I have javascript functions that
operate on hidden text values. Those values may be posted, in which
case PHP then prints them back to the page via what comes in on $_POST.
The weird th
On Mon, Aug 24, 2009 at 05:56:46PM +0200, Grega Leskov??ek wrote:
> Hi, I am still a newbie in php. Is there a shorter way to include a php
> value in a form?
>
> is it possible to do smth like this like in
> JSP?
> Can I omit the last whitespace before the closing ?> ?
Yes, you can include a P
On Mon, 2009-08-24 at 17:56 +0200, Grega Leskovšek wrote:
> Hi, I am still a newbie in php. Is there a shorter way to include a php
> value in a form?
>
> is it possible to do smth like this like in
> JSP?
> Can I omit the last whitespace before the closing ?> ?
>
> ***
> I tried to download the
Hi, I am still a newbie in php. Is there a shorter way to include a php
value in a form?
is it possible to do smth like this like in
JSP?
Can I omit the last whitespace before the closing ?> ?
***
I tried to download the file from another server the fancy way in PHP, but
it just display blank sc
i'm having trouble getting binary data into blobs in mysql.
to help debug, i set up a test db and discovered that when i insert a binary
string encoded using mysql_real_escape_string (according to the php manual:
"If binary data is to be inserted, this function must be used."), only byte
values lo
On Thu, 2007-10-04 at 10:55 -0700, Warren Vail wrote:
> Rob,
>
> Your opinion would have meant more had you offered a solution. The only
> hole that I am aware of is the likelihood that the imbedded query could get
> executed accidentally later.
>
> If the database is mysql, there is finally a m
-Original Message-
From: Robert Cummings [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 04, 2007 10:28 AM
To: Warren Vail
Cc: 'Yamil Ortega'; php-general@lists.php.net
Subject: RE: [PHP] inserting ´ in a db
On Thu, 2007-10-04 at 10:18 -0700, Warren Vail wrote:
> You need
On Thu, 2007-10-04 at 10:18 -0700, Warren Vail wrote:
> You need to escape the single quote, an easy way to do this is to run the
> text thru the addslashes() filter. Obviously you can't run your entire
> query thru the filter thru the filter because most of your quotes need to be
> identified by
iginal Message-
From: Yamil Ortega [mailto:[EMAIL PROTECTED]
Sent: Wednesday, October 03, 2007 7:45 PM
To: php-general@lists.php.net
Subject: [PHP] inserting ´ in a db
Hi list, good day.
I have a simple script that inserts text on a mysql table, that has a field
named description and the type
Pick one:
http://si2.php.net/manual/en/function.htmlentities.php
http://si2.php.net/manual/en/function.addslashes.php
http://si.php.net/mysql_escape_string
Aleksandar
Yamil Ortega wrote:
Hi list, good day.
I have a simple script that inserts text on a mysql table, that has a field
named de
On Wednesday 03 October 2007, Tom Swiss wrote:
> [EMAIL PROTECTED] (Chris) writes:
> > > Everting works fine, except when I try to insert a text that includes a
> > > simple quote.
> >
> > http://www.php.net/mysql_real_escape_string
>
> I'll see you that and raise you PEAR's database interface
[EMAIL PROTECTED] (Chris) writes:
> > Everting works fine, except when I try to insert a text that includes a
> > simple quote.
> http://www.php.net/mysql_real_escape_string
I'll see you that and raise you PEAR's database interfaces:
http://pear.php.net/package/DB - especially DB_common:
Yamil Ortega wrote:
Hi list, good day.
I have a simple script that inserts text on a mysql table, that has a field
named description and the type is text.
Everting works fine, except when I try to insert a text that includes a
simple quote.
For example
Yamil´s car
http://www.php.n
There are any number of elements to try
htmlspecialchars
mysql_real_escape_string
addslashes
RTFM and see what works best for your situation
bastien> From: [EMAIL PROTECTED]> To: php-general@lists.php.net> Date: Thu, 4
Oct 2007 11:44:34 +0900> Subject: [PHP] inserting ´ i
Hi list, good day.
I have a simple script that inserts text on a mysql table, that has a field
named description and the type is text.
Everting works fine, except when I try to insert a text that includes a
simple quote.
For example
Yamil´s car
I send the character string to a varia
skip evans wrote:
Yes, it turns out the production server did not have a php.ini file!!!
I copied the php.ini-recommended file into place, and it has
magic_quotes_gpc off and that did the trick.
Thanks much!
Skip
A good thing to use though, is code that will detect if it is turned on.
So
Yes, it turns out the production server did not have a
php.ini file!!!
I copied the php.ini-recommended file into place, and it
has magic_quotes_gpc off and that did the trick.
Thanks much!
Skip
Chris wrote:
The ini setting is magic_quotes_gpc (
http://www.php.net/ref.info#ini.magic-quotes
The ini setting is magic_quotes_gpc (
http://www.php.net/ref.info#ini.magic-quotes-gpc ). If that doesn't work
the it's mostly like an issue in your code, make sure there aren't any
differences.
Chris
skip evans wrote:
I'm sorry, I totally misnamed the subject of this email. It's the
slashes
I'm sorry, I totally misnamed the subject of this email.
It's the slashes that are getting inserted, but as I said
only on one server, not the other.
So I don't want to change the code, if I can help it. I
hope there is a setting that will prevent this from
happening.
Skip
base64 wrote:
t
Hey all,
I have the following in a text field in the database.
'u',0,'account',1
One my dev server if I update this in the database I get
the same string. On my production server I get this:
\'u\',0,\'account\',1
I thought setting magic_quotes=Off would disable this,
but it did not.
Can
How can I insert header() info directly into the ob_start stream?
I am compressing a css file with php before it is outputted to the
browser,
The below DOES work, but I have to insert the php header() info
DIRECTLY into the css file.
Otherwise, mystyle.css is interpreted as text/html inste
The connection is successful but the data are not getting inserted into the
table. I need to insert all the words into the table.
When I change the insert statement with one insert at a time, I can insert
values to the database. For exampel:
$qure = "INSERT INTO dict VALUES (1,'apple')";
Do
I have given a task to create a site which is a clone of www.onelook.com.
As a first stage I have downloaded a list of English words (only words not
meaning)
in a text format. I have created a data structure in the mysql database. And
wrote the
following code to insert data into the table at
- Original Message -
From: "Dan Parry" <[EMAIL PROTECTED]>
To: "'sathyashrayan'" <[EMAIL PROTECTED]>;
Sent: Tuesday, March 21, 2006 6:19 PM
Subject: RE: [PHP] Inserting data at runtime (php,mysql)
conn denotes a constant where the value yo
ositive
Or am I wrong?
Dan
-
Dan Parry
Senior Developer
Virtua Webtech Ltd
http://www.virtuawebtech.co.uk
-Original Message-
From: sathyashrayan [mailto:[EMAIL PROTECTED]
Sent: 21 March 2006 12:45
To: Dan Parry; php-general@lists.php.net
Subject: Re: [PH
On 21/03/06, sathyashrayan <[EMAIL PROTECTED]> wrote:
>
> - Original Message -
> From: "Dan Parry" <[EMAIL PROTECTED]>
> To: "'sathyashrayan'" <[EMAIL PROTECTED]>;
> Sent: Tuesday, March 21, 2006 6:12 PM
> Subject: RE: [P
Yes it is a error.Thanks.
- Original Message -
From: Dave Goodchild
To: sathyashrayan
Sent: Tuesday, March 21, 2006 6:16 PM
Subject: Re: [PHP] Inserting data at runtime (php,mysql)
Yes, but it should be $conn, not conn. There is no $ in front of the variable
name
- Original Message -
From: "Dan Parry" <[EMAIL PROTECTED]>
To: "'sathyashrayan'" <[EMAIL PROTECTED]>;
Sent: Tuesday, March 21, 2006 6:12 PM
Subject: RE: [PHP] Inserting data at runtime (php,mysql)
[snip]
$conn=mysql_connect(&quo
- Original Message -
From: "Thorsten Suckow-Homberg" <[EMAIL PROTECTED]>
To: "sathyashrayan" <[EMAIL PROTECTED]>
Cc:
Sent: Tuesday, March 21, 2006 6:00 PM
Subject: Re: [PHP] Inserting data at runtime (php,mysql)
The connection is successful but t
ua Webtech Ltd
http://www.virtuawebtech.co.uk
-Original Message-
From: sathyashrayan [mailto:[EMAIL PROTECTED]
Sent: 21 March 2006 12:20
To: php-general@lists.php.net
Subject: [PHP] Inserting data at runtime (php,mysql)
I have given a task to create a site which is a clone of www.onelook.com.
As a first stage
Hi All,
I've been searching the archives for help on this, but have come up
empty-handed. Here's the thing:
I'm using a PHP script to parse every message coming through a
mailserver. The server invokes my script for each message, giving it
a filename containing the full raw text of the email.
I tried this and it didn't work using PHP it just leaves a blank instead of
a NULL setting. Any other ideas?
On 11/11/05, Richard Lynch <[EMAIL PROTECTED]> wrote:
>
> On Thu, November 10, 2005 11:15 pm, Curt Zirzow wrote:
> > >
> > $sql_quoted = array(); // shiflett' -- style
> >
> > $myFieldVal
On Thu, November 10, 2005 11:15 pm, Curt Zirzow wrote:
>
> $sql_quoted = array(); // shiflett' -- style
>
> $myFieldValue = isset($POST['myFieldValue'])? $_POST['myFieldValue']:
> '';
>
> if (strlen(trim($myFieldValue)) {
> $sql_quoted['myField'] = "'" .
> mysql_real_escape_string($myFieldValue)
On Fri, Nov 11, 2005 at 01:09:39PM +1300, Jasper Bryant-Greene wrote:
> [EMAIL PROTECTED] wrote:
> >Is there a way when making a MySQL database entry through a PHP script and
> >there is no data to make the db treat it as NULL?
>
> Wouldn't this just work:
>
> INSERT INTO myTable (myField) VALUES
[EMAIL PROTECTED] wrote:
Is there a way when making a MySQL database entry through a PHP script and
there is no data to make the db treat it as NULL?
Wouldn't this just work:
INSERT INTO myTable (myField) VALUES (NULL)
Jasper
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe,
Is there a way when making a MySQL database entry through a PHP script and
there is no data to make the db treat it as NULL?
$value2 = strlen($value2) ? $value2 : 'NULL';
On Tue, October 18, 2005 11:15 am, Shaun wrote:
> Hi,
>
> Up to this point in time I used to construct my insert statements like
> this
>
> $qid = mysql_query('INSERT INTO MYTABLE (
> column1,
>
Hi,
Up to this point in time I used to construct my insert statements like this
$qid = mysql_query('INSERT INTO MYTABLE (
column1,
column2,
) VALUES (
"'.$value1.'",
> > Still learning, so sorry if this sounds really simply noobish. But as I
> > understand things currently this should work. But doesn't. I've been
> > looking over tutorials but just don't see whatever the problem is.
> >
> > I created a simple table with the following fields (in order)
> > tc
: Iggep
> Cc: php-general@lists.php.net
> Subject: Re: [PHP] Inserting records question
>
>
> > Still learning, so sorry if this sounds really simply
> noobish. But as
> > I understand things currently this should work. But doesn't. I've
> > been
> mysql_connect(localhost,$username,$password);
> @mysql_select_db("$database") or die("Unable to Connect to
> DB");
> $tc_query = "INSERT INTO $tablel VALUES(NULL, $lname, $fname,
> $machine_name,
> $email_addr, $problem, NULL)";
>
Still learning, so sorry if this sounds really simply noobish. But as I
understand things currently this should work. But doesn't. I've been
looking over tutorials but just don't see whatever the problem is.
I created a simple table with the following fields (in order)
tc_id (auto nmbr)
lname
Still learning, so sorry if this sounds really simply noobish. But as I
understand things currently this should work. But doesn't. I've been
looking over tutorials but just don't see whatever the problem is.
I created a simple table with the following fields (in order)
tc_id (auto nmbr)
lname
Ross Hulford wrote:
Hi,
I have a table with 15 columns or so that has been inherited from an older
db and am trying to insert an auto increment column (in mysql) without
having to number it manually. This is fine when I add new colums via a form
but the old entries have a null value
Alternativ
On Fri, April 29, 2005 2:14 pm, Ross Hulford said:
> I have a table with 15 columns or so that has been inherited from an older
> db and am trying to insert an auto increment column (in mysql) without
> having to number it manually. This is fine when I add new colums via a
> form
> but the old ent
[snip]
I have a table with 15 columns or so that has been inherited from an
older
db and am trying to insert an auto increment column (in mysql) without
having to number it manually. This is fine when I add new colums via a
form
but the old entries have a null value
Alternatively It has been c
Hi,
I have a table with 15 columns or so that has been inherited from an older
db and am trying to insert an auto increment column (in mysql) without
having to number it manually. This is fine when I add new colums via a form
but the old entries have a null value
Alternatively It has been con
Hello,
Try to set the charachter encoding of your page to: Arabic(Windows-1256)
Anas
>
SSBoYXZlIGEgdGV4dCBhcmVhIGZvcm0gYW5kIHdoZW4gSSBpbnNlcnQgaXQgaW50byBteXNxbCBJ
>
IGdldCBsZXR0ZXJzIGxpa2UgCnRoaXM6CsOZIsOZxaDDmMKow5jCqsOZ4oCgw5kiw5nigKbDmeKA
>
oMOYwqjDmcWgw5jCqsOZIiDDmeKAoMOZxaDDmMKow5kiCsOYwq
I have a text area form and when I insert it into mysql I get letters like
this:
Ã"ÃÅÃÂÃÂÃâÃ"ÃâÃâÃÂÃÅÃÂÃ" ÃâÃÅÃÂÃ"
ÃÂÃÅ
Ã"ÃÂÃÂÃÅ...
instead of arabic letters. anything I know do to get it right?
thanx in advance
Marek,
Thank you for your advice. I've wrapped my variable like so:
htmlspecialchars( $HTTP_POST_VARS['introJ'], ENT_COMPAT, "UTF-8")
and that seems to have made the variables store and display okay. I
actually have no idea what the "ENT_COMPAT" bit is doing, but
experimentation has taug
Dave wrote:
PHP General,
The Situation:
I am creating a form for users to enter text into a MySQL 3.23
database. The text is often in Japanese, encoded in utf-8 format.
The Problem:
When the utf-8 encoded text is inserted into the database, it becomes
random ASCII gibberish.
What
PHP General,
The Situation:
I am creating a form for users to enter text into a MySQL 3.23
database. The text is often in Japanese, encoded in utf-8 format.
The Problem:
When the utf-8 encoded text is inserted into the database, it
becomes random ASCII gibberish.
What I've Tried
> I am using the mail() function in php andI am looking for a quick and easy
> way to make the mail_body of an auto response email with HTML tags in it
> so
> I can add some style to it.
Don't. I, and others, will immediately delete your HTML "enhanced"
(cough, cough) email without opening it.
I
On Tue, 7 Dec 2004 02:31:10 -, Ross Hulford <[EMAIL PROTECTED]> wrote:
> Hi,
> I am using the mail() function in php andI am looking for a quick and easy
> way to make the mail_body of an auto response email with HTML tags in it so
> I can add some style to it.
Hi!
The PHPs manual page on t
Hi,
I am using the mail() function in php andI am looking for a quick and easy
way to make the mail_body of an auto response email with HTML tags in it so
I can add some style to it.
Are the use of CSS tags possible too?
Any suggestions will be much appreciated
Ross
--
PHP General M
On Wed, 22 Sep 2004 09:29:21 +0100, Chris Dowell <[EMAIL PROTECTED]> wrote:
> That's not 100% correct
>
> If you have more than one TIMESTAMP field only the first (IIRC) will be
> filled with the current time - other TIMESTAMP fields will only be filed
> if you set them = NULL.
>
You're absolute
That's not 100% correct
If you have more than one TIMESTAMP field only the first (IIRC) will be
filled with the current time - other TIMESTAMP fields will only be filed
if you set them = NULL.
This is true of MySQL < 4.1.2 - there is more fine-grained control over
the behaviour from 4.1.2 onwar
On Tue, 21 Sep 2004 16:25:37 +0100, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> i need to insert a current timestamp into a mysql field when a form is posted.
> can anyone suggest a simple way of doing this?
Here's the MySQL answer: If you have a (data type) timestamp field in
your table, you d
sql compatiable date/time stamps.
Then do the sql insert/update of your record.
-Original Message-
From: Chris Dowell [mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 21, 2004 10:00 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] inserting timestamp into mysql field
Not really a MySQL q
Not really a MySQL question - the answer happens to be MySQL, but the
question asks how to do it in PHP
This might still be necessary if the OP is using something like
DB_DataObject, as you can't really use NOW() in that situation
Try strftime [ http://uk.php.net/strftime - RTFM :) ] - a good f
[EMAIL PROTECTED] wrote:
Subject: inserting timestamp into mysql field
hi there,
i need to insert a current timestamp into a mysql field when a form is posted.
can anyone suggest a simple way of doing this? i would like to set a variable
in my php script to add into the insert statement. it needs t
Subject: inserting timestamp into mysql field
hi there,
i need to insert a current timestamp into a mysql field when a form is posted.
can anyone suggest a simple way of doing this? i would like to set a variable
in my php script to add into the insert statement. it needs to be in the
format 00-0
Hi,
Friday, April 2, 2004, 5:10:29 AM, you wrote:
MM>
MM> function insert($table, $data) {
MM> $sql = "INSERT INTO ".$table." SET ";
MM> foreach ($data as $k=>$v) {
MM> $sql.= $k." = '".$v."', ";
MM> }
MM> $sql.=";";
MM> $result = mysql_query($sql);
MM> }
MM> The only problem with the st
--- "John W. Holmes" <[EMAIL PROTECTED]> wrote:
> > http://www.php.net/rtrim
>
> rtrim() removes whitespace, not commas.
That's exactly what I thought (and said). :-)
Matt corrected me by pointing out a second, optional argument added in
4.1.0 where you can specify one or more characters to incl
From: "Matt Matijevich" <[EMAIL PROTECTED]>
>
> function insert($table, $data) {
> $sql = "INSERT INTO ".$table." SET ";
> foreach ($data as $k=>$v) {
> $sql.= $k." = '".$v."', ";
> }
> $sql.=";";
Take out the above line; you don't need to add the semi-colon
> $result = mysql_query($sql)
implode() worked perfectly.
thanks -
doug
- Original Message -
From: "Chris Shiflett" <[EMAIL PROTECTED]>
To: "Doug Parker" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, April 01, 2004 2:19 PM
Subject: Re: [PHP] Inserting string -
--- Matt Matijevich <[EMAIL PROTECTED]> wrote:
> http://www.php.net/rtrim
rtrim() trims whitespace, not commas.
Hope that helps.
Chris
string rtrim ( string str [, string charlist])
there is a second optional paremeter you can add to rtrim
rtrim($var,',');
will take any trailing commas o
1 - 100 of 207 matches
Mail list logo