Put a var_dump() in to make sure the $id matches the status. You might be
getting the truncated id since the ids need to be unsigned big integers.

Abraham
-------------
Abraham Williams | InboxQ <http://inboxq.com/> | abrah.am
@abraham <https://twitter.com/intent/follow?screen_name=abraham> |
github.com/abraham | blog.abrah.am
This email is: [ ] shareable [x] ask first [ ] private.



On Sun, Jun 12, 2011 at 14:55, Ayath <[email protected]> wrote:

> Hi,
> I've got the following code on a php page but when running the page
> nothing seems to happen.
>
> My database has a list of statuses with their id and a column named
> 'Complete' which I want to update to yes once that status has been
> retweeted.
>
> Please can someone suggest where I am goign wrong.
> The follwoing script does not updaate the record in the Mysql table
> nor does it retweet.
> I am using Abrahams O auth Library of this.
> Thanks,
> Ayath
>
> <?php
> /**
>  * @file
>  *
>  */
>
>
>
> $con = mysql_connect("host","user","pword");
>
>
> if (!$con)
>
>
>
> {
>
> die('Could not connect: ' . mysql_error());
>
>
> }
> mysql_select_db("dbname") or die(mysql_error());
>
>
>
>
> $result = mysql_query("SELECT * FROM data where complete='no'");
> #$num_rows = mysql_num_rows($result);
> $row = mysql_fetch_array($result);
>
>
> /* Load required lib files. */
> session_start();
> require_once('twitteroauth/twitteroauth.php');
> require_once('config.php');
>
>
> /* SET  ACCOUNT VARIBALES */
>
> define("OAUTH_TOKEN", "XYZ");
> define("OAUTH_SECRET", "ABC");
>
> $connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET,
> OAUTH_TOKEN, OAUTH_SECRET);
>
>
> $i=1;
>
> while($i<= $num_rows)
> {
> $connection->post('statuses/retweet/$id');
> mysql_query("UPDATE data SET complete= 'yes'
>
> WHERE ID = '$id' ");
>
>
> $i++;
>
> }
>
> ?>
>
> --
> Twitter developer documentation and resources: https://dev.twitter.com/doc
> API updates via Twitter: https://twitter.com/twitterapi
> Issues/Enhancements Tracker:
> https://code.google.com/p/twitter-api/issues/list
> Change your membership to this group:
> https://groups.google.com/forum/#!forum/twitter-development-talk
>

-- 
Twitter developer documentation and resources: https://dev.twitter.com/doc
API updates via Twitter: https://twitter.com/twitterapi
Issues/Enhancements Tracker: https://code.google.com/p/twitter-api/issues/list
Change your membership to this group: 
https://groups.google.com/forum/#!forum/twitter-development-talk

Reply via email to