How to connect MySQL to PHP? -


so i'm brand spanking new mysql , php.

i'm set mysql workbench , i'm practicing building site using notepad++ , run through chrome. want create sign page, i'm assuming use .php page on site, username , password. that's it. can't seem find tutorials on how connect mysql .php page, or how create sign in page. appreciated!

welcome php!

typically connection established on php page along lines of this:

$conn = mysqli_connect("localhost","[username]","[password]","[databasename]") or die("error " . mysqli_error($conn));  

the "or die" produce error if there's problem establishing connection. also, uses newer "mysqli_" method connection; make sure when call connection in future use mysqli_ methods (there still traditional "mysql_" methods available, depreciated).

hope helps!

m


Comments

Popular posts from this blog

c++ - Delete matches in OpenCV (Keypoints and descriptors) -

java - Could not locate OpenAL library -

sorting - opencl Bitonic sort with 64 bits keys -