Member Avatar for TechySafi

If I put this line $friends = $connection->get('followers/ids', array('screen_name' => '2020volt')); Twitter api returns something like this :

Array
(
    [0] => 173605790
    [1] => 187372244
    [2] => 17535566
    [3] => 190756198
    [4] => 184577861
    [5] => 119247538
    [6] => 183813521
    [7] => 18013082
    [8] => 149601084
    [9] => 186491393
    [10] => 19263381
    [11] => 208430904
    [12] => 25987409
    [13] => 44706902
    [14] => 198088252
)

Problem : My task is finding out how many (and who as well) of your followers are subscribed to my site. I built a database of the subscribers. But now I need to know the proper query to get this task done.

select * from users where twitter_id = "Its your task mates :) just show me a way to query all the ids, got returned from twitter" and status = "1"

I think you already got what I'm asking for. I want to make a query with all the ids belongs to that array to see if any of your twitter friend is already our subscriber.

Thanks In Advance

try:

$sql="select * from users where twitter_id IN (" . implode(',',$friends) . ") AND status=1";
$result=mysql_query($sql) or die( mysql_error() );

$total=mysql_num_rows( $result );
Member Avatar for TechySafi

try:

$sql="select * from users where twitter_id IN (" . implode(',',$friends) . ") AND status=1";
$result=mysql_query($sql) or die( mysql_error() );

$total=mysql_num_rows( $result );

yeah, it works pretty fine! Thanks once again !! Simple & quick answer :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.