ok guys and girls so ive been working on a project for school all day today and the one thing thats is giving me major dramas is a session variable to display a customers name.
basically a customer logs in for access to the site by using there email and password, then on the next page i want to store their name as a variable,
but in order to do that i must first make a quiry to the server
<?php
$colname_rsName = "-1";
if (isset($_SESSION['MM_Username'])) {
$colname_rsName = $_SESSION['MM_Username'];
}
mysql_select_db($database_sim5, $sim5);
$query_rsName = sprintf("SELECT custName FROM customer WHERE email = %s", GetSQLValueString($colname_rsName, "text"));
$rsName = mysql_query($query_rsName, $sim5) or die(mysql_error());
$row_rsName = mysql_fetch_assoc($rsName);
$totalRows_rsName = mysql_num_rows($rsName);
$_SESSION['Name'] = $row_rsName['custName'];
//Store txtLogEmail into a query then back into a Session
?>
rsName is my record set.
as you can see i have tried setting the variable
$_SESSION['Name'] = $row_rsName['custName'];
so with all that done i then move onto making that a set session
<?php
session_start();
$_SESSION['Name'];
?>
but its not displaying on any other pages when i
<?php echo $_SESSION['Name']; ?>
if someone could help me that would be awesome
also let me know if more info is needed