Jump to content


Photo

textbox array problem


  • Please log in to reply
2 replies to this topic

#1 NorthWind

NorthWind
  • Members
  • PipPip
  • Member
  • 10 posts

Posted 17 May 2006 - 06:41 AM

$num=0;
                while ($row = @mssql_fetch_array($result3)) 
                    {
                    $num++;
                                                                                $itemCode=$row["itemCode"];
                                                                                $description_query = "SELECT * FROM Inventory where itemCode = '$itemCode'";
                    $description_result = mssql_query($description_query, $link);
                    $description_row = @mssql_fetch_array($description_result);
                    $description=$description_row["description"];
$serial=$row["serial"];
echo "<tr align='left'>";
echo"            <td><input name='no[]' type='text' id='no1' size='3' value=$num></td>";
                    echo"            <td><input name='description[]' type='text' id='description' size='70' value=$description></td>";
                    echo"            <td><input name='serial[]' type='text' id='serial' value=$serial></td>";

ok this is my code. the problem is, im pulling stuff off the db and listing them 1 by 1 in text boxes. so i used txtbox arrays. the problem is when i try to pull and list data which has two or more words in it (like field name has John Doe), the code just shows John. The array doesnt get the whole thing.
Is there a way to make the array show all? Thanks


#2 samshel

samshel
  • Members
  • PipPipPip
  • Advanced Member
  • 837 posts

Posted 17 May 2006 - 06:56 AM

try

value="$num"

instead of

value=$num

in textbox tag

similarly for all textboxes...

hth
Cheers,
SamShel
-----------------------------------------------
--: FUTURE IS LINUX :--
-----------------------------------------------

#3 NorthWind

NorthWind
  • Members
  • PipPip
  • Member
  • 10 posts

Posted 17 May 2006 - 07:00 AM

thank u Samuel it worked like magic ;)

[!--quoteo(post=374580:date=May 17 2006, 02:56 PM:name=samshel)--][div class=\'quotetop\']QUOTE(samshel @ May 17 2006, 02:56 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
try

value="$num"

instead of

value=$num

in textbox tag

similarly for all textboxes...

hth
[/quote]





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users