a little help please

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
AndrewBacca
Forum Commoner
Posts: 62
Joined: Thu Jan 30, 2003 10:03 am
Location: Isle of Wight, UK

a little help please

Post by AndrewBacca »

Hi,
sry twice I guess 1. if this is in the wrong place wasnt sure wot it comes under! and 2. if its been asked already I've tried different searchs and not found anything.

anyway...

I have a table in a MySQL database that has a list of product types
and i want to display say A to M in one place and N to Z in another place

the table has Id and name

example records : 1 | Bags

what is the SELECT statement for this?

Cheers
Andrew :D
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

generally, it'd be a standard select, like any other.. you can either save off (into php) the results, or "print" them up to the N's and continue on in the latter area..
User avatar
AndrewBacca
Forum Commoner
Posts: 62
Joined: Thu Jan 30, 2003 10:03 am
Location: Isle of Wight, UK

Post by AndrewBacca »

umm yeah sorry my fault i didnt explain propa

I know how to use PHP with MySQL but

I aint sure how to ONLY select names from the database that start with A to M

Code: Select all

SELECT * FROM `s_product_types` WHERE 'name' = ???????????
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

depending on how portable you want/need it, you can use a REGEXP or stack up all the LIKE forms...

you should backtick name, not single quote.
Post Reply