Re: [PHP] Inserting, storing, outputting dates and selections

2010-06-02 Thread Andre Polykanine
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

Re: [PHP] Inserting, storing, outputting dates and selections

2010-06-02 Thread Shreyas
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

[PHP] Inserting, storing, outputting dates and selections

2010-06-02 Thread David Mehler
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

Re: [PHP] Inserting rows with missing IDs

2010-05-05 Thread tedd
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,

Re: [PHP] Inserting rows with missing IDs

2010-05-04 Thread Nathan Rixham
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,

Re[2]: [PHP] Inserting rows with missing IDs

2010-05-04 Thread Andre Polykanine
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

Re: [PHP] Inserting rows with missing IDs

2010-05-04 Thread Richard Quadling
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

Re: [PHP] Inserting rows with missing IDs

2010-05-04 Thread Richard Quadling
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

Re: [PHP] Inserting rows with missing IDs

2010-05-04 Thread Richard Quadling
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

Re: [PHP] Inserting rows with missing IDs

2010-05-03 Thread tedd
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

[PHP] Re: [Bulk] [PHP] Inserting rows with missing IDs

2010-05-03 Thread Stephen
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

Re[2]: [PHP] Inserting rows with missing IDs

2010-05-03 Thread Andre Polykanine
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

RE: [PHP] Inserting rows with missing IDs

2010-05-03 Thread Bob McConnell
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

[PHP] Inserting rows with missing IDs

2010-05-03 Thread Andre Polykanine
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

Re: [PHP] Inserting into multiple tables

2010-04-12 Thread Gary
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

Re: [PHP] Inserting into multiple tables

2010-04-12 Thread tedd
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

Re: [PHP] Inserting into multiple tables

2010-04-12 Thread Gary
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

Re: [PHP] Inserting into multiple tables

2010-04-11 Thread Paul M Foster
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.

Re: [PHP] Inserting into multiple tables

2010-04-11 Thread Nathan Rixham
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

Re: [PHP] Inserting into multiple tables

2010-04-11 Thread Gary
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

RE: [PHP] Inserting into multiple tables

2010-04-10 Thread Tommy Pham
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 &

Re: [PHP] Inserting into multiple tables

2010-04-10 Thread Gary
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

Re: [PHP] Inserting into multiple tables

2010-04-10 Thread Adam Richardson
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

Re: [PHP] Inserting into multiple tables

2010-04-10 Thread Gary
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

Re: [PHP] Inserting into multiple tables

2010-04-10 Thread Adam Richardson
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

[PHP] Inserting into multiple tables

2010-04-10 Thread Gary
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

Re: [PHP] Inserting Associative array values into a MySQL INSERT statement?

2010-02-14 Thread TG
each ($arr as $key => $val) { $queryvalues[] = " `" . dbclean($key) . "` = '" . dbclean($val) . "'"; } $query .= implode(',', $queryvalues) . ' WHERE {whereclause};'; // Added {whereclause} so if we

[PHP] Inserting Associative array values into a MySQL INSERT statement?

2010-02-14 Thread Ben Stones
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

Re: [PHP] Re: PHP inserting carriage returns into POST values?

2009-09-04 Thread James Colannino
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

Re: [PHP] PHP inserting carriage returns into POST values?

2009-09-04 Thread Paul M Foster
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

[PHP] Re: PHP inserting carriage returns into POST values?

2009-09-04 Thread Nisse Engström
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

Re: [PHP] PHP inserting carriage returns into POST values?

2009-09-04 Thread James Colannino
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

Re: [PHP] PHP inserting carriage returns into POST values?

2009-09-04 Thread Andrew Ballard
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

[PHP] PHP inserting carriage returns into POST values?

2009-09-04 Thread James Colannino
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

Re: [PHP] inserting php value in html shorter wayand downloading winword & mp3 files the fancy way

2009-08-24 Thread Paul M Foster
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

Re: [PHP] inserting php value in html shorter wayand downloading winword & mp3 files the fancy way

2009-08-24 Thread Ashley Sheridan
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

[PHP] inserting php value in html shorter wayand downloading winword & mp3 files the fancy way

2009-08-24 Thread Grega Leskovšek
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

[PHP] inserting blobs into mysql

2009-06-17 Thread Tom Worster
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

RE: [PHP] inserting ´ in a db

2007-10-04 Thread Robert Cummings
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

RE: [PHP] inserting ´ in a db

2007-10-04 Thread Warren Vail
-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

RE: [PHP] inserting ´ in a db

2007-10-04 Thread Robert Cummings
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

RE: [PHP] inserting ´ in a db

2007-10-04 Thread Warren Vail
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

Re: [PHP] inserting ´ in a db

2007-10-03 Thread Aleksandar Vojnovic
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

Re: [PHP] inserting ´ in a db

2007-10-03 Thread Larry Garfield
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

Re: [PHP] inserting ´ in a db

2007-10-03 Thread Tom Swiss
[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:

Re: [PHP] inserting ´ in a db

2007-10-03 Thread Chris
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

RE: [PHP] inserting ´ in a db

2007-10-03 Thread Bastien Koert
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

[PHP] inserting ´ in a db

2007-10-03 Thread Yamil Ortega
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

Re: [PHP] Inserting single quotes

2007-07-07 Thread Jim Lucas
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

Re: [PHP] Inserting single quotes

2007-07-06 Thread skip evans
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

Re: [PHP] Inserting single quotes

2007-07-06 Thread Chris
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

Re: [PHP] Inserting single quotes

2007-07-06 Thread skip evans
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

[PHP] Inserting single quotes

2007-07-06 Thread skip evans
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

[PHP] Inserting header() info into ob_start

2006-11-14 Thread Graham Anderson
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

Re: [PHP] Inserting data at runtime (php,mysql)

2006-03-21 Thread Thorsten Suckow-Homberg
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

[PHP] Inserting data at runtime (php,mysql)

2006-03-21 Thread sathyashrayan
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

Re: [PHP] Inserting data at runtime (php,mysql)

2006-03-21 Thread sathyashrayan
- 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

RE: [PHP] Inserting data at runtime (php,mysql)

2006-03-21 Thread Dan Parry
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

Re: [PHP] Inserting data at runtime (php,mysql)

2006-03-21 Thread Robin Vickery
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

Re: [PHP] Inserting data at runtime (php,mysql)

2006-03-21 Thread sathyashrayan
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

Re: [PHP] Inserting data at runtime (php,mysql)

2006-03-21 Thread sathyashrayan
- 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

Re: [PHP] Inserting data at runtime (php,mysql)

2006-03-21 Thread sathyashrayan
- 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

RE: [PHP] Inserting data at runtime (php,mysql)

2006-03-21 Thread Dan Parry
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

[PHP] inserting text into a mime message

2006-01-19 Thread Geoff
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.

Re: [PHP] Inserting a NULL value into MySQL via PHP

2005-12-07 Thread [EMAIL PROTECTED]
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

Re: [PHP] Inserting a NULL value into MySQL via PHP

2005-11-11 Thread Richard Lynch
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)

Re: [PHP] Inserting a NULL value into MySQL via PHP

2005-11-10 Thread Curt Zirzow
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

Re: [PHP] Inserting a NULL value into MySQL via PHP

2005-11-10 Thread Jasper Bryant-Greene
[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,

[PHP] Inserting a NULL value into MySQL via PHP

2005-11-10 Thread [EMAIL PROTECTED]
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?

Re: [PHP] Inserting NULL Integer Values

2005-10-18 Thread Richard Lynch
$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, >

[PHP] Inserting NULL Integer Values

2005-10-18 Thread Shaun
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.'",

Re: [PHP] Inserting records question

2005-09-09 Thread Mark Rees
> > 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

RE: [PHP] Inserting records question

2005-09-08 Thread Warren Vail
: 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

Re: [PHP] Inserting records question

2005-09-08 Thread Scott Noyes
> 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)"; >

Re: [PHP] Inserting records question

2005-09-08 Thread Philip Hallstrom
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

[PHP] Inserting records question

2005-09-08 Thread Iggep
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

Re: [PHP] inserting an auto incemented column in table already created

2005-04-30 Thread Marek Kilimajer
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

Re: [PHP] inserting an auto incemented column in table already created

2005-04-29 Thread Richard Lynch
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

RE: [PHP] inserting an auto incemented column in table already created

2005-04-29 Thread Jay Blanchard
[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

[PHP] inserting an auto incemented column in table already created

2005-04-29 Thread Ross Hulford
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

Re: [PHP] inserting arabic into mysql

2005-03-13 Thread [EMAIL PROTECTED]
Hello, Try to set the charachter encoding of your page to: Arabic(Windows-1256) Anas > SSBoYXZlIGEgdGV4dCBhcmVhIGZvcm0gYW5kIHdoZW4gSSBpbnNlcnQgaXQgaW50byBteXNxbCBJ > IGdldCBsZXR0ZXJzIGxpa2UgCnRoaXM6CsOZIsOZxaDDmMKow5jCqsOZ4oCgw5kiw5nigKbDmeKA > oMOYwqjDmcWgw5jCqsOZIiDDmeKAoMOZxaDDmMKow5kiCsOYwq

[PHP] inserting arabic into mysql

2005-03-13 Thread p80
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

Re: [PHP] inserting utf8 from PHP to MySQL makes text unreadable [SOLVED]

2005-02-01 Thread Dave
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

Re: [PHP] inserting utf8 from PHP to MySQL makes text unreadable

2005-02-01 Thread Marek Kilimajer
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] inserting utf8 from PHP to MySQL makes text unreadable

2005-01-31 Thread Dave
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

Re: [PHP] inserting html within a mail body

2004-12-07 Thread Richard Lynch
> 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

Re: [PHP] inserting html within a mail body

2004-12-06 Thread Ramil Sagum
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

[PHP] inserting html within a mail body

2004-12-06 Thread Ross Hulford
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

Re: [PHP] inserting timestamp into mysql field

2004-09-22 Thread Andrew Kreps
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

Re: [PHP] inserting timestamp into mysql field

2004-09-22 Thread Chris Dowell
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

Re: [PHP] inserting timestamp into mysql field

2004-09-21 Thread Andrew Kreps
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

RE: [PHP] inserting timestamp into mysql field

2004-09-21 Thread Chris Gregors
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

Re: [PHP] inserting timestamp into mysql field

2004-09-21 Thread Chris Dowell
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

Re: [PHP] inserting timestamp into mysql field

2004-09-21 Thread Marek Kilimajer
[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

[PHP] inserting timestamp into mysql field

2004-09-21 Thread luke
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

Re[2]: [PHP] Inserting string - need to trim comma

2004-04-01 Thread Tom Rogers
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

Re: [PHP] Inserting string - need to trim comma

2004-04-01 Thread Chris Shiflett
--- "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

Re: [PHP] Inserting string - need to trim comma

2004-04-01 Thread John W. Holmes
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)

Re: [PHP] Inserting string - need to trim comma

2004-04-01 Thread Doug Parker
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 -

Re: [PHP] Inserting string - need to trim comma

2004-04-01 Thread Matt Matijevich
--- 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   2   3   >