I know when inserting/updating a record in a database you want to run regex to clean up the input from the form. When only selecting items in a database using form input, would I want to go through the extra processing power of using regex or is it ok to accept whatever the user inputs since it isn't actually inserting the input into the database?
Wayne
querying MySQL
Moderator: General Moderators
- christian_phpbeginner
- Forum Contributor
- Posts: 136
- Joined: Sat Jun 03, 2006 2:43 pm
- Location: Java
try addslashes() function and stripslashes() function
Hi,
Why would you want to have an extra processing power to SELECT / VIEW data from the database ? It won't be useful anyway, because the WRONG data was already inserted or updated into the database.
The extra processing power by using REGEX in this case would be suitable when INSERTING or UPDATING data into the database. If you do that, you will have the correct data stored in your database....means, you would SELECT / VIEW the correct DATA !
If you want to select data from the database, you will need the stripslashes() PHP built-in function.
Why would you want to have an extra processing power to SELECT / VIEW data from the database ? It won't be useful anyway, because the WRONG data was already inserted or updated into the database.
The extra processing power by using REGEX in this case would be suitable when INSERTING or UPDATING data into the database. If you do that, you will have the correct data stored in your database....means, you would SELECT / VIEW the correct DATA !
If you want to select data from the database, you will need the stripslashes() PHP built-in function.
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA