On 17 June 2009 15:01, PJ advised:
It does, indeed. This confirms my inexperienced conclusion that
in_array() does not work on associative arrays per se; it works on
simple arrays and I just don't have the experience to think of
extracting only the id fields.
Let's squash this misconception
On 17 June 2009 14:30, PJ advised:
For the moment, I am trying to resolve the problem of
extracting a value
from a string returned by a query. I thought that in_array() would do
it, but the tests I have run on it are 100% negative. The only thing I
have not used in the tests is third
PJ wrote:
I'm including the relevant code:
// select categories for book to be updated
$sql = SELECT id, category FROM categories, book_categories
WHERE book_categories.bookID = '$bid'
book_categories.categories_id = categories.id;
if ( ( $results = mysql_query($sql, $db) ) ) {
Stuart wrote:
2009/6/18 PJ af.gour...@videotron.ca:
I snipped to make it short... continue at bottom...
Step back from the code and consider the steps you need to perform...
1) Get an array of the categories, ideally in the form $cats[catid]
= categoryname.
2) Get an array of the
Ford, Mike wrote:
On 17 June 2009 15:01, PJ advised:
It does, indeed. This confirms my inexperienced conclusion that
in_array() does not work on associative arrays per se; it works on
simple arrays and I just don't have the experience to think of
extracting only the id fields.
It is a sintax error
if (in_array($ex, $selected) --- missing )
echo br /yes;
else echo br /no;
On Thu, Jun 18, 2009 at 10:13 AM, PJ af.gour...@videotron.ca wrote:
Ford, Mike wrote:
On 17 June 2009 14:30, PJ advised:
For the moment, I am trying to resolve the problem of
Martin Scotta wrote:
It is a sintax error
if (in_array($ex, $selected) --- missing )
echo br /yes;
else echo br /no;
On Thu, Jun 18, 2009 at 10:13 AM, PJ af.gour...@videotron.ca
mailto:af.gour...@videotron.ca wrote:
Ford, Mike wrote:
On 17 June 2009 14:30, PJ advised:
2009/6/18 PJ af.gour...@videotron.ca:
Martin Scotta wrote:
It is a sintax error
if (in_array($ex, $selected) --- missing )
echo br /yes;
else echo br /no;
On Thu, Jun 18, 2009 at 10:13 AM, PJ af.gour...@videotron.ca
mailto:af.gour...@videotron.ca wrote:
Ford, Mike wrote:
On
Stuart wrote:
2009/6/18 PJ af.gour...@videotron.ca:
Martin Scotta wrote:
It is a sintax error
if (in_array($ex, $selected) --- missing )
echo br /yes;
else echo br /no;
On Thu, Jun 18, 2009 at 10:13 AM, PJ af.gour...@videotron.ca
mailto:af.gour...@videotron.ca wrote:
On 16 June 2009 20:48, PJ advised:
Now, I was happy to learn that it is simpler to populate the
insert new
books page dynamically from the db. Much shorter neater.
It looks to me like the best solution for the edit page is
close to what
Yuri suggests.
Since the edit page is very similar
:16:15 +0100
From: m.f...@leedsmet.ac.uk
To: php-general@lists.php.net
Subject: RE: [PHP] populate form input option dropdown box from existing data
On 16 June 2009 20:48, PJ advised:
Now, I was happy to learn that it is simpler to populate the
insert new
books page dynamically from
-0400
From: af.gour...@videotron.ca
To: a...@ashleysheridan.co.uk
CC: gargari...@hotmail.com; m...@dajve.co.uk; php-general@lists.php.net;
tedd.sperl...@gmail.com; nos...@mckenzies.net
Subject: Re: [PHP] populate form input option dropdown box from
existingdata
Ashley Sheridan
Ashley Sheridan wrote:
On Tue, 2009-06-16 at 20:46 -0400, PJ wrote:
Ashley Sheridan wrote:
On Tue, 2009-06-16 at 18:19 -0400, PJ wrote:
Ashley Sheridan wrote:
On Tue, 2009-06-16 at 15:48 -0400, PJ wrote:
jenai tomaka wrote:
Ford, Mike wrote:
On 16 June 2009 20:48, PJ advised:
Now, I was happy to learn that it is simpler to populate the
insert new
books page dynamically from the db. Much shorter neater.
It looks to me like the best solution for the edit page is
close to what
Yuri suggests.
Since the edit
On Wed, 2009-06-17 at 10:01 -0400, PJ wrote:
Ford, Mike wrote:
On 16 June 2009 20:48, PJ advised:
Now, I was happy to learn that it is simpler to populate the
insert new
books page dynamically from the db. Much shorter neater.
It looks to me like the best solution for the edit page
PJ wrote:
It does, indeed. This confirms my inexperienced conclusion that
in_array() does not work on associative arrays per se; it works on
simple arrays and I just don't have the experience to think of
extracting only the id fields.
I actually am using a slightly more complicated if else
Ashley Sheridan wrote:
On Wed, 2009-06-17 at 10:01 -0400, PJ wrote:
Ford, Mike wrote:
On 16 June 2009 20:48, PJ advised:
Now, I was happy to learn that it is simpler to populate the
insert new
books page dynamically from the db. Much shorter neater.
It looks to me like
PJ wrote:
Ashley Sheridan wrote:
On Wed, 2009-06-17 at 10:01 -0400, PJ wrote:
Ford, Mike wrote:
On 16 June 2009 20:48, PJ advised:
Now, I was happy to learn that it is simpler to populate the
insert new
books page dynamically from the db. Much shorter neater.
It looks
On Wed, 2009-06-17 at 16:29 -0400, PJ wrote:
Ashley Sheridan wrote:
On Wed, 2009-06-17 at 10:01 -0400, PJ wrote:
Ford, Mike wrote:
On 16 June 2009 20:48, PJ advised:
Now, I was happy to learn that it is simpler to populate the
insert new
books page dynamically
'], /optionbr /;
}
}
I think it will work now. Thanks much for the input the support. :-)
Date: Wed, 17 Jun 2009 10:16:15 +0100
From: m.f...@leedsmet.ac.uk
To: php-general@lists.php.net
Subject: RE: [PHP] populate form input option dropdown box from existing data
Shawn McKenzie wrote:
PJ wrote:
Ashley Sheridan wrote:
On Wed, 2009-06-17 at 10:01 -0400, PJ wrote:
Ford, Mike wrote:
On 16 June 2009 20:48, PJ advised:
Now, I was happy to learn that it is simpler to populate the
insert new
books page dynamically from the db. Much shorter neater.
It
Oops, hit reply instead of reply to all. Sorry for the duplicate PJ.
2009/6/17 PJ af.gour...@videotron.ca:
Shawn McKenzie wrote:
PJ wrote:
Ashley Sheridan wrote:
On Wed, 2009-06-17 at 10:01 -0400, PJ wrote:
Ford, Mike wrote:
On 16 June 2009 20:48, PJ advised:
Now, I was happy to learn
I snipped to make it short... continue at bottom...
Step back from the code and consider the steps you need to perform...
1) Get an array of the categories, ideally in the form $cats[catid]
= categoryname.
2) Get an array of the category IDs that should be selected, i.e.
$selectedcats =
2009/6/18 PJ af.gour...@videotron.ca:
I snipped to make it short... continue at bottom...
Step back from the code and consider the steps you need to perform...
1) Get an array of the categories, ideally in the form $cats[catid]
= categoryname.
2) Get an array of the category IDs that should
-Original Message-
From: PJ [mailto:af.gour...@videotron.ca]
Sent: 15 June 2009 23:10
To: php-general@lists.php.net
Subject: [PHP] populate form input option dropdown box from existing data
I am having difficulties figuring out how enter retrieved data into a
dropdown box for
the above post points to a 404 page
any ways
as suggested above in_array() will do the trick for you.
i prefer using a template engine like smarty..
http://www.smarty.net/manual/en/language.function.html.options.php
One line of code and you are done
--
PHP General Mailing List
] populate form input option dropdown box from existing data
-Original Message-
From: PJ [mailto:af.gour...@videotron.ca]
Sent: 15 June 2009 23:10
To: php-general@lists.php.net
Subject: [PHP] populate form input option dropdown box from existing data
I am having difficulties
At 6:09 PM -0400 6/15/09, PJ wrote:
I am having difficulties figuring out how enter retrieved data into a
dropdown box for editing. Here's a snippet:
...snip
select name=categoriesIN[] multiple size=8
option value=1Civilization/option
option value=2Monuments, Temples amp;
...@dajve.co.uk; af.gour...@videotron.ca; php-general@lists.php.net
Subject: RE: [PHP] populate form input option dropdown box from existing
data
You can try like this,
$row = stored data;
and write the options like this
option value=id (id == $row ? selected : ) /option
Yuri Yarlei
A *multiple* select control, as in Phil's initial request will return an
array, however.
-Original Message-
From: tedd [mailto:tedd.sperl...@gmail.com]
Sent: 16 June 2009 15:58
To: PJ; php-general@lists.php.net
Subject: Re: [PHP] populate form input option dropdown box from existing
jenai tomaka wrote:
You can try like this,
$row = stored data;
and write the options like this
option value=id (id == $row ? selected : ) /option
Yuri Yarlei.
http://brasil.microsoft.com.br/IE8/mergulhe/?utm_source=MSN%3BHotmailutm_medium=Taglineutm_campaign=IE8
Yuri, I'm still
On Tue, 2009-06-16 at 15:48 -0400, PJ wrote:
jenai tomaka wrote:
You can try like this,
$row = stored data;
and write the options like this
option value=id (id == $row ? selected : ) /option
Yuri Yarlei.
Ashley Sheridan wrote:
On Tue, 2009-06-16 at 15:48 -0400, PJ wrote:
jenai tomaka wrote:
You can try like this,
$row = stored data;
and write the options like this
option value=id (id == $row ? selected : ) /option
Yuri Yarlei.
On Tue, 2009-06-16 at 18:19 -0400, PJ wrote:
Ashley Sheridan wrote:
On Tue, 2009-06-16 at 15:48 -0400, PJ wrote:
jenai tomaka wrote:
You can try like this,
$row = stored data;
and write the options like this
option value=id (id == $row ? selected : ) /option
Ashley Sheridan wrote:
On Tue, 2009-06-16 at 18:19 -0400, PJ wrote:
Ashley Sheridan wrote:
On Tue, 2009-06-16 at 15:48 -0400, PJ wrote:
jenai tomaka wrote:
You can try like this,
$row = stored data;
and write the options like this
option value=id
Ashley Sheridan wrote:
On Tue, 2009-06-16 at 18:19 -0400, PJ wrote:
Ashley Sheridan wrote:
On Tue, 2009-06-16 at 15:48 -0400, PJ wrote:
jenai tomaka wrote:
You can try like this,
$row = stored data;
and write the options like this
option value=id
On Tue, 2009-06-16 at 20:46 -0400, PJ wrote:
Ashley Sheridan wrote:
On Tue, 2009-06-16 at 18:19 -0400, PJ wrote:
Ashley Sheridan wrote:
On Tue, 2009-06-16 at 15:48 -0400, PJ wrote:
jenai tomaka wrote:
You can try like this,
$row = stored
37 matches
Mail list logo