Check database for what user puts into text box?
Hi there,
I was wondering does anyone know the code,
so that when a user types text into a text box and presses submit it searches the mysql database for that text? and if that text is found it will echo 'sucess' and if its not fount it will give them an error message echo 'error'
thanks,
Jamie
Re: Check database for what user puts into text box?
You mean like a user logging type thing?
Re: Check database for what user puts into text box?
Just like a search thing really, It's a code for my points script, basically i will put 'Bonus passes / codes ' in the database and tell people them every month, and if a user puts that code in the text box and presses submit, if it finds the code in the database it will then accept it and say sucess otherwise it will give them an error saying it was not fount :)
Thanks,
Jamie
Re: Check database for what user puts into text box?
do you have any code to get started? the basic idea is to get the value from the text box after submitting a form ($_POST array), then using a simple SELECT statement in SQL with a WHERE clause to search for a certain column to match the string entered.
Re: Check database for what user puts into text box?
In addition, you may wish to spell Success correctly.