ok....remember when i was trying to get the persons log in name to print to the screen after they logged in to show that they were logged in...what i did was i went to the original login script and saw this
Code: Select all
if($row)
{
$_SESSION['auth']="yes";
$_SESSION['logname'] = mysqli_real_escape_string($cxn,$_POST['fusername']);
header("Location: $next_program?user='.$user_name");
}
i couldent figure out why php wasnt displaying the user log in name when i used the variable 'fusername' or the
variable '$user_name' after the user loged in so i tried 'logname' and it worked fine....so i wanted to attempt to
print the address city state and phone from that same user to the page...in another program i did something like this
Code: Select all
<?php
// open the connection
$conn = mysql_connect("localhost", "root", "yea....isuck");
// database in use
mysql_select_db("testDB",$conn);
// create the SQL statement
$sql = "SELECT * FROM testTable";
//execute the SQL statement
$result= mysql_query($sql,$conn) or die(mysql_error());
// go through each row and display the result
while($newArray = mysql_fetch_array($result)){
// give a name to the fields
$id = $newArray['id'];
$testField = $newArray['testField'];
// echo the results on screen
echo "the ID is $id and the text is $testField<br>";
}
?>
and i just got a pretty neat idea from the suggestion you gave me, my book, and this example....im gonna try it out and post back