mysql - PHP add multiple JOIN method in function -
i have function fetch catid , typeid mysql database.
function _is_type_($id,$type){ $db = mysqli_access::f("select catid,typeid " . catsgroup . " postid = ? , typeid = ?", $id, $type); foreach($db $row){ $catsdata[] = $row; } return $catsdata; } catsgroup table:(insert each post catid , typeid)
|id| catsid | typeid | postid | i have another 2 table cats name , type name :
cats name table:
|id|cat_name| type table:
|id|type_name| now in action need show/print name of catid , typeid table. know, can add php join method in function don't know how can i?! how generate result (show name o cats , type) using join method function?
now
i don't think require join in case need fetch data 2 different tables 2 different keys. also, assuming id column in name , type table has no relation.
here, writing separate query can give quicker result going join.
select cat_name name id=$id; select type_name type id=$type;
Comments
Post a Comment