What exactly are you trying to do? Can you give an example?
What I can say is that you should't allow visitors to connect directly to a database. You need to make a form (php is very good at that) that acts as an interface between the visitor & the database.