Jump to content


Photo

Listing query results


  • Please log in to reply
1 reply to this topic

#1 Jester

Jester
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 06 February 2003 - 10:09 PM

Merry Meet!
Now I have a big problem with php + mysql
the main source of the problem is query so I posted this up here;
My problem:

Now I am coding a site for recepies and I want my users to be able to list the recepies according to their first letter (ex all the recepies starting with a)

Now I tired really hard to the Left function but I just haven\'t been able to make sql to return the result of a query like this:
we have a column say name
I wnt eury to match up the first letter of every entry in name with the one given by the user...

Spent almost 3 hours playing with the \"LEFT()\" thingie but it doesn\'t work theway it should =)

Kind Regards
The Jester

#2 effigy

effigy
  • Staff Alumni
  • Advanced Member
  • 3,600 posts
  • LocationIL

Posted 07 February 2003 - 12:48 AM

select * from recipes where name like \'a%\'


just code it to make the letter part dynamic...
Regexp | Unicode Article | Letter Database
/\A(e)?((1)?ff(?:(?:ig)?y)?|f(?:ig)?)\z/




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users