View Full Version : sql query unsure

04-12-2004, 02:11 PM
hi all,
can sopmeone explain to me what this phrase of sql means?

$sql = "SELECT newsID, title, left(contents, 250) as contents, date FROM tblNews ORDER BY date DESC";
$rs = mysql_query($sql);
$nRows = mysql_num_rows($rs);

what does the left(contents, 250) mean?pls help.thank you.

04-12-2004, 02:45 PM
left(contents, 250) will only return the first 250 characters of the value inside column 'contents', for each record. (unless of course, the value contains less then 250 characters)

for more info on this and other mysql-stringfunctions