Re: Viewing checkbox data with MySQL and PHP

From: Paul Barfoot (Paul_at_theglobalfamily.fsworld.co.uk)
Date: 10/12/04


Date: Tue, 12 Oct 2004 16:09:43 +0100

Hi Bee

Try using print_r($check) to view the contents of the $check array or try:

foreach ($check as $value) {
    echo $value;
}

If the output of echo $value is still an array, loop through the $value
array as well.

foreach ($check as $value) {
   foreach ($value as $innervalue) {
    echo $innervalue;
   }
}

-- 
Paul Barfoot
"Bee" <namanhvu@gmail.com> wrote in message 
news:6270e2f1.0410120017.6d809dc@posting.google.com...
>> Try:
>> echo $checkbox['CHECKBOX'];
>>
>> If that prints the string that you have in the database, you have
>> problem in php side, if you prints something else, you have problem on
>> sql side.
>
> Thanks for replying.
>
> I did try this and it printed out the strings in my database. So
> therefore its a problem on the PHP side, as you commented. The thing
> is, I cannot find out what the problem is i.e. why the output of each
> string in the database is "Array" when I process the following:
>
> $check = unserialize($checkbox['CHECKBOX']);
> //code to loop array...
>     echo $check;
>
> Any ideas are very welcome...(please!)
>
> TIA.
>
> Bee. 


Relevant Pages

  • Re: Whats wrong the the logic in this code?
    ... If the posted value is either the key or value of an array, ... ##echo $search here outputs the new value, ... ORDER BY '$sort' ASC"; ... You're problem is you are setting $q each time through the loop, then using it outside of the loop. ...
    (comp.lang.php)
  • Re: Inserting multiple records
    ... array of values, how would this go? ... > You can turn it into a single call to the database by constructing a union ... > dim sSQL, sUnion ... > 'start loop ...
    (microsoft.public.inetserver.asp.db)
  • Re: Whats wrong the the logic in this code?
    ... If the posted value is either the key or value of an array, ... ##echo $search here outputs the new value, ... ORDER BY '$sort' ASC"; ... You're problem is you are setting $q each time through the loop, then using it outside of the loop. ...
    (comp.lang.php)
  • Re: [opensuse] bash - why doesnt the tldp bash beginners guide for loop example work?
    ... I have run into a bash problem with a simple for loop I don't ... The echo statement showed that $i was receiving the ... I personally like to use array variables in BASH scripting. ... lists to operate on. ...
    (SuSE)
  • Re: need some help with this solution...
    ... Open said file with fopen(Where does fgets() come into play. ... Once I get the array I think i'll be good. ... echo "File has been stored in the database!\n"; ... in the database just like it is on the text document. ...
    (alt.php)