PHP Source Code »

 

Use mysql_result function to get query result



<?php

   mysql_connect("mysql153.secureserver.net","navioo","password");
   mysql_select_db("navioo");


   $query = "SELECT id, firstname FROM Employee";
   $result = mysql_query($query);

   $id = mysql_result($result, 0"id");
   $name = mysql_result($result, 0"firstname");
   echo "The first returned id is $id and the name is $name";
?>


           
       



HTML code for linking to this page:

Follow Navioo On Twitter

PHP Source Code

 Navioo