xcubic Posted August 22, 2006 at 01:48 PM Report Share #45918 Posted August 22, 2006 at 01:48 PM Escrevi estas linhas : <?php $hostname = "***"; $user = "***"; $password = "***"; $db = "***"; echo "<br>Hostname: ",$hostname; echo "<br>User: ",$user; echo "<br>Password: ",$password; echo "<br>Database Name: ",$db; $var_test=1; $connect = mysql_connect($hostname, $user, $password); if (!($connect)) { echo "<br><br>Status: Error, NOT connected!","<br>"; $var_test=0; } else echo "<br><br>Status: Conected to $hostname!"; if ($var_test==1) { $query_create_db = "CREATE DATABASE $db"; $create_db = mysql_query($query_create_db,$connect); if($create_db==1) echo "<br>Status : Database created!","<br>"; else { echo "<br>Status : Database NOT created!"; $var_test=0; } } else{} if ($var_test==1) { $db_select = mysql_select_db($db, $connect); if($db_select==1) echo "<br>Status : Database selected!","<br>"; else { echo "<br>Status : Database NOT selected!"; $var_test=0; } } else{} if ($var_test==1) { $query_create_tbl_login = "CREATE TABLE 'login' ( codigo INT AUTO_INCREMENT PRIMARY KEY, nome VARCHAR(40), email VARCHAR(50), nick VARCHAR(40), password VARCHAR(50) )"; $create_tbl_login = mysql_query($query_create_tbl_login,$connect); if($create_tbl_login==1) echo "<br>Status : Database LOGIN created!","<br>"; else { echo "<br>Status : Database NOT selected!"; $var_test=0; } } else{} echo "<br><br>END"; ?> mas o resultado é: Hostname: *** User: *** Password: *** Database Name: *** Status: Conected to ***! Status : Database created! Status : Database selected! Status : Database NOT selected! END e não entendo onde tá o problema.agradecia uma pequena ajuda...Bigado Link to comment Share on other sites More sharing options...
xcubic Posted August 22, 2006 at 02:08 PM Author Report Share #45919 Posted August 22, 2006 at 02:08 PM Esqueçam, já descobri. Que estupidez, agora só não percebo porque não cria a tabela Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now