I have a simple mysql query which is as following:
SELECT DISTINCT(node.nid) AS nid,
node_counter.totalcount AS node_counter_totalcount,
node.title AS node_title,
node_data_field_dep.field_dep_value AS node_data_field_dep_field_dep_value,
node.type AS node_type,
node.vid AS node_vid,
node_data_field_type.field_type_value AS node_data_field_type_field_type_value
FROM node node
LEFT JOIN node_counter node_counter ON node.nid = node_counter.nid
LEFT JOIN content_field_dep node_data_field_dep ON node.vid = node_data_field_dep.vid
LEFT JOIN content_type_project node_data_field_type ON node.vid = node_data_field_type.vid
WHERE (node.type in ('project')) AND (node.status <> 0)
GROUP BY nid
ORDER BY node_counter_totalcount DESC
so i execute the following statements:
$result = mysql_query($query);
where $query is the above SQL query.
Usually, I use mysql_fetch_array($result) or mysql_fetch_row($result) to access the data, but these are not working now and instead giving some error. Is there any other way to use them. I want to print the data selected in a formatted manner.(Say, a table)