darbok Posted February 27, 2017 Share Posted February 27, 2017 <?php $con = mysqli_connect("localhost","mark","library","markdb"); // Check connection if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } $sql = "INSERT INTO UserNames (FirstName, LastName) VALUES ('John', 'Doe')"; if ($conn->query($sql) === TRUE) { echo "New record created successfully"; } else { echo "Error: " . $sql . "<br>" . $conn->error; } $conn->close(); ?> i have my table set to varchar (16) Link to comment Share on other sites More sharing options...
thescientist Posted February 27, 2017 Share Posted February 27, 2017 what's your question? Link to comment Share on other sites More sharing options...
darbok Posted February 28, 2017 Author Share Posted February 28, 2017 I feel stupid, I can't figure out why i kept getting the error message "is currently unable to handle this request." Link to comment Share on other sites More sharing options...
justsomeguy Posted February 28, 2017 Share Posted February 28, 2017 Add this to the top of your code and see if it gives a better error message: ini_set('display_errors', 1); error_reporting(E_ALL); 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