I have this query and I want to look at the Name field and get only the result where name field matches the name in the session
the session is $_Session['userb'] and gives me names like John Devon etc
the problem is that even though I have John Devon in my database in the Name field, it doesn't show me any records and it says 0 records.
I think I am doing something wrong in this query and may be it is not taking the name string correctly
Anyhelp will be appreciated.
$users = $_SESSION['userb'];
$nuser = "Name= ".$users;
$sql = "SELECT ID, `Name`, `Phone`, `Email`, `ipaddress`, `completed`, `City`, `Training`, `Date`, FROM `Table1` where '".$nuser."' ";
if (isset($order) && $order!='') $sql .= " order by `" .sqlstr($order) ."`";
if (isset($ordtype) && $ordtype!='') $sql .= " " .sqlstr($ordtype);
$res = mysql_query($sql, $conn) or die("error users " .mysql_error());