PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I am trying to get a count of the number of times the same road appears for one steward so if there are 4 of the same road for "steward A" it will show "the Road" and "4".
I thought the code below was correct but not getting any count back the the road?
Please please help.
PS. 'DB' instead of 'MYSQL' is valid as using a CMS "Drupal"
Thank you for the very swift reply but i have an issue with outputting it to a HTML table to diplay the results.
I guess that the syntax will look a little wierd but should be valid, but could someone eval the code and tell me if there is something obviously wrong as I get the table output but no result?
<?php
$query = db_result(db_query("SELECT field_steward_value,field_road_name_value FROM content_type_resident AS num_rows WHERE field_steward_value = 'Steward Name 4' AND field_road_name_value = 'VALUE' "));
?>
In that code, you are selecting two fields ( field_steward_value, field_road_name_value ), but when you display the table, you are telling the php to display the $query, instead of the field(s) you retrieved.