Hello! I want to create a script which mails emails to subscribers. I'm almost done, but I'd like it to say "Sent to # people". I've tried using:
<?php $dbc = mysqli_connect('localhost', 'username', 'password', 'database') or die('Error: Could not connect to database'); $query = mysql_query("SELECT * FROM table"); $number = mysql_num_rows($query); echo "Sent to ". $number; mysqli_close($dbc); ?>
When I try it I get:
Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in mysite.com/number.php on line 7
Any suggestions on how to fix it?