Hi, I am needing urgently to resolve the following problem: Once I get a single record from a MSSQL table, I cannot have that record information available in all pages I want...
Page 1:
I have a drop down list within a form where the user selects a person.
Page 2:
Receives the information from the form without problems and now I can search the database using the code of the selected person. Once found, I have the record information with phone, address, zip code, etc. Then I need the phone, address, zip code, etc. available in many other pages...
<?
session_start();
$choice=$_POST['env_s2'];
include("functions.php");
connect();
$query1 = mssql_query ("SELECT * FROM Friends WHERE Friend_Code = '$choice'") or die ("Invalid query 1");
$num_of_rows = mssql_num_rows ($query1);
if ($num_of_rows == 0)
{
echo "Error...";
}
else
{
while($row=mssql_fetch_array($query1))
{
echo "<B>".$row['Friend_Phone']."</B>";
if (!session_is_registered('s_Friend_Phone'))
{
$_SESSION['s_Friend_Phone']= $row['Friend_Phone'];
}
}
}?>
I have already tried many things like assigning $row['Friend_Phone'] to an standard variable:
$F_P= $row['Friend_Phone'];
$_SESSION['s_Friend_Phone']=$F_P;
etc, etc.
Page 3: When I check to see if I still have the phone information in a separate page, I get a blank phone number.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<META http-equiv="content-type" content="text/html; charset=windows-1250">
<META name="generator" content="PSPad editor, www.pspad.com">
<TITLE>
</TITLE>
</HEAD>
<BODY BGCOLOR="#FFCC00">
<?
session_start();
echo "Phone: ".$_SESSION['s_Friend_Phone'];
?>
</BODY>
</HTML>
Hope I am clear...
I am using a Windows server with PHP 4.4.2 and MS-SQL
PLEASE! I need your help ASAP!
Thank you in advance