$db2= mysql_connect("localhost","aaa","1111");
mysql_query("SET NAMES UTF8");
$db4= mysql_connect("localhost","bbb","222");
mysql_query("SET NAMES UTF8");
$objQuery = mysql_query("SELECT * FROM db_car_stock.car_stock AS a
INNER JOIN qcss.repair AS b ON a.car_stock_id=b.idcarstock
INNER JOIN qcss.service_center AS c ON b.idservice=c.idservice
INNER JOIN qcss.status_repair AS d ON b.idstatus=d.idstatus where a.car_stock_regis LIKE '%$q%'" );
$num=mysql_num_rows($objQuery);