Whenever I try this,
$conn = mysqli_connect(example.com,user,password,database);
I don’t know what I’m doing wrong. My php version is php 5.3.above. Why is this code not working in a live website. Its fine in localhost.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
should be
With
localhostyou are saying that PHP has to connect to the MySQL server that is running on the same server.Unless you are trying to connect to a remove MySQL server, then you’ll have to fill in the address of that remote server.