Forum Moderators: coopster
if I comment the phone echo, then its value dies below
if ($id_results!=$id etc....
As a direct result if I echo the final sql nothing's happening
but I re-pass $phone as a session or simply as an echo (below the if($id_results.....)
then all cranks on OK
I do not understand the reason?
// the section I ref to:
while($row = mysql_fetch_array($result))
{
$id_results=$row['id'];
$phone_results=$row['phone'];
$name_results=$row['name'];
}
// As you see I echo the $phone value (not related to that "While" it's OK!)
// so I should have that value active and existing
/*
echo"phone: $phone<p>";
*/
if ( $id_results!=$id && $phone_results == $phone)
$phone=$_SESSION['phone'];
//echo"phone: $phone";
// A new user (ID) but same location so we insert its details in rating_results
{
$time_in=time();
$vote="1";
$conn=db_connect();
$head_cate_id=CleanDb($head_cate_id);
$head_category=CleanDb($head_category);
$sub_cate_id=CleanDb($sub_cate_id);
$sub_cate_title=CleanDb($sub_cate_title);
$name=CleanDb($name);
$phone=CleanDb($phone); //echo"phone: $phone";
// lot of things happening such as math about time in, avaraging rating with existing rating etc..
and a final update
$sql= etc...
if I simply echo it as a var or as a session then the rest of the script grabs it and the whole thing works
BUT this value is already there (from an above section of the script) it exists as session passed via an included file.
why below the if line the script does not get it
it's like if as soon as below the if line its value vanishes?