Skip to content

Instantly share code, notes, and snippets.

@agustinhaller
Created November 13, 2012 17:55
Show Gist options
  • Select an option

  • Save agustinhaller/4067303 to your computer and use it in GitHub Desktop.

Select an option

Save agustinhaller/4067303 to your computer and use it in GitHub Desktop.
cursors
function saveCursor($cursor, $twitter_username)
{
$conn = connect_db();
if($conn!=false)
{
$q_uscht = "UPDATE users_followers
SET next_cursor = ".$cursor."
WHERE tw_account = '".$twitter_username."'";
$r_uscht = mysql_query($q_uscht);
}
// Destroy db connection
disconnect_db($conn);
}
function getCursor($twitter_username)
{
$conn = connect_db();
$cursor = null;
if($conn!=false)
{
$q_uscht = "SELECT next_cursor FROM users_followers
WHERE tw_account = '".$twitter_username."'";
$r_uscht = mysql_query($q_uscht);
$tmp = mysql_fetch_row($r_uscht);
$cursor = $tmp[0];
}
// Destroy db connection
disconnect_db($conn);
return $cursor;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment