Session Question
Posted: Sun Jul 11, 2004 8:49 pm
Hi,
I'm trying to set a session value based on a row value - but when I set it and call the value from within another page, I'm not getting the correct row value.
Here's my code from where I'm setting the session value:
Here's my code to call the values based on the session value from the results page:
I'm getting a result, so I know its not a syntax problem - but the issue is that the session value doesn't seem to change no matter what row I select.
Is there a better way to do what I'm trying to do? Given that I'm a total newbie, I'm sure that there is
Thanks!
I'm trying to set a session value based on a row value - but when I set it and call the value from within another page, I'm not getting the correct row value.
Here's my code from where I'm setting the session value:
Code: Select all
<?php
while ($row=@mysql_fetch_array($result))
{ ?>
<tr>
<td style="border:1px solid rgb(75, 29, 121);"><h1><?php echo $row['eventDate'];?></h1></td>
<td style="border:1px solid rgb(75, 29, 121);"><?php $_SESSION['eventName']=$row['eventName'];?><a href="eventdetails.php"><h2><?php echo $row['eventName'];?></h2></a></td>
<td style="border:1px solid rgb(75, 29, 121);"><h1><?php echo $row['eventLocation'];?></h1></td>
</tr><?php
}
?>Code: Select all
<?php
include ("Connections/ccaa.php");
$eventName = $_SESSION['eventName'];
$query = "SELECT * FROM events_tb WHERE eventName = '$eventName'";
$result = mysql_query ($query);
$row = mysql_fetch_array ($result);
?>Is there a better way to do what I'm trying to do? Given that I'm a total newbie, I'm sure that there is
Thanks!