Hi,
I've got the following function:
public function already_tweeted($tweet){
return mysql_num_rows(mysql_query("SELECT * FROM `retweeted` WHERE `tweet`='$tweet'"));
}
Pretty straightforward. It checks whether a tweet already exists in the database.
The table had the following records:
id user tweet
3 You should retweet this too
2 Retweet this
(user is empty for now)
This code:
$db_reader = new database_reader;
$already_tweeted = $db_reader->already_tweeted($tweet);
print $tweet . ". Already: ";
var_dump((bool) $already_tweeted);
print "<br>";
Gives the following output:
You should retweet this too. Already: bool(false)
Retweet this. Already: bool(true)
I'm pretty much stuck here.
When I run SELECT * FROM retweeted
WHERE tweet
='You should retweet this too' in phpmyadmin I get 1 row back.