怎么写whmcs内部加入'where condition'

时间:2014-02-27 03:52:56

标签: php mysql whmcs

whmcs内部联接'where condition',

两个表都有相同的字段。

如何在哪里区分表名?

试过这个,

$table = "tblclients";
$fields = "id,firstname,lastname,domain";
$where = array(
   "lastname"=>array("sqltype"=>"LIKE","value"=>"Demo"),
   "companyname"=>array("sqltype"=>"NEQ","value"=>""),
);
$sort = "id";
$sortorder = "ASC";
$limits = "0,5";
$join = "tblhosting ON tblhosting.userid=tblclients.id";
$result = select_query($table,$fields,$where,$sort,$sortorder,$limits,$join);

如何在where where condition中指定表名?

1 个答案:

答案 0 :(得分:1)

$where = array(
   "table1.lastname"=>array("sqltype"=>"LIKE","value"=>"Demo"),
   "table2.companyname"=>array("sqltype"=>"NEQ","value"=>""),
);