1

This is my ADOdb code:

$sql  = "SELECT m.*, s.photo, s.gender
         FROM mail AS m, signup AS s
         WHERE m.receiver = '" .mysql_real_escape_string($username). "'
         AND m.sender = s.username AND inbox = '1' AND status = '1'
         ORDER BY send_date DESC LIMIT " .$limit;
// my date is in the format 2012-08-02 02:20:05

$rs1  =  $conn->execute($sql);
$time =  $rs1->GetAssoc('send_date'); //GetArray Or GetRows
echo $time;

The echo shows an array, but what I need is to display the row send_date.

(Instead of ->GetAssoc, I've had also tried ->GetArray and ->GetRows.)

How can I display the row send_date?

Pacerier
  • 86,231
  • 106
  • 366
  • 634
BBKing
  • 2,279
  • 8
  • 38
  • 44

1 Answers1

1

You are not using adodb properly. It has built-in mechanism for escaping arguments, as well as separate method for limited results:

$sql  = "SELECT m.*, s.photo, s.gender
         FROM mail AS m, signup AS s
         WHERE m.receiver = ?
         AND m.sender = s.username 
         AND inbox = '1' 
         AND status = '1'
         ORDER BY send_date DESC";
$rs1  =  $conn->selectLimit($sql, $limit, -1, array($username));

// You will recive recordset with maximum of $limit rows, so you have to iterate through it:
while($row = $rs1->FetchRow()){
   echo $row['send_date'] . "\n";
}
dev-null-dweller
  • 29,274
  • 3
  • 65
  • 85