Scifo, you've posted several topics on similar subjects in the past few days.
Firstly, what are you gaining if every time you get stuck you post your code for us to fix? Its quite understandable, that's what we're here for... but I don't think that you are making a great enough effort to think things through for yourself first. A real understanding of the concepts may only come after thinking through a problem for yourself.
Second- Your code is sloppy and hard to sort through. If you want help your more likely to get it if you make your posts as clear and easy to read as possible. Format them in Notepad first and copy and paste them.
Third - Your variable naming is not consistent which is not only annoying but could give rise to strange bugs in your programming future, but I've already mentioned this before.
Spend some quality time with your PHP book or books. And have more confidence in your own ability to solve problems. Do things consistently and make your code organized and easy to read. Indent if statements, loops and functions. If you are going to capitalize one variable, capitalize them all.
Finally a database expects the same format for any string being inputted be it an INSERT, SELECT, UPDATE, etc.:
$query_to_check = "SELECT Forename,Surname,Address,Postcode,Doctor FROM patients WHERE
Forename = '{$HTTP_POST_VARS["forename"]}' AND
Surname = '{$HTTP_POST_VARS["surname"]}' AND
Address = '{$HTTP_POST_VARS["address"]}' AND
Postcode = '{$HTTP_POST_VARS["postcode"]}' AND
Doctor = '{$HTTP_POST_VARS["doctornames"]}'";
Stick with curly base syntax and quote your strings (in the arrays and around the braces)!
: )
Rich
:::::::::::::::::::::::::::::::::
Smiling Souls
http://www.smilingsouls.net
:::::::::::::::::::::::::::::::::