We design and develop websites, digital experiences, and software solutions for growing businesses.
The mysql_fetch_array() in PHP allows you to retrieve data from mysql_query. IT always returns the first row in a MySQL Resource in the form of an associative/ numeric array.
<?php mysql_fetch_array(data,array_type) ?> |
<?php // Your Connection Code here $query = "SELECT * FROM Demo_Table"; $result = mysql_query($query) or die(mysql_error()); $row = mysql_fetch_array($result) or die(mysql_error()); echo $row['name']. " - ". $row['age']; ?> |
The output will be: James Shadow – 33