...

View Full Version : sql query unsure



mivec
04-12-2004, 01: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.

raf
04-12-2004, 01: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
http://dev.mysql.com/doc/mysql/en/String_functions.html



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum