renfley Posted May 29, 2013 Share Posted May 29, 2013 Hey guys i need some help!! when someone logs in i create a session called $_SESSION['username'] i want to display only ticket that the logged in user owns $data = mysql_query("SELECT * FROM tickets where owner_id='$_SESSION['username']'") or die(mysql_error()); But im not sure my syntax is correct anyone care to help me out? Link to comment https://forums.phpfreaks.com/topic/278502-need-help-with-proper-sql-syntax-for-where/ Share on other sites More sharing options...
Barand Posted May 29, 2013 Share Posted May 29, 2013 Does mysql_error() say you have a syntax error? Link to comment https://forums.phpfreaks.com/topic/278502-need-help-with-proper-sql-syntax-for-where/#findComment-1432837 Share on other sites More sharing options...
ginerjm Posted May 29, 2013 Share Posted May 29, 2013 assign the session val to a regular php val OR wrap it inside {} Link to comment https://forums.phpfreaks.com/topic/278502-need-help-with-proper-sql-syntax-for-where/#findComment-1432968 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.