dimisdas Posted March 25, 2009 Share Posted March 25, 2009 I can not find whats wrong! Any ideas? $id1=rand(100,999) . "\n"; $id2=rand(1000,9999) . "\n"; $id3=rand(1000,9999) . "\n"; $id4=rand(1000,9999) . "\n"; $id5=rand(1000,9999) . "\n"; $all="$id1 $id2 $id3 $id4 $id5"; mysql_connect(localhost,$username1,$password1); @mysql_select_db($database1) or die( "There is a problem with the MySQL database"); $query = "INSERT INTO accounts (username, fullname, password, rank, banned, code, enabled) VALUES ('$user', '$name', '$pass', '1', '0', '$all', '0')"; mysql_query($query) or die('Error, insert query failed'); mysql_close(); Quote Link to comment https://forums.phpfreaks.com/topic/151105-can-not-insert-query-correctly/ Share on other sites More sharing options...
Maq Posted March 25, 2009 Share Posted March 25, 2009 Change this line to this and tell me what the output is: mysql_query($query) or die(mysql_error()); Quote Link to comment https://forums.phpfreaks.com/topic/151105-can-not-insert-query-correctly/#findComment-793800 Share on other sites More sharing options...
dimisdas Posted March 25, 2009 Author Share Posted March 25, 2009 Username already existed. that was so silly. I took me hours to understand why it is not working. Ty! Quote Link to comment https://forums.phpfreaks.com/topic/151105-can-not-insert-query-correctly/#findComment-793801 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.