PHP and not right values?

  • Thread starter Thread starter evachick156
  • Start date Start date
E

evachick156

Guest
I have the following code:
$Query3 = "SELECT id FROM table WHERE...........";
$result3 = mysql_query($Query3);

while($rows3 = mysql_fetch_assoc($result3))
{
$id = "" . $rows3['id'] . "/";
}
So $id if echoed would look like "1/2/";

Now if i were to put it in a hidden variable like example:
echo "<input type=hidden name=\"" . $row['id'] . "_allIDs\" id=\"" . $row['id'] . "_allIDs\" value=\"" . $id . "\">";

But when i later acknowledge it in a javascript function, and view it in alert boxes all i see is:
2
blank
undefined

Not sure why there is a third one, but its supposed to show me
1
2

Please help
I see what is wrong now. Everytime i try to put those two ID's inside the variable $id, i ECHOED it outside the loop and the value is 2 (the last one) How do i get all the ID numbers inside this variable? Like this: "1/2/"
 
Back
Top