i made a class connection that will handle the query also then return all the data needed from the database :
the problem is how can define a variable within the query that will handle one value that i want to insert it in the same query !!
$invoice_connection_add = new connection("
SET @myvar := select `brand_name` from `brands` where `brand_code` = $_POST[brand_code]
insert into `invoices` (`brand_code`, `brand_name`, `quantity`, `price`,`date`, `salesman`) values ('$_POST[brand_code]',@myvar, '$_POST[quantity]', '$_POST[price]', '$_POST[date]', '$_SESSION[username]');","insert_update");