Forum Moderators: open
I'm having a problem with the sql statement below. When i use LEFT i can no longer access text from the array of results returned from my MySQL database eg; <p>".$row['text']."</p>
Can you think of any reason why this might be happening and how i might access the text index of the row array, when i use LEFT?
//this is the sql statement i am using
$sqlstatement = "Select account.memid, account.surname, account.firstname, account.posteddate ,LEFT(account.text, 80)
from account where date_sub(curdate(), interval 21 day) ORDER BY
account.posteddate DESC";
$sqlstatement = "Select account.memid, account.surname, account.firstname, account.posteddate ,LEFT(account.text, 80) AS text
from account where date_sub(curdate(), interval 21 day) ORDER BY
account.posteddate DESC";
Note the "AS text" after your LEFT function.