Hi:
I am building a lyric database, but i have a problem on the submission page.
There is an error right now, but i don't really know what is it
<?php
if($_POST['submit'])
{
include ('config.inc.php');
$input['artist_name'] = mysql_real_escape_string($_POST['artist_name']);
$input['lyric'] = mysql_real_escape_string($_POST['lyric']);
$input['song_title'] = mysql_real_escape_string($_POST['song_title']);
$input['gender'] = mysql_real_escape_string($_POST['gender']);
$artist_check = "SELECT artist_id FROM artist WHERE artist_name LIKE '%". $input['artist_name'] ."%'";
if (mysql_num_rows($artist_check) == 0);
$artist_query = "INSERT INTO artist (artist_name, gender) VALUES ('{$input['artist_name']}','{$input['gender']}')" {
$artist_result = mysql_query($artist_query) or die('Error in artist query: ' . mysql_error());
}
{
else
$artist_id = mysql_insert_id();
}
{
endif;
$lyric_query = "INSERT INTO lyric (artist_id, song_title, lyric) VALUES ('{$artist_id}','{$input['song_title']}','{$input['lyric']}')";
$lyric_result = mysql_query($lyric_query) or die('Error in lyric query: ' . mysql_error());
}
}
?>