0){ $result = mysql_q..." />

MySQL Update else insert Syntax Error?

You can use this code: $check = mysql_num_rows(mysql_query("SELECT * FROM PlayerStat WHERE Name='". $SQLName. "'")); if($check > 0){ $result = mysql_query("UPDATE PlayerStat SET Position='".

$POS. "', Number='". $NUM."', Name='".

$PlyrName. "', Status='". $Status.

"', TDS='". $TDS."', INT='". $INT.

"', YDS='". $YDS. "', RTG='".

$RTG."', Team='". $Team. "' WHERE Name='".

$SQLName. "'") or die(mysql_error()); } else { $result = mysql_query("INSERT INTO PlayerStat(`Position`, `Number`, `Name`, `Status`, `TDS`, `INT`, `YDS`, `RTG`, `Team`) VALUES ('". $POS."','".

$NUM. "','". $PlyrName.

"','". $Status."','". $TDS.

"','". $INT. "','".

$YDS."','". $RTG. "','".

$Team. "')"); } I think that will work with you thanks UPDATE: I note that you have syntax error one ; is enough try to change the code from: Name='$SQLName';"); to Name='$SQLName'"); and '$Team');"); you have to change to '$Team')").

Sorry I didn't give you guys the error message last night... here it is. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INT='1', YDS='86', RTG='52.5', Team='ARI' WHERE Name='Bartel, Richard'' at line 1 – Daniel Delcore Nov 30 at 2:57 Okay you can use the code above to resolve your problem.. – Montaser Nov 30 at 6:59.

Your result query should be: $result = mysql_query("INSERT INTO PlayerStat(`Position`, `Number`, `Name`, `Status`, `TDS`, `INT`, `YDS`, `RTG`, `Team`) VALUES ('$POS','$NUM','$PlyrName','$Status','$TDS','$INT','$YDS','$RTG','$Team')"); instead of $result = mysql_query("INSERT INTO PlayerStat(`Position`, `Number`, `Name`, `Status`, `TDS`, `INT`, `YDS`, `RTG`, `Team`) VALUES ('$POS','$NUM','$PlyrName','$Status','$TDS','$INT','$YDS','$RTG','$Team');"); cause you gave the semicolumn(;) in you query and you update query also has an extra semicolum and should be: $result = mysql_query("UPDATE PlayerStat SET Position='$POS', Number='$NUM', Name='$PlyrName', Status='$Status', TDS='$TDS', INT='$INT', YDS='$YDS', RTG='$RTG', Team='$Team' WHERE Name='$SQLName'"); instead of $result = mysql_query("UPDATE PlayerStat SET Position='$POS', Number='$NUM', Name='$PlyrName', Status='$Status', TDS='$TDS', INT='$INT', YDS='$YDS', RTG='$RTG', Team='$Team' WHERE Name='$SQLName';"); and for more better please send you error message..

I didn't downvote but it shouldn't matter if you include the semicolumn in your query. – matino Nov 29 at 9:29 @matino, Thanks buddy, cause I didn't knew that(Thanks a lot to make me correct), and didn't knew why someone gave me downvote, now I now, might be I deserve :) – jogesh_p Nov 29 at 9:51.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions