MySQL Forums
Forum List  »  Newbie

Re: INSERT INTO - Duplicate entries into table!
Posted by: timb
Date: June 02, 2005 12:10PM

You run the query twice:

$result = mysql_query($query) or die("<h3>Query Failed!!</h3><br>\n"); // First time query is run.
mysql_query($query,$link); // Second time query is run.

Another thing, I noticed these two statements prior to the query:

$val=$SKILLS; // Statement 1
if($SKILLS == $val) {} // Statement 2

Do you realize that your if statement will ALWAYS evaluate to true?

A third thing, your script doesn't show any validation of the POST variables. This is not a good idea. You should always validate data received from another source before using it, particularly if you will use it in your SQL. If you left off that part of the script, good for you. If not, you need to do some research.

A fourth thing, your script includes a number of variables that are not used. Again, if you left off that part of the script, not a problem. If they really aren't used, you should get rid of them.

Options: ReplyQuote


Subject
Written By
Posted
Re: INSERT INTO - Duplicate entries into table!
June 02, 2005 12:10PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.