PHP Getting all data with amfphp


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. public function getContacts()
  2. {
  3. //We must specify our vo, because we need to map correctly
  4. require_once( "vo/ContactVO.php" );
  5.  
  6. $sql = mysql_query( "SELECT * FROM contacts" );
  7.  
  8. $result = array();
  9.  
  10. while( $cont = mysql_fetch_array( $sql ) )
  11. {
  12. //Create a new contact vo
  13. $contact = new ContactVO( $cont );
  14.  
  15. //Result is a snippet
  16. $result[] = $contact;
  17. }
  18. //Print out the result
  19. return $result;
  20. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.