Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Feb 2004
    Location
    Malaysia
    Posts
    175
    Thanks
    0
    Thanked 0 Times in 0 Posts

    sql query unsure

    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.
    Warm Regards,
    Mivec

  • #2
    raf
    raf is offline
    Master Coder
    Join Date
    Jul 2002
    Posts
    6,589
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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
    Posting guidelines I use to see if I will spend time to answer your question : http://www.catb.org/~esr/faqs/smart-questions.html


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •