Sending multiple items via a single form field

Sending multiple items via a single form field

am 14.11.2005 21:40:53 von Chris Payne

------=_NextPart_000_0002_01C5E931.CCD18680
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit

Hi there everyon,



I have a set of form fields dynamically generated but each item must contain
2 pieces of data - the input from the field AND the id that the input
represents from the DB. I had this info a while back but had a major HD
crash and lost the info I had, how can I do this easily in PHP?



Hopefully an easier to understand scenario:



I have a form with - example - 5 items listed, each item from the DB and you
select ONE item only out of the list, when you submit the form it sends the
input from the field you select BUT I also need it to send an addition bit
of info in the form of $id so that on the processing page, I can extract
both the ID and the data entered from a single field. Obviously I can't use
a hidden field for this so the data has to be tacked-on to the input field
somehow?



Any help would save my life :-)



Chris


------=_NextPart_000_0002_01C5E931.CCD18680--

Re: Sending multiple items via a single form field

am 14.11.2005 21:58:34 von Micah Stevens

You could just seperate the data in the field's value with a delimeter like |
or something you wouldn't see in the data, then explode() based on that?

What kind of field are you using? Your explanation is very vague.

On Monday 14 November 2005 12:40 pm, Chris Payne wrote:
> Hi there everyon,
>
>
>
> I have a set of form fields dynamically generated but each item must
> contain 2 pieces of data - the input from the field AND the id that the
> input represents from the DB. I had this info a while back but had a major
> HD crash and lost the info I had, how can I do this easily in PHP?
>
>
>
> Hopefully an easier to understand scenario:
>
>
>
> I have a form with - example - 5 items listed, each item from the DB and
> you select ONE item only out of the list, when you submit the form it sends
> the input from the field you select BUT I also need it to send an addition
> bit of info in the form of $id so that on the processing page, I can
> extract both the ID and the data entered from a single field. Obviously I
> can't use a hidden field for this so the data has to be tacked-on to the
> input field somehow?
>
>
>
> Any help would save my life :-)
>
>
>
> Chris

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Sending multiple items via a single form field

am 14.11.2005 22:59:06 von Miles Thompson

At 04:40 PM 11/14/2005, Chris Payne wrote:
>Hi there everyon,
>
>I have a set of form fields dynamically generated but each item must contain
>2 pieces of data - the input from the field AND the id that the input
>represents from the DB. I had this info a while back but had a major HD
>crash and lost the info I had, how can I do this easily in PHP?
>
>Hopefully an easier to understand scenario:
>
>I have a form with - example - 5 items listed, each item from the DB and you
>select ONE item only out of the list, when you submit the form it sends the
>input from the field you select BUT I also need it to send an addition bit
>of info in the form of $id so that on the processing page, I can extract
>both the ID and the data entered from a single field. Obviously I can't use
>a hidden field for this so the data has to be tacked-on to the input field
>somehow?
>
>
>Any help would save my life :-)
>
>Chris

You mean like this:

In the display area of the script, using the ubiquitous while $myrow =
mysql_fetch_array($result), sub_key being the SUBscriber_KEY :

print( '');
// rest of record - name, etc., then repeat

and as I was using this for a bulk delete, up top in the processing section:

//
// Bulk Delete
//
if ($chkdelete && $bulkdelete){
foreach ($chkdelete as $value){
$sql = "delete from subscriber where sub_key = '$value'";
$result = mysql_query($sql);
}
echo "

Selected Records deleted!

";
}

HTH -Miles Thompson

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Sending multiple items via a single form field

am 30.01.2006 12:07:32 von Hayri

can somebody tell me what the hell does mysql_fetch_assoc do ???

thx

Micah Stevens schrieb:
>
> You could just seperate the data in the field's value with a delimeter like |
> or something you wouldn't see in the data, then explode() based on that?
>
> What kind of field are you using? Your explanation is very vague.
>
> On Monday 14 November 2005 12:40 pm, Chris Payne wrote:
>
>>Hi there everyon,
>>
>>
>>
>>I have a set of form fields dynamically generated but each item must
>>contain 2 pieces of data - the input from the field AND the id that the
>>input represents from the DB. I had this info a while back but had a major
>>HD crash and lost the info I had, how can I do this easily in PHP?
>>
>>
>>
>>Hopefully an easier to understand scenario:
>>
>>
>>
>>I have a form with - example - 5 items listed, each item from the DB and
>>you select ONE item only out of the list, when you submit the form it sends
>>the input from the field you select BUT I also need it to send an addition
>>bit of info in the form of $id so that on the processing page, I can
>>extract both the ID and the data entered from a single field. Obviously I
>>can't use a hidden field for this so the data has to be tacked-on to the
>>input field somehow?
>>
>>
>>
>>Any help would save my life :-)
>>
>>
>>
>>Chris

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

storing unicode characters in mysql database

am 30.01.2006 12:27:52 von Naintara

Hi,

I'd like to know what would be the best way to store Unicode text in a
database. I am using MySQL 4.1.
I am trying to create a multi-lingual CMS and the browser charset is set to
utf-8 and the database and tables are set to UTF8 and utf8_bin for charset
and collation.

While displaying in the browser, Thai text is displayed correctly but it is
stored as html code in the database.
Is this correct behaviour or is there a better way?

--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.375 / Virus Database: 267.14.23/243 - Release Date: 27-Jan-06


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Sending multiple items via a single form field

am 30.01.2006 16:43:20 von John in Pueblo

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hayri wrote:
> can somebody tell me what the hell does mysql_fetch_assoc do ???
>
> thx

It fetches a row of a result as an associative array (hash), the same as
mysql_fetch_array($retval,MYSQL_ASSOC).
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFD3jQXj60GAoLuoDkRApiYAJ9hX2U/hMQWHSZ8EXK06ish5ok+EQCf VJNL
UY4uxvuPcxF5AaZjDIGUYOg=
=9tyr
-----END PGP SIGNATURE-----

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: Sending multiple items via a single form field

am 30.01.2006 16:46:47 von Bastien Koert

RTFM www.php.net/mysql-fetch-assoc

bastien


>From: Hayri
>To: php-db@lists.php.net
>Subject: Re: [PHP-DB] Sending multiple items via a single form field
>Date: Mon, 30 Jan 2006 12:07:32 +0100
>
>can somebody tell me what the hell does mysql_fetch_assoc do ???
>
>thx
>
>Micah Stevens schrieb:
>>
>>You could just seperate the data in the field's value with a delimeter
>>like | or something you wouldn't see in the data, then explode() based on
>>that?
>>
>>What kind of field are you using? Your explanation is very vague.
>>
>>On Monday 14 November 2005 12:40 pm, Chris Payne wrote:
>>
>>>Hi there everyon,
>>>
>>>
>>>
>>>I have a set of form fields dynamically generated but each item must
>>>contain 2 pieces of data - the input from the field AND the id that the
>>>input represents from the DB. I had this info a while back but had a
>>>major
>>>HD crash and lost the info I had, how can I do this easily in PHP?
>>>
>>>
>>>
>>>Hopefully an easier to understand scenario:
>>>
>>>
>>>
>>>I have a form with - example - 5 items listed, each item from the DB and
>>>you select ONE item only out of the list, when you submit the form it
>>>sends
>>>the input from the field you select BUT I also need it to send an
>>>addition
>>>bit of info in the form of $id so that on the processing page, I can
>>>extract both the ID and the data entered from a single field. Obviously
>>>I
>>>can't use a hidden field for this so the data has to be tacked-on to the
>>>input field somehow?
>>>
>>>
>>>
>>>Any help would save my life :-)
>>>
>>>
>>>
>>>Chris
>
>--
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php