but it didn't work. Even with a static URL it didn't update my database, it only held the lyrics in the textarea after I pressed
submit.
The line "echo 'failed';" always executes, so that is why I thought it was a problem with my query.
$theLyrics = $_POST['thelyrics'];
$edit = $_POST['edit'];
if ($edit){
//add to database using update query!
$query = mysql_query("UPDATE lyricdata SET `lyrics` = '$theLyrics' WHERE `page_name` = '$page'");
if ($query){
echo "success";
}
else {
echo "failed";
}
if (empty($theLyrics)) {
//display error saying "You didn't enter any lyrics"
echo "<div id='fail'><center>You didn't enter any lyrics</center></div>";
}
}
else{
header("Location: http://localhost/home");
}
This post has been edited by Dormilich: 09 November 2012 - 02:14 PM
Reason for edit:: removed unnecessary quote

New Topic/Question
Reply




MultiQuote



|