Jump to content

Edit History

Chill_user

Chill_user

Hello, here is my code:

$result = Db::getInstance()->getRow('
                        SELECT `id_category`
                        FROM `'._DB_PREFIX_.'category_group` 
                        WHERE `id_category` = '.$id_category'
                        AND `id_group` = '.$id_customer'
                        ');

But I have an error! If I delete 'AND' statement line, all is working (valid code)

Tried to send this request with "Advanced Parameters -> Database -> SQL" and all is working well! (of course I changed $id_category and $id_customer for numbers)

What is the problem with code?

Chill_user

Chill_user

Hello, here is my code:

$result = Db::getInstance()->getRow('
                        SELECT `id_category`
                        FROM `'._DB_PREFIX_.'category_group` 
                        WHERE `id_category` = '.$id_category'
                        AND `id_group` = '.$id_customer'
                        ');

But I have an error! If I delete 'AND' statement line, all is working (valid code)

Tryed to send this request with "Advanced Parameters -> Database -> SQL" and all is working well! (of course I changed $id_category and $id_customer for numbers)

What is the problem with code?

×
×
  • Create New...