-1

When I execute this query the code crashes at line ' $row2 = mysql_fetch_array($result2) ' Can someone please help me tell what is wrong in this.

$query2 = " SELECT time, MAX(id) FROM i_friend WHERE (user_id=$uid AND friend_id=$fid) OR (user_id=$fid AND friend_id=$uid) ";

                    $result2 = mysql_query($query2);

                    if($result2)
                    {
                             if (mysql_num_rows($result2) > 0) {
                                $row2 = mysql_fetch_array($result2) 
                                 detail["last_chat_time"] = $row2[$id];
                             } else {
                                 $detail["last_chat_time"] = "";
                             }
                    }
Cœur
  • 37,241
  • 25
  • 195
  • 267
Mayur More
  • 951
  • 2
  • 15
  • 37

1 Answers1

0

Correct this 2 lines

 $row2 = mysql_fetch_array($result2);
 $detail["last_chat_time"] = $row2[$id];
Amruth
  • 5,792
  • 2
  • 28
  • 41