0

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?

1
Contributor
1
Reply
2
Views
9 Years
Discussion Span
Last Post by kevin wood
0

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];
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.