RE: [PHP] MySQL substrings?
This is actually not so difficult. Just download the mySQL documentation (from mysql.org or .com I believe is where I got it) and search the function list. Johan Alfredeen -Original Message- From: Tom Carter [mailto:[EMAIL PROTECTED]] Sent: Sunday, August 19, 2001 8:53 AM To: Chris Lambert; [EMAIL PROTECTED] Subject: Re: [PHP] MySQL substrings? very hard obviously.. I've looked quite a bit before to no avail! I tried guessing it, obviously stupidity prevailed (note to self.. go back and use substring function instead) - Original Message - From: "Chris Lambert" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Sunday, August 19, 2001 3:48 PM Subject: Re: [PHP] MySQL substrings? > There is a SUBSTRING() function, its just hard to find with their search > system. > > /* Chris Lambert, CTO - [EMAIL PROTECTED] > WhiteCrown Networks - More Than White Hats > Web Application Security - www.whitecrown.net > */ > > - Original Message - > From: Tom Carter <[EMAIL PROTECTED]> > To: Seb Frost <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> > Sent: Sunday, August 19, 2001 10:32 AM > Subject: Re: [PHP] MySQL substrings? > > > | You can achieve the same effect by using left and right > | - Original Message - > | From: "Seb Frost" <[EMAIL PROTECTED]> > | To: <[EMAIL PROTECTED]> > | Sent: Sunday, August 19, 2001 3:12 PM > | Subject: [PHP] MySQL substrings? > | > | > | > This is thew sort of thing I want: > | > > | > SELECT * FROM table ORDER BY substr(field,5,6) > | > > | > but I don't know the correct function, if there is one, or how to > | implement > | > it. > | > > | > cheers, > | > > | > - seb > | > > | > -Original Message- > | > From: Michael [mailto:[EMAIL PROTECTED]] > | > Sent: 19 August 2001 12:51 > | > To: [EMAIL PROTECTED] > | > Subject: [PHP] Re: transaction > | > > | > > | > Nafiseh Saberi wrote: > | > > > | > > hi. > | > > in large database with php,postgres > | > > and when in each time come many request , > | > > how do we implement transactions?? > | > > | > > nafiseh. > | > > | > If you are wanting to run several queries in the one script though the > | > one transaction - > | > you'll need to send a begin(as a query) and execute it - then to the > | > same connection send all your other queries as normal, and follow it up > | > with a commit. > | > > | > -- > | > PHP General Mailing List (http://www.php.net/) > | > To unsubscribe, e-mail: [EMAIL PROTECTED] > | > For additional commands, e-mail: [EMAIL PROTECTED] > | > To contact the list administrators, e-mail: [EMAIL PROTECTED] > | > > | > > | > -- > | > PHP General Mailing List (http://www.php.net/) > | > To unsubscribe, e-mail: [EMAIL PROTECTED] > | > For additional commands, e-mail: [EMAIL PROTECTED] > | > To contact the list administrators, e-mail: [EMAIL PROTECTED] > | > > | > | > | -- > | PHP General Mailing List (http://www.php.net/) > | To unsubscribe, e-mail: [EMAIL PROTECTED] > | For additional commands, e-mail: [EMAIL PROTECTED] > | To contact the list administrators, e-mail: [EMAIL PROTECTED] > | > | > | > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] MySQL substrings?
On Mon, 20 Aug 2001 02:12, Chris Lambert wrote: > It'd help if you have us the mysql_error() returned. > > Try the following: > > SELECT *, substring_date AS SUBSTRING(date,5,2) FROM $table ORDER BY > substring_date > Date is a reserved word in Mysql. Also, that might work better, after renaming the field from date, as SELECT *, SUBSTRING(datefield,5,2) AS substring_date FROM $table ORDER BY substring_date > > - Original Message - > From: Seb Frost <[EMAIL PROTECTED]> > To: Tom Carter <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> > Sent: Sunday, August 19, 2001 11:19 AM > Subject: RE: [PHP] MySQL substrings? > > | This doesn't work: > | > | $result = mysql_query("SELECT * FROM $table ORDER BY > | SUBSTRING(date,5,2)") > | > | Any idea why? > | > | - seb > | -- David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA Oxymoron: Soviet Life. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] MySQL substrings?
It'd help if you have us the mysql_error() returned. Try the following: SELECT *, substring_date AS SUBSTRING(date,5,2) FROM $table ORDER BY substring_date /* Chris Lambert, CTO - [EMAIL PROTECTED] WhiteCrown Networks - More Than White Hats Web Application Security - www.whitecrown.net */ - Original Message - From: Seb Frost <[EMAIL PROTECTED]> To: Tom Carter <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Sunday, August 19, 2001 11:19 AM Subject: RE: [PHP] MySQL substrings? | This doesn't work: | | $result = mysql_query("SELECT * FROM $table ORDER BY SUBSTRING(date,5,2)") | | Any idea why? | | - seb | | -- | PHP General Mailing List (http://www.php.net/) | To unsubscribe, e-mail: [EMAIL PROTECTED] | For additional commands, e-mail: [EMAIL PROTECTED] | To contact the list administrators, e-mail: [EMAIL PROTECTED] | | | -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] MySQL substrings?
This doesn't work: $result = mysql_query("SELECT * FROM $table ORDER BY SUBSTRING(date,5,2)") Any idea why? - seb -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] MySQL substrings?
very hard obviously.. I've looked quite a bit before to no avail! I tried guessing it, obviously stupidity prevailed (note to self.. go back and use substring function instead) - Original Message - From: "Chris Lambert" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Sunday, August 19, 2001 3:48 PM Subject: Re: [PHP] MySQL substrings? > There is a SUBSTRING() function, its just hard to find with their search > system. > > /* Chris Lambert, CTO - [EMAIL PROTECTED] > WhiteCrown Networks - More Than White Hats > Web Application Security - www.whitecrown.net > */ > > - Original Message - > From: Tom Carter <[EMAIL PROTECTED]> > To: Seb Frost <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> > Sent: Sunday, August 19, 2001 10:32 AM > Subject: Re: [PHP] MySQL substrings? > > > | You can achieve the same effect by using left and right > | - Original Message - > | From: "Seb Frost" <[EMAIL PROTECTED]> > | To: <[EMAIL PROTECTED]> > | Sent: Sunday, August 19, 2001 3:12 PM > | Subject: [PHP] MySQL substrings? > | > | > | > This is thew sort of thing I want: > | > > | > SELECT * FROM table ORDER BY substr(field,5,6) > | > > | > but I don't know the correct function, if there is one, or how to > | implement > | > it. > | > > | > cheers, > | > > | > - seb > | > > | > -Original Message- > | > From: Michael [mailto:[EMAIL PROTECTED]] > | > Sent: 19 August 2001 12:51 > | > To: [EMAIL PROTECTED] > | > Subject: [PHP] Re: transaction > | > > | > > | > Nafiseh Saberi wrote: > | > > > | > > hi. > | > > in large database with php,postgres > | > > and when in each time come many request , > | > > how do we implement transactions?? > | > > | > > nafiseh. > | > > | > If you are wanting to run several queries in the one script though the > | > one transaction - > | > you'll need to send a begin(as a query) and execute it - then to the > | > same connection send all your other queries as normal, and follow it up > | > with a commit. > | > > | > -- > | > PHP General Mailing List (http://www.php.net/) > | > To unsubscribe, e-mail: [EMAIL PROTECTED] > | > For additional commands, e-mail: [EMAIL PROTECTED] > | > To contact the list administrators, e-mail: [EMAIL PROTECTED] > | > > | > > | > -- > | > PHP General Mailing List (http://www.php.net/) > | > To unsubscribe, e-mail: [EMAIL PROTECTED] > | > For additional commands, e-mail: [EMAIL PROTECTED] > | > To contact the list administrators, e-mail: [EMAIL PROTECTED] > | > > | > | > | -- > | PHP General Mailing List (http://www.php.net/) > | To unsubscribe, e-mail: [EMAIL PROTECTED] > | For additional commands, e-mail: [EMAIL PROTECTED] > | To contact the list administrators, e-mail: [EMAIL PROTECTED] > | > | > | > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] MySQL substrings?
There is a SUBSTRING() function, its just hard to find with their search system. /* Chris Lambert, CTO - [EMAIL PROTECTED] WhiteCrown Networks - More Than White Hats Web Application Security - www.whitecrown.net */ - Original Message - From: Tom Carter <[EMAIL PROTECTED]> To: Seb Frost <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Sunday, August 19, 2001 10:32 AM Subject: Re: [PHP] MySQL substrings? | You can achieve the same effect by using left and right | - Original Message - | From: "Seb Frost" <[EMAIL PROTECTED]> | To: <[EMAIL PROTECTED]> | Sent: Sunday, August 19, 2001 3:12 PM | Subject: [PHP] MySQL substrings? | | | > This is thew sort of thing I want: | > | > SELECT * FROM table ORDER BY substr(field,5,6) | > | > but I don't know the correct function, if there is one, or how to | implement | > it. | > | > cheers, | > | > - seb | > | > -Original Message- | > From: Michael [mailto:[EMAIL PROTECTED]] | > Sent: 19 August 2001 12:51 | > To: [EMAIL PROTECTED] | > Subject: [PHP] Re: transaction | > | > | > Nafiseh Saberi wrote: | > > | > > hi. | > > in large database with php,postgres | > > and when in each time come many request , | > > how do we implement transactions?? | > | > > nafiseh. | > | > If you are wanting to run several queries in the one script though the | > one transaction - | > you'll need to send a begin(as a query) and execute it - then to the | > same connection send all your other queries as normal, and follow it up | > with a commit. | > | > -- | > PHP General Mailing List (http://www.php.net/) | > To unsubscribe, e-mail: [EMAIL PROTECTED] | > For additional commands, e-mail: [EMAIL PROTECTED] | > To contact the list administrators, e-mail: [EMAIL PROTECTED] | > | > | > -- | > PHP General Mailing List (http://www.php.net/) | > To unsubscribe, e-mail: [EMAIL PROTECTED] | > For additional commands, e-mail: [EMAIL PROTECTED] | > To contact the list administrators, e-mail: [EMAIL PROTECTED] | > | | | -- | PHP General Mailing List (http://www.php.net/) | To unsubscribe, e-mail: [EMAIL PROTECTED] | For additional commands, e-mail: [EMAIL PROTECTED] | To contact the list administrators, e-mail: [EMAIL PROTECTED] | | | -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] MySQL substrings?
You can achieve the same effect by using left and right - Original Message - From: "Seb Frost" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Sunday, August 19, 2001 3:12 PM Subject: [PHP] MySQL substrings? > This is thew sort of thing I want: > > SELECT * FROM table ORDER BY substr(field,5,6) > > but I don't know the correct function, if there is one, or how to implement > it. > > cheers, > > - seb > > -Original Message- > From: Michael [mailto:[EMAIL PROTECTED]] > Sent: 19 August 2001 12:51 > To: [EMAIL PROTECTED] > Subject: [PHP] Re: transaction > > > Nafiseh Saberi wrote: > > > > hi. > > in large database with php,postgres > > and when in each time come many request , > > how do we implement transactions?? > > > nafiseh. > > If you are wanting to run several queries in the one script though the > one transaction - > you'll need to send a begin(as a query) and execute it - then to the > same connection send all your other queries as normal, and follow it up > with a commit. > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] MySQL substrings?
This is thew sort of thing I want: SELECT * FROM table ORDER BY substr(field,5,6) but I don't know the correct function, if there is one, or how to implement it. cheers, - seb -Original Message- From: Michael [mailto:[EMAIL PROTECTED]] Sent: 19 August 2001 12:51 To: [EMAIL PROTECTED] Subject: [PHP] Re: transaction Nafiseh Saberi wrote: > > hi. > in large database with php,postgres > and when in each time come many request , > how do we implement transactions?? > nafiseh. If you are wanting to run several queries in the one script though the one transaction - you'll need to send a begin(as a query) and execute it - then to the same connection send all your other queries as normal, and follow it up with a commit. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]