<td width="33%" align="center"><?php echo $HTTP_SESSION_VARS['stock'];?><br>
</td>
<td width="67%" align="center"><?php require('test.php');?></td>
Ok that little snippet of code asks php to display my session variable "stock". Which it does quite nicely and then i try and display test.php witht he contents
//Next table Consumable information
mysql_select_db('cms');
// Run query to get all inforation
$result = @mysql_query("SELECT id, name, price, order_number FROM stock
where ID=".$HTTP_SESSION_VARS[stock]);
if (!$result) {
echo("<p>Error performing query: " . mysql_error() . "</p>");
exit();
}
// Put information from query in relelvent variables
while ( $row = mysql_fetch_array($result) ) {
$id = $row["id"];
$name = $row["name"];
$price = $row["price"];
$order_number = $row["order_number"];
}
echo $name;
Now this works if i explicitly declare the session variable
i.e $_session['stock'] = "2";
but if i want to use the session variable thats in the memory it jsut doesnt work although in the cell before this happens it does? WTF is up with that any help appreciated..
The error i get is undefined variable name as if the query hasnt ran
/matt