php - Trying to create MySQL database gives HTTP/404 The requested URL alias not defined -


I am having a small problem and I need the help of more experienced people.

I am trying to create a MySQL database with PHP code, but I am getting this message: "Requested URL Surname for HTTP / 404C: Apache 24 / HTTox / TestSite_01 / Database Error creating: Access denied for user '@' local host 'database is not defined' testbase_db '. "

I have Apache, PHP and MySQL installed on my home PC and Apache and MySQL is starting up and running. I have tried to check the httpd.conf file of Apache, but I'm quite new to this server stuff and I'm not sure there is something in it, I should change it, or add to the problem disappear.

The default Apache htdocs folder for files I use and a specific folder called this is a sub folder named testite_01. However, this should not be a problem because it gives the same message when everything runs in the root root folder and tries to run from there. I have tried Googling and have read a lot of things elsewhere, but have not received any answers so far.

It is such that my PHP code looks to create a database.

  create a function_db () {$ con = mysqli_connect ("localhost", "", ""); If (mysqli_connect_errno ()) {echo "failed to connect to the database:". Mysqli_connect_error (); } $ Sql ​​= "make database testbase_db"; If (mysqli_query ($ conn, $ sql)) {resonant "created database successfully"; } Else {echo "Error creating database:" Mysqli_error ($ thief); }}  

You have to connect to the database on the machine, not the file.

$ con = mysqli_connect ("localhost", "", "");

Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -