Ok what i'm trying to do is look at a database and see if a certain entry exists if it doesn't exist to create it and add some info, but if it does exist to update the info this is what i have.
$query = "SELECT * FROM table WHERE filename = $file_name";
$exist = mysql_query($query, $mysql_link);
if(!$exist){
$create_query = "INSERT INTO file_rating (value1, value2, value3) VALUES ('$value1', '$value2', '$value3')";
$create = mysql_query($create_query, $mysql_link);
}
else{
$get = mysql_fetch_array($exist);
$score = $get['value1'];
$score += $rating;
$numaccess = $get['num_access'];
$numaccess++;
$update_query = "UPDATE file_rating SET num_access = '$numaccess', total_score = '$score' WHERE filename = '$file_name'";
$update = mysql_query($update_query, $mysql_link);
}