php - How to access elements of the return value of mysql_fetch_array? -


$con = mysql_connect("servername","username","password");         if (!$con){die('could not connect: ' . mysql_error());}             mysql_select_db("appiness", $con);      $result= mysql_query("select * country");     while($answer= mysql_fetch_array($result))     {         echo $answer;     } 

when write gives me array of 194 elements when echo them writes arrayarrayarray....... 194 times idea why not giving names of countries?

you have specify column want out of $answer-array. if column name name:

echo $answer["name"] 

Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -