corillo181 Posted December 4, 2006 Share Posted December 4, 2006 does any one knows what this is not working[code]<?phpinclude_once'../includes/db.php';//get variable$artist=$_POST['artist'];$song=$_POST['song'];$album=$_POST['album'];$genre=$_POST['genre'];//if the form is submitedif(isset($_POST['Submit'])){//insert genre variable into table$get=mysql_query("SELECT genre_id FROM tra_music_genre WHERE genre='$genre'");$many=mysql_fetch_array($get);//get the genre id of the genre selected$genre_id=$many['genre_id'];//insert into artist and the genre id$cona=mysql_connect("INSERT into tra_music_artist(genre_id,name)VALUES('$genre_id','$artist')")or die(mysql_error());$a_id=mysql_insert_id();$insert_al=mysql_connect("INSERT into tra_music_album(artist_id,genre_id,name)VALUES('$a_id','$genre_id','$album')");$al_id=mysql_insert_id();}?>[/code] Quote Link to comment Share on other sites More sharing options...
papaface Posted December 4, 2006 Share Posted December 4, 2006 What error are you getting, if any? Quote Link to comment Share on other sites More sharing options...
corillo181 Posted December 4, 2006 Author Share Posted December 4, 2006 thats the problem i'm not getting any errors it's just not insertin the values in to the queries. Quote Link to comment Share on other sites More sharing options...
marcus Posted December 4, 2006 Share Posted December 4, 2006 What query isn't executing? Quote Link to comment Share on other sites More sharing options...
sanfly Posted December 4, 2006 Share Posted December 4, 2006 Try using mysql_error() to figure out where the problem is occuringeg[code=php:0]$get=mysql_query("SELECT genre_id FROM tra_music_genre WHERE genre='$genre'") or die("Query 1: " . mysql_error());[/code] Quote Link to comment Share on other sites More sharing options...
jcbarr Posted December 4, 2006 Share Posted December 4, 2006 after //insert genre variable into tableYou aren't inserting anything, you are just selecting something from the table.$cona=mysql_connect is used to connect to an sql server... should be using mysql_query Quote Link to comment Share on other sites More sharing options...
corillo181 Posted December 5, 2006 Author Share Posted December 5, 2006 aaaw man i feeel so stupid.. i didnt even notice that until now..man what was i thinking..thank you JC. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.