HoTDaWg Posted January 2, 2007 Share Posted January 2, 2007 [code]checksongexistence(){$songrequest = "SELECT * FROM songs WHERE songname='".$songname."' AND songartist='".$songartist."'";$checksongexistence = mysql_query($songrequest,$conn);if($checksongexistence){$query="UPDATE songs SET votes='$addvote' WHERE songname='$songname' AND songartist='$songartist'";mysql_query($query); if($query){echo "Your request was submitted succesfully";}else{echo "An error occured, your request was not successful";}else{insertintodb();}[/code]how do you +1 to a number inside of a database? Link to comment https://forums.phpfreaks.com/topic/32504-solved-how-do-you/ Share on other sites More sharing options...
trq Posted January 2, 2007 Share Posted January 2, 2007 [code=php:0]$query="UPDATE songs SET votes=votes+1 WHERE songname='$songname' AND songartist='$songartist'"[/code] Link to comment https://forums.phpfreaks.com/topic/32504-solved-how-do-you/#findComment-151082 Share on other sites More sharing options...
HoTDaWg Posted January 2, 2007 Author Share Posted January 2, 2007 thank you! Link to comment https://forums.phpfreaks.com/topic/32504-solved-how-do-you/#findComment-151089 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.