Request to database:
$result = database_select("SELECT p.type_condition AS pay, o.type_condition AS orders, n.type_condition AS news, a.type_condition AS other, s.index AS index, s.login AS login, s.telephone AS telephone FROM `vixen_erps_services_sms` s LEFT JOIN `vixen_erps_services_type` p ON p.type_id = s.pay LEFT JOIN `vixen_erps_services_type` o ON o.type_id = s.orders LEFT JOIN `vixen_erps_services_type` n ON n.type_id = s.news LEFT JOIN `vixen_erps_services_type` a ON a.type_id = s.other"); $col = database_numrows($result); Functions:
function database_select($select_text){ $query = "$select_text"; $result = mysql_query($query); return $result; } function database_numrows($result){ $numrows = mysql_numrows($result); return $numrows; } Throws out Warning: mysql_numrows (): supplied result resource .
If I remove the index field from the sample, then everything works fine. But I need to choose the index too. I do not understand what the problem is. All fields in the database tables exist.
$result = mysql_query("SELECT p.type_condition...? - Ipatyev