how to connect my php code to sql
this is my code where is the problem??? ,is the localhost name is true
i am abeginner and this is my first try in php and sql
how to connect my php code to sql
this is my code where is the problem??? ,is the localhost name is true
i am abeginner and this is my first try in php and sql
If you wana use mysql(); then you have to downgrade your PHP version to 5.6
cPanel>Settings>General
this is not my problem ,my problem in the host name should i put local host but idont know the local host name to the website
localhost is correct
I put the localhost, username and password all correct
When I make run to the program on my computer it works without any problems, but when i uploaded it to another website it didn’t work at all
Where is the problem could be???
Thanks…
Try using this code
<?php
if(mysqli_connect('localhost','DBUSER','DBPASS','DBNAME')){
echo "Connected";
}else{
echo "failed";
}
Thank you and apologize for bothering you