Hey guys, I have a quick question
How do I add two WHERE statements? I used this code and it seems to output a error.
CODE:
$query_Props = "SELECT * FROM p_Sales WHERE datatable = 'c_4Sale' AND `user` = $username ORDER BY id ASC";
ERROR:
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '* ORDER BY id ASC' at line 1
Now the $username is a variable that calls a function.
$username = username();
And this is the function
if($row_name['level'] != 'Admin')
{
function username(){
return '"'.$row_name['id'].'"';
}
}
else
{
function username(){
return "*";
}
}
Any ideas?
Thanks & God Bless