|
#1
|
|||
|
|||
|
PHP: EREG() function and databases
Many are probably familiar with the ereg() function in php:
Example: PHP Code:
I hope this makes sense. It was the best way I could describe my situation. |
|
#2
|
||||
|
||||
|
Create a recordset first to pull the size table from the database. You can then loop through it or create an array or function to compare sizes.
__________________
Cheers, Degs Please post back with your results CTH Terms of Use CTH Subscriptions :: Adaware Guide :: HijackThis |
|
#3
|
|||
|
|||
|
Thank you Degs for your response. While playing with this, I came up with another question. Is there really even a need to check that the value of $size is equal to one of the sizes in the database? $size gets its value from a dropdown menu, and that menu is populated by the same table in the database used to check it, but I have seen in other examples in the past that variables that get their values from select menus in a form are still checked, even though the programmer, the administrator, and the user all know that the contents of that variable is going to be one of the options.
This is part of a search script that will be used very frequently, so I'm going for as little code as possible to save resources and increase speed. Thanks again! |
|
#4
|
||||
|
||||
|
If you know the values then you don't neccessarilly have to check them. The problem is if a user saves the page to their drive and edit's it and changes the values. That is why you should have validation just incase.
__________________
Cheers, Degs Please post back with your results CTH Terms of Use CTH Subscriptions :: Adaware Guide :: HijackThis |
|
#5
|
|||
|
|||
|
Hmm...never would have thought of that. Thanks Degsy.
|
![]() |
| Bookmarks |
«
Previous Topic
|
Next Topic
»
| Topic Tools | |
|
|
All times are GMT +1. The time now is 07:41 AM.
[
RSS ]








