i have created a table to store the number of a count which i need for some subtraction at a later date. when i try to get the information out of the table instead of getting the number 5 i am getting resource id # 5.

the table has been set up like this

$sql="CREATE TABLE IF NOT EXISTS `email_count` (
			
			`id` INT NOT NULL AUTO_INCREMENT,
			`sent_messages` INT not null,
			primary key (id)
		)";
		mysql_query($sql) or die (mysql_error());

selecting the information out of the table looks like this

$query = "SELECT sent_messages FROM email_count";
$result=mysql_query($query)or die(mysql_error());
$sent_mail = $results;

how can i get it to just display the number?

i got the code working using this

$query = "SELECT sent_messages FROM email_count"or die(mysql_error());
$results = mysql_query($query);
$arr = mysql_fetch_array($results);
$sent_mail = $arr[0];
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.