edward1111 Posted December 31, 2014 Share Posted December 31, 2014 I am trying to connect to my database on xammp, Im trying to find info how to connect and set up for people that sign in to my website they can regsiter for it. Quote Link to comment Share on other sites More sharing options...
requinix Posted December 31, 2014 Share Posted December 31, 2014 Okay. Do you have any code yet? What is it? Is there a problem? How is it not working? Quote Link to comment Share on other sites More sharing options...
edward1111 Posted December 31, 2014 Author Share Posted December 31, 2014 Okay. Do you have any code yet? What is it? Is there a problem? How is it not working? yeah I started it. ill upload give me a few mins. Quote Link to comment Share on other sites More sharing options...
edward1111 Posted January 1, 2015 Author Share Posted January 1, 2015 <?php$servername = "localhost";$username = "username";$password = "password";$dbname = "myguests";// Create connection$conn = new mysqli($servername, $username, $password, $dbname);// Check connectionif ($conn->connect_error) { die("Connection failed: " . $conn->connect_error);}// sql to create table$sql = "CREATE TABLE MyGuests (id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY,firstname VARCHAR(30) NOT NULL,lastname VARCHAR(30) NOT NULL,email VARCHAR(50),reg_date TIMESTAMP)";if ($conn->query($sql) === TRUE) { echo "Table MyGuests created successfully";} else { echo "Error creating table: " . $conn->error;}$conn->close();?> Quote Link to comment Share on other sites More sharing options...
Frank_b Posted January 1, 2015 Share Posted January 1, 2015 and your problem is? do you get any errors? if you dont see errors: enter this at the beginning of your code: error_reporting(E_ALL); ini_set('display_errors', '1'); 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.