Jump to content

Alphabet loop and mysql queries


CrustyDOD

Recommended Posts

Hey!

 

I have a question that is a bit more related to mysql then PHP so i hope i didn't miss the board too much. :)

 

1st Question:

I have an array of english alphabet and a foreach loop that goes over array 1 by 1.

Inside loop i have mysql query that searches for records (20 records per letter) that start with n letter

 

... LIKE 'A%' ....

 

The question is how on earth do i get records that DO NOT start with alphabet letter? Basically before A output is done i would like to get 20 records that start with 0-9, _, -, etc ANYTHING but those 26 alphabet letters.

 

Hope its clear :)

 

2nd question, doing the above method it means that i will have to execute 26 + 1 non-alphabet mysql queries (each query gets 20 records) (since they are inside loop). Is there any other way to do this without so many queries?

Link to comment
https://forums.phpfreaks.com/topic/100777-alphabet-loop-and-mysql-queries/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.