hi leute ich hab so einen php code zum verbinden von meiner database aber das funktioniert irgendwie nicht könnt ihr mir vielleicht helfen?
[PHP]
<?php // set your infomation. $dbhost='***.***.*.*' $dbusername='****' $dbuserpass='********' $dbname='****' $table='account' // connect to the mysql database server. mysql_connect ($dbhost, $dbusername, $dbuserpass) mysql_select_db($dbname) or die("Can not") //Are they just getting here or submitting their info? if (isset($_POST["username"])) { $username = $_POST["username"] $password = $_POST["password"] $cpassword = $_POST["cpassword"] $email = $_POST["email"] //Was a field left blank? if($username==NULL|$password==NULL|$cpassword==NULL|$email==NULL) { echo "A field was left blank." {else} //Do the passwords match? if($password!=$cpassword) { echo "Passwords do not match" }else{ //Has the username or email been used? $checkuser = mysql_query("SELECT username FROM $table WHERE username='$username')" $username_exist = mysql_num_rows($checkuser) $checkemail = mysql_query("SELECT email FROM $table WHERE email='$email')" $email_exist = mysql_num_rows($checkemail) if ($email_exist>0|$username_exist>0) { echo "The username or email is already in use" }else{ //Everything seems good, lets insert. $query = "INSERT INTO $table (username, password, email) VALUES('$username','$password','$email')" mysql_query($query) or die(mysql_error()) echo "The user $username has been successfully registered." } } } } ?> [/PHP]danke:D