Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

**Tutorial HELP** COUNT() with SQL

$
0
0
<?php

include_once('resources/config.php');

$query = mysql_query("SELECT COUNT(1) `posts`");
$count = mysql_result($query, 0);

echo $count;
?>



Its supposed to return the number of rows that i have in my SQL database.
It only seems to return 1. I dont quite understand why. I am doing this video tutorial.
Its about 3 minutes in.

SQL Tutorial

Could anyone explain why this might be happening?

At this point I have no use for it, but any information on PHP or SQL would be very productive.

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>