Hey,
ik heb een vraag. De datum word zo opgeslagen: 20:50 20-07-2012
Maar hoe zorg ik ervoor dat als het persies zolaat is dat ie dan een mysql update uitvoert?
Ik heb verschillende dingen geprobeerd maar het werkt niet echt?
Dit is mijn script, ik heb mijn gegevens eruit gehaald. Het post wel als ik zonder mysql doe.
ik heb een vraag. De datum word zo opgeslagen: 20:50 20-07-2012
Maar hoe zorg ik ervoor dat als het persies zolaat is dat ie dan een mysql update uitvoert?
Ik heb verschillende dingen geprobeerd maar het werkt niet echt?
Dit is mijn script, ik heb mijn gegevens eruit gehaald. Het post wel als ik zonder mysql doe.
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/include"]include[/URL] [COLOR= #DD0000]database.php[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/require_once"]require_once[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]twitteroauth.php[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$tweet[/COLOR] [COLOR= #007700]= new[/COLOR] TwitterOAuth[COLOR= #007700]([/COLOR][COLOR= #0000BB]$consumerKey[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$consumerSecret[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$oAuthToken[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$oAuthSecret[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$sql[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM `tweets` WHERE `datetime`="[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/date"]date[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]H:i d-m-y[/COLOR][COLOR= #007700]).[/COLOR][COLOR= #DD0000]" LIMIT 1"[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_num_rows"]mysql_num_rows[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sql[/COLOR][COLOR= #007700]) ==[/COLOR] [COLOR= #0000BB]1[/COLOR][COLOR= #007700]){[/COLOR]
[COLOR= #0000BB]$res[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sql[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$message[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$res[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]text[/COLOR][COLOR= #007700]];[/COLOR]
[COLOR= #0000BB]$tweet[/COLOR][COLOR= #007700]->[/COLOR]post[COLOR= #007700]([/COLOR][COLOR= #DD0000]statuses/update[/COLOR][COLOR= #007700],[/COLOR] [URL="http://www.php.net/array"]array[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]status[/COLOR] [COLOR= #007700]=>[/COLOR] [COLOR= #DD0000]"$message"[/COLOR][COLOR= #007700]));
}[/COLOR]
?> 

