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
Post a Comment