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?

1 Answer 1

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";
}
Sign up to request clarification or add additional context in comments.

1 Comment

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.