Forum Moderators: coopster

Message Too Old, No Replies

check database for info

         

snehula

1:14 pm on May 5, 2011 (gmt 0)

10+ Year Member



Hi there, I'm sorry if my stupid problems are annoying u but I'm an absolute newbie, constantly running into problems, if that serves as an excuse :-)
So, I have a form that inserts data into a db table, all cool so far. Except that I would like to check the db for similar records before submitting the form and output them to the user if there are any, so they won't have duplicate records. I've put in a button for that sake, but have no idea how to direct the onclick event to a external php file, is that possible at all?

eelixduppy

8:12 pm on May 5, 2011 (gmt 0)



Hello and welcome to WebamsterWorld!

This is of course possible, but requires the use of javascript. You can find a very simple tutorial here: [news.php.net...]

That should suffice for the basics. Then all you would need to do is implement a check script (in PHP) that would check for duplicates and return whether it exists or not (or the actual values that do exist). Once you know, you would use javascript to make the necessary changes on your web page to convey those results.

snehula

2:13 pm on May 9, 2011 (gmt 0)

10+ Year Member



thanks a lot :-)