I need to get the property of the object from the results of the database query. Here is the query:
class Sales { public static function get_one_sales ($number_n) { $db = new DB; return $db->query("SELECT * FROM `sale` WHERE `number`='$number_n'", "Sales"); } } Here is the appeal
$tt = Sales::get_one_sales($number_n); foreach($tt as $rows_sale): $rows_sale->contragent_id; endforeach; Through the cycle, everything works fine, but I think that using foreach to output only one value is at least silly and not Feng Shui. Tell me, please, if it is not difficult, direct on the right path.
LIMIT 1- korytoff