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
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
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
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.
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
.
---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
hi all,
i was just wondering if there are any naming conventions when creating
database connections. most of my books use
$sql = "SQL STRING";
and
$sth = $db->query() or $result = $db->query()
I have no idea what sth stands for in this case, but was curious how
others name stuff.
thanks
Cha
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
I am trying to build an array from the results of a query on a mySQL
table.
I am using a loop to create this string in a variable $mystring:
'30'=>true, '20'=>true
I then need to use it like this:
$defaultValues['ib_article'] = array($mystring);
It isn't working. I am sure there is a better
uot;.$thevalue."'=>true, ";
}
On Monday, March 31, 2003, at 04:32 PM, Jennifer Goodie wrote:
Instead of building a string in your loop do the assignment in the loop
I have no idea what is being pulled from where, so I can't really give
a
good example
-Original Message--
ch 31, 2003, at 04:52 PM, Jennifer Goodie wrote:
$mystring;
foreach ($sth_opt as $thekey => $thevalue){
$mystring .= "'".$thevalue."'=>true, ";
}
$defaultValues['ib_article'] = array($mystring);
Try this ...
foreach ($sth_opt as $thekey
hi all, i am changing the title are reposting - i have a clearer idea
now of what i am trying to do...
what is the syntax to initialize an associative array with values
returned in a query where the key in the array is coming from the query
and the value is static value of true?
i want to crea
Hey. I just figured it out! So simple too :)
$myarray = array();
foreach ($sth_opt as $thekey => $thevalue){
$myarray[$thevalue] = true;
}
On Monday, March 31, 2003, at 06:05 PM, Charles Kline wrote:
hi all, i am changing the title are reposting - i have a clearer idea
now of what i
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 t
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
Hi all,
I have a table that contains the 'Sort Order' of some stories which are
kept in another table. I want to be able to 're-order' these items but
I am not sure how to go about this (technique wise).
For example: I have a form with a series of select menus. Each menu
represents the positio
Hi all,
I am working on an application that requires me to connect to two
MySQL databases both hosted on the same server.
I have an existing set of class files I created to handle the db
connection to the main database. To connect to the second database, I
duplicated my db class files and
On Sep 30, 2005, at 11:51 AM, Larry E. Ullman wrote:
I had this problem a while ago, when you try to create the second
connection
to the database with the same login credentials, i.e username and
password.
If mysql / php detect there is a connection already established
with those
details
18 matches
Mail list logo