How to retrieve column and count occurences of a value

I’ve given more information on my test page:
http://dglad4.dynu.net/notready/chart.html

Hi! You could myslqi_num_rows !

example:

<?php
$link = mysqli_connect("localhost", "my_user", "my_password", "world");

/* check connection */
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}

if ($result = mysqli_query($link, "SELECT Code, Name FROM Country ORDER BY Name")) {

/* determine number of rows result set */
$row_cnt = mysqli_num_rows($result);

printf("Result set has %d rows.\n", $row_cnt);

/* close result set */
mysqli_free_result($result);
}

/* close connection */
mysqli_close($link);
?>

The above examples will output:

Result set has 239 rows.

Sponsor our Newsletter | Privacy Policy | Terms of Service