I have a question about the following

$LoadResult = mysql_query("SELECT * from Items where username='test' and
password='test'");

 $num_results =mysql_num_rows($LoadResult);
 for ($i=0; $i < $num_results;$i++) {
    $myrow = mysql_fetch_array($LoadResult, MYSQL_ASSOC);
    $ProductName = $myrow["ProductName"];
    $Quantity = $myrow["Quantity"];


    $$ProductName = $Quantity; [1]
    $HTTP_SESSION_VARS[$ProductName] = $Quantity; [2]
    session_register("$ProductName"); [3]
 }


/*END CODE*/
so what I want to do is through the query result, create new session
varaibles, where the name of the variable is $ProductName and whose value is
$Quantity.

for some reason if  I just have lines [2] and [3] then the session variables
are present, but once the page is reloaded/refreshed they are gone. However
if I have lines [1] and [3], then my code can't access the session variables
(through calls to $HTTP_SEESION_VARS) until the page is refreshed. It seems
odd that I have to write lines [1] AND [2] to make the code work. They seem
symantically correct.

Thanks in Advance,
Anup





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

Reply via email to