Home » Php » php – How do i fix this query

php – How do i fix this query

Posted by: admin February 25, 2020 Leave a comment

Questions:

Im getting the following error

Error in query select u.*,a.company_name,a.status as account_status,a.start_date,a.end_date from table_web_users as u left join table_account as a on u.account_id=a.account_id WHERE u.password=” and u.username=” and u.status=’A’ and u.start_date<=’2020-02-13′ and u.end_date>=’2020-02-13′

enter image description here

 $auRec=$_objAdmin->_getSelectList2('table_web_users as u left join 
 table_account 
 as a on u.account_id=a.account_id',"  u.*,a.company_name,a.status as 
 account_status,a.start_date,a.end_date",''," 
 u.password='".mysqli_escape_string(md5($_POST['txtPass']))."' and 
 u.username='".strtolower(mysqli_escape_string($_POST['txtName']))."' and 
 u.status='A' and u.start_date<='".$date."' and u.end_date>='".$date."' ");
    echo $user_type=$auRec[0]->user_type;



    // for company salesman distributor,retailer.
    if($user_type!='0')
    {
     $auRec=$_objAdmin->_getSelectList2('table_web_users as u left join 
table_account as a on u.account_id=a.account_id',"  
u.*,a.company_name,a.status as account_status,a.start_date,a.end_date",''," 
u.password='".mysqli_escape_string(md5($_POST['txtPass']))."' and 
u.username='".strtolower(mysqli_escape_string($_POST['txtName']))."' and 
u.status='A' and a.start_date<='".$date."' and a.end_date>='".$date."' ");
How to&Answers: