basicly what i am trying to do is retrieve the values for displaying and then update 2 colums in the selected record. It retrieves all the data fine but WILL NOT update.
I know PHP ok and know SQL pretty well - I just don't see what I am doing wrong here. if anyone could help - Please do - it is very appreciated.
Thanks!
the code:
$db = mysql_connect("localhost", "myuser", "mypass");
mysql_select_db("mwdnbc_apps",$db);
//SQL Query
$result = mysql_query("SELECT artist, points, city, state, image, bio, views, links, real_name, email, homepage, booking, affiliations, msn, aol, yahoo FROM artist_profiles where id='$profile_id'",$db); //
//Retrive $myrow array
while ($myrow = mysql_fetch_row($result)) {
$rotation_count= ($rotation_count+1);
//Retrieve needed array values
$artist= "$myrow[0]";
$points= "$myrow[1]";
$city= "$myrow[2]";
$state= "$myrow[3]";
$profile_image= "<img src=$myrow[4] width=100 height=100>";
$bio= "$myrow[5]";
$views="$myrow[6]";
$links="$myrow[7]<br><br>";
$real_name="$myrow[8]";
$email="<a href=mailto:$myrow[9]>$myrow[9]</a>";
$homepage="<a href=$myrow[10] target=_blank>$myrow[10]</a>";
$booking="$myrow[11]";
$affiliations="$myrow[12]";
$msn_name="$myrow[13]";
$aol_name="$myrow[14]";
$yahoo_name="$myrow[15]";
$location= "$city, $state";
}
$points= ($points + 2);
$views= ($views + 1);
mysql_query("UPDATE artist_profiles SET points='$points' views='$views' WHERE id='$profile_id'",$db);