I am trying to count the number of records in a MySQL DB with:
$sql = sprintf("SELECT COUNT(*) AS test FROM %s WHERE login = '%s' AND cc = '%s' AND schoolid= '%s'", 'classnotes', 'teacher', '0155', '0631');
$result = mysql_query($sql) or die(mysql_error());
but this is thowing an error "No Database Selected"
The EXACT same SQL statement works fine in PHPmyAdmin.
What don't I see?
Thanks in advance.
d