PHP Code:
function get_category($domain){
global $db;
$sql = "SELECT * FROM " . table_stores . " WHERE domain = '$domain'";
$result = $db->get_results($sql);
$catgoryid = $result->category_id; //category_id is a column name in the table_stores
return $categoryid;
}
I've made table_stores as a constant.
Can someone help me out how to retrieve a single record from the database by using get_results?




Linear Mode

