-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
  • 34,719
  • 24
  • 185
  • 251
Mayur More
  • 851
  • 2
  • 12
  • 34

1 Answers1

0

Correct this 2 lines

 $row2 = mysql_fetch_array($result2);
 $detail["last_chat_time"] = $row2[$id];
Amruth
  • 5,466
  • 2
  • 23
  • 39