Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><a href="http://php.net/manual/en/function.mysql-query.php" rel="nofollow">mysql_query</a> returns a resource you can use with these methods to fetch each row from the result:</p> <ul> <li><a href="http://php.net/manual/en/function.mysql-fetch-assoc.php" rel="nofollow">mysql_fetch_assoc</a></li> <li><a href="http://php.net/manual/en/function.mysql-fetch-row.php" rel="nofollow">mysql_fetch_row</a></li> <li><a href="http://php.net/manual/en/function.mysql-fetch-array.php" rel="nofollow">mysql_fetch_array</a></li> <li><a href="http://php.net/manual/en/function.mysql-fetch-object.php" rel="nofollow">mysql_fetch_object</a></li> </ul> <p>The most common function used is <a href="http://php.net/manual/en/function.mysql-fetch-assoc.php" rel="nofollow">mysql_fetch_assoc</a> which fetches the row as an associative array using the column names as the key names:</p> <pre><code>&lt;?php $result = mysql_query(...); while ($row = mysql_fetch_assoc($result)) { print $row['columnName']; } mysql_free_result($result); ?&gt; </code></pre> <p>I would recommend switching to the <a href="http://php.net/manual/en/book.mysqli.php" rel="nofollow">MySQLi</a> extension instead. It supports more MySQL features and has procedural and object-oriented implementations. The <a href="http://php.net/manual/en/ref.pdo-mysql.php" rel="nofollow">PDO_MYSQL</a> extension offers some improvements over <a href="http://php.net/manual/en/book.mysqli.php" rel="nofollow">MySQLi</a>, but it only has an object-orientated implementation so it takes a little more to get up and running with. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload