Re[2]: use of substring()

2002-06-13 Thread Julie Meloni
NW> Ooops, reserved word! Works great ;-) NW> Any way to add something to it like "" or should I do that in my NW> php? concat() is your friend! - Julie --> Julie Meloni --> [EMAIL PROTECTED] --> www.thickbook.com Find "Sams Teach Yourself MySQL in 24 Hours" at http://www.amazon.com/exec

Re[2]: use of substring()

2002-06-13 Thread Julie Meloni
>> SELECT datefield, SUBSTRING(textfield, 1, 30) as description FROM >> tablename WHERE id = 2; single quotes around textfield... - Julie --> Julie Meloni --> [EMAIL PROTECTED] --> www.thickbook.com Find "Sams Teach Yourself MySQL in 24 Hours" at http://www.amazon.com/exec/obidos/ASIN/06723

Re: use of substring()

2002-06-13 Thread Nick Wilson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 * and then Nick Wilson declared > You have an error in your SQL syntax near 'desc FROM news ORDER BY date ' at line 1 Ooops, reserved word! Works great ;-) Any way to add something to it like "" or should I do that in my php? Many thanks g

Re: use of substring()

2002-06-13 Thread Nick Wilson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 * and then Julie Meloni declared > Start with position 1. > > SELECT datefield, SUBSTRING(textfield, 1, 30) as description FROM > tablename WHERE id = 2; Hi again Julie and thanks for 'cross list' help! The problem is not that, at least not fir

Re: use of substring()

2002-06-13 Thread MikeParton
: <[EMAIL PROTECTED]> Sent: Thursday, June 13, 2002 6:03 PM Subject: use of substring() > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Hi all, > I'm having a spot of bother with the SUBSTRING() function, I don't think > I understand it properly... > >

Re: use of substring()

2002-06-13 Thread Keith C. Ivey
On 14 Jun 2002, at 0:03, Nick Wilson wrote: > SELECT date, SUBSTRING(text, 0,30) as description FROM table WHERE id > = '2'; You can't assume that MySQL is like Perl, PHP, or any other language you may be used to. Note this: "For functions that operate on string positions, the first position

Re: use of substring()

2002-06-13 Thread Julie Meloni
Hi - NW> I have a table (for example) with three cols 'id' | 'date' | 'text' NW> I want to return just 'date' and the first 30 chars from 'text' NW> I've tried this sql: NW> SELECT date, SUBSTRING(text, 0,30) as description FROM table WHERE id = NW> '2'; Start with position 1. SELECT datefi

use of substring()

2002-06-13 Thread Nick Wilson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi all, I'm having a spot of bother with the SUBSTRING() function, I don't think I understand it properly... I have a table (for example) with three cols 'id' | 'date' | 'text' I want to return just 'date' and the first 30 chars from 'text' I've t