Re: [PHP-DB] INSERT Question

2003-03-31 Thread Mustafa Ocak
ginal Message - From: "Charles Kline" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Tuesday, April 01, 2003 5:56 AM Subject: Re: [PHP-DB] INSERT Question Everything looks okay with this when I echo the sql string: INSERT INTO tbl_ib_arti

Re: [PHP-DB] INSERT Question

2003-03-31 Thread Charles Kline
Everything looks okay with this when I echo the sql string: INSERT INTO tbl_ib_articles (issue_brief,article) VALUES ('24','30'),('24','20'),('24','31') My question was, what do I need to change to make this an UPDATE? Thanks, Charles On Monday, March 31, 2003, at 08:30 PM, [EMAIL PROTECTED] wr

Re: [PHP-DB] INSERT Question

2003-03-31 Thread Charles Kline
How would I modify the code below to handle an UPDATE? On Sunday, March 30, 2003, at 07:19 PM, Charles Kline wrote: then I built the INSERT like so: foreach($article_keys as $articleid) { $insert[] = "('$v_ib_id','$articleid')"; } $article_sql = "INSERT INTO tbl_ib_articles (issue_brief,article)

Re: [PHP-DB] INSERT Question

2003-03-30 Thread Charles Kline
will run quicker overall. ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -Original Message- From: Charles Kline [mailto:[EMAIL PROTECTED] Sent: Saturday, March 29, 2003 9:11 PM To: Peter Lovatt Cc: [EMAIL PROTECTED

Re: [PHP-DB] INSERT Question

2003-03-29 Thread Charles Kline
. ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -Original Message- From: Charles Kline [mailto:[EMAIL PROTECTED] Sent: Saturday, March 29, 2003 9:11 PM To: Peter Lovatt Cc: [EMAIL PROTECTED] Subject: Re: [PHP-DB] INSERT

RE: [PHP-DB] INSERT Question

2003-03-29 Thread John W. Holmes
age- > From: Charles Kline [mailto:[EMAIL PROTECTED] > Sent: Saturday, March 29, 2003 9:11 PM > To: Peter Lovatt > Cc: [EMAIL PROTECTED] > Subject: Re: [PHP-DB] INSERT Question > > Big help! Thanks much. > > Now... to figure out how to create that kind of form in HTML_QuickForm

Re: [PHP-DB] INSERT Question

2003-03-29 Thread Charles Kline
Big help! Thanks much. Now... to figure out how to create that kind of form in HTML_QuickForm (hehehe). If I can't then I just make it by hand, but now I know the method! Phew... always more to learn. - Charles On Saturday, March 29, 2003, at 08:51 PM, Peter Lovatt wrote: Hi you need to crea

RE: [PHP-DB] INSERT Question

2003-03-29 Thread Peter Lovatt
Hi you need to create 5 selects, all named investigator[] with index 1-5 (or 0-4), with the option set to empty for no selection. this will return an array investigator[1] => '1064618047' investigator_yesno[1] => 'Y' investigator[2] => '1649815377' investigator_yesno[2] => 'N' for example

Re: [PHP-DB] INSERT Question

2003-03-29 Thread Charles Kline
John, I modified my form, but not having much luck. Here is my new form (so far): ** I need to add 4 more selects, not sure how to name them ** Choose person Paul A Katrina A David A is a primary investigator? Yes No When I submit this form and do a print_r() on the array this is what I get.

Re: [PHP-DB] INSERT Question

2003-03-29 Thread Charles Kline
John, Thanks. Yes that is a big help. The radio button is actually not used for that purpose (sorry that was a bit confusing of me to put in without an explanation). For each person selected, the radio button Y/N relates to whether they are an author of the report or just a contributer. I assum

RE: [PHP-DB] INSERT Question

2003-03-29 Thread John W. Holmes
> Since I don't totally understand (newbie) I will show you an example of > the form. > > > > Joe Smith > etc. > > Y name="person1yn" value="No"> N So if the 'Y' radio button is chosen, you'll want to take that 'person' and input them into the table? First, the easy way would be to lose the

Re: [PHP-DB] INSERT Question

2003-03-29 Thread Charles Kline
Since I don't totally understand (newbie) I will show you an example of the form. Joe Smith etc. Y N Joe Smith etc. Y N and so on... On Saturday, March 29, 2003, at 05:25 PM, John W. Holmes wrote: I was wondering what is the best way to insert multiple records into a table? Here i

RE: [PHP-DB] INSERT Question

2003-03-29 Thread John W. Holmes
> I was wondering what is the best way to insert multiple records into a > table? Here is the scenario... > > I have a form which has 5 select menus as part of the data that gets > entered. Most of the data goes into a table called tbl_reports. Each of > these 5 menus contains the same list of peo

[PHP-DB] INSERT Question

2003-03-29 Thread Charles Kline
Hi there. I was wondering what is the best way to insert multiple records into a table? Here is the scenario... I have a form which has 5 select menus as part of the data that gets entered. Most of the data goes into a table called tbl_reports. Each of these 5 menus contains the same list of p

RE: [PHP-DB] INSERT question. 2 pointers.

2002-11-22 Thread Hutchins, Richard
ion, check the MySQL manual under the heading "INSERT Syntax". > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Sent: Friday, November 22, 2002 1:11 AM > To: [EMAIL PROTECTED] > Subject: [PHP-DB] INSERT question. 2 pointers. > >

[PHP-DB] INSERT question. 2 pointers.

2002-11-21 Thread Amit_Wadhwa
and you will know exactly where is the problem from the error generated. regards, *** Amit Wadhwa Dell International Services *** -Original Message- From: NIPP, SCOTT V (SBCSI) [mailto:[EMAIL PROTECTED]] Sent: Thursday, November 21, 2002 12:46 AM

RE: [PHP-DB] INSERT question...

2002-11-20 Thread NIPP, SCOTT V (SBCSI)
, November 20, 2002 2:47 PM To: NIPP, SCOTT V (SBCSI); 'Aaron Wolski'; [EMAIL PROTECTED] Subject: Re: [PHP-DB] INSERT question... > $query = "INSERT INTO accounts (`id-sys`, rtime) VALUES('".$accnts[0]."', > 'NOW()')"; Remove the quotes arou

Re: [PHP-DB] INSERT question...

2002-11-20 Thread 1LT John W. Holmes
> $query = "INSERT INTO accounts (`id-sys`, rtime) VALUES('".$accnts[0]."', > 'NOW()')"; Remove the quotes around NOW(). It's a function, not a string. ---John Holmes... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP-DB] INSERT question...

2002-11-20 Thread NIPP, SCOTT V (SBCSI)
- From: 1LT John W. Holmes [mailto:[EMAIL PROTECTED]] Sent: Wednesday, November 20, 2002 2:21 PM To: NIPP, SCOTT V (SBCSI); 'Aaron Wolski'; [EMAIL PROTECTED] Subject: Re: [PHP-DB] INSERT question... > OK. This sounds great, but now I am getting a completely different > error

Re: [PHP-DB] INSERT question...

2002-11-20 Thread Ryan Gallagher
Quoting "1LT John W. Holmes" <[EMAIL PROTECTED]>: > > OK. This sounds great, but now I am getting a completely different > > error message. > > > > You have an error in your SQL syntax near '-sys) VALUES('sn4265-turner')' > at > > line 1 > > > > Here is the INSERT statement: > > > > $query = "INS

Re: [PHP-DB] INSERT question...

2002-11-20 Thread 1LT John W. Holmes
> OK. This sounds great, but now I am getting a completely different > error message. > > You have an error in your SQL syntax near '-sys) VALUES('sn4265-turner')' at > line 1 > > Here is the INSERT statement: > > $query = "INSERT INTO accounts (id-sys) VALUES('".$accnts[0]."')"; > > Do I have to

RE: [PHP-DB] INSERT question...

2002-11-20 Thread NIPP, SCOTT V (SBCSI)
] Sent: Wednesday, November 20, 2002 1:28 PM To: '1LT John W. Holmes'; NIPP, SCOTT V (SBCSI); [EMAIL PROTECTED] Subject: RE: [PHP-DB] INSERT question... Hmm You learn something new everyday :) Aaron -Original Message- From: 1LT John W. Holmes [mailto:[EMAIL PROTECTED]] S

Re: [PHP-DB] INSERT question...

2002-11-20 Thread Ryan Gallagher
Quoting "NIPP, SCOTT V (SBCSI)" <[EMAIL PROTECTED]>: > I have an INSERT statement that I cannot quiet get working. The > table that this data is being put into has 7 columns, but I only care about > putting in the data from the first two columns at this time. The first > column is an array

RE: [PHP-DB] INSERT question...

2002-11-20 Thread Aaron Wolski
Hmm You learn something new everyday :) Aaron -Original Message- From: 1LT John W. Holmes [mailto:[EMAIL PROTECTED]] Sent: November 20, 2002 2:27 PM To: Aaron Wolski; 'NIPP, SCOTT V (SBCSI)'; [EMAIL PROTECTED] Subject: Re: [PHP-DB] INSERT question... > Try... $query =

Re: [PHP-DB] INSERT question...

2002-11-20 Thread 1LT John W. Holmes
$query = "INSERT INTO accounts (accnts) VALUES (".$accnts[0].")"; ---John Holmes... > > -Original Message- > From: NIPP, SCOTT V (SBCSI) [mailto:[EMAIL PROTECTED]] > Sent: November 20, 2002 2:16 PM > To: '[EMAIL PROTECTED]' > Subject: [PH

RE: [PHP-DB] INSERT question...

2002-11-20 Thread Aaron Wolski
Try... $query = "INSERT INTO accounts (accnts,timestamp) VALUES(''.$accnts[0].'','TIMESTAMP(10)')"; Might work? Aaron -Original Message- From: NIPP, SCOTT V (SBCSI) [mailto:[EMAIL PROTECTED]] Sent: November 20, 2002 2:16 PM To: '[EMAIL

[PHP-DB] INSERT question...

2002-11-20 Thread NIPP, SCOTT V (SBCSI)
I have an INSERT statement that I cannot quiet get working. The table that this data is being put into has 7 columns, but I only care about putting in the data from the first two columns at this time. The first column is an array element, and the second column needs to be a timestamp. Her