tags:

views:

47

answers:

1

Hi guys,

As this is my first PHP web application so dont know mich about php configuration.

Here is my case: I have developed an application in PHP/mysql, in which user can search his real followers.

Now problem is that a user having say upto 2k followers and 500 real followers in that, does not give any error, but when i move to big user 10k or more , he usually has more than 1k real followers, in this case i get error that invalid argument supplied for on line 354, means it's not getting rest data. Due to this it shows incomplete results. Why this is so ?

According to php configuration:

max_input_time -30
max_execution_time - 60 
memory_limit - 64M

do i need to make change in these?

or anything else i need to do?

Your help will be greatly appreciated guys?

Thank you in advance.

Code :

while($cID != 0)
{
    $followers = $t -> get_followers($unm, $cID); //get this array from twitter
    $nxtcursor = $followers['next_cursor_str'];
    //  print_r($followers);
    foreach($followers[users] as $followers)      //line no 354
    {
        //here i just get data into variables

       //here i save data into database
    }  

     $cID = $nxtcursor;
     if($nxtcursor == 0)
     {
          echo "<b>Reached to last cursor!!</b>";
     }


}
+1  A: 

i get error that invalid argument supplied for on line 354

This seems unrelated to your PHP configuration.

You just need to have a look at what's happening on line 354.

thomasrutter
Now why didn't I think of that
Michael Robinson
hehe - I reckon you should have made your earlier comment into an answer.
thomasrutter
I reckon you're right :) I'm not going to be so shy next time :P
Michael Robinson
@ thomasrutter, at line 354 , its a for loop to print the data, it's happening that it does not get data, so it gives me error "invalid argument supplied for foreachloop on line 354 ". I just don't understand that if there is code error, it should have to appear for any user or user having that much followers.
Rishi2686
I repeat: Please post some code. It could be anything, but most likely, you feed a query result to the foreach loop without first checking if the query actually succeeded. If that is the case, then you'll need to dig into your query (maybe enable mysql query logging to see the actual query that gets sent to mysql) and see how where and why it goes wrong. It could be anything.
tdammers
ok added the code.
Rishi2686