I have the following script which i use to display the value of field, however I now need to insert that value into another field, say named 'user's current score'
<?php
mysql_connect("", "", "") or die(mysql_error());
mysql_select_db("") or die(mysql_error());
$data = mysql_query("SELECT * FROM world_cup_scores, world_cup_users WHERE username ='$username'")
or die(mysql_error());
while($info = mysql_fetch_array( $data ))
if ( $info['match_score_ga1h'].$info['match_score_ga1a'] == $info['ga1h'].$info['ga1a'] ) {
("INSERT INTO world_cup_users(current_score) VALUES('correct_score_ga1)")
echo $info['correct_score_ga1'];
} elseif ($info['match_score_ga1h'] > $info['match_score_ga1a'] AND $info['ga1h'] < $info['ga1a'] ) {
echo $info['incorrect_result'];
} elseif ($info['match_score_ga1h'] < $info['match_score_ga1a'] AND $info['ga1h'] > $info['ga1a'] ) {
echo $info['incorrect_result'];
} elseif ($info['match_score_ga1h'] > $info['match_score_ga1a'] AND $info['ga1h'] == $info['ga1a'] ) {
echo $info['incorrect_result'];
} elseif ($info['match_score_ga1h'] < $info['match_score_ga1a'] AND $info['ga1h'] == $info['ga1a'] ) {
echo $info['incorrect_result'];
} elseif ($info['match_score_ga1h'] == $info['match_score_gala'] AND $info['ga1h'] <> $info['ga1a'] ) {
echo $info['incorrect_result'];
} elseif ($info['match_score_ga1h'] == $info['match_score_ga1a'] AND $info['ga1h'] <> $info['gala'] ) {
echo $info['incorrect_result'];
} else
echo $info['correct_result'];
?>
I've tried placeing INSERT into the script, but just can't get it to work.
Any help will be most appreciated.
Thanks