I have created a website for my versity project...But I am asked to add a database in it..That's why I need to know how to add a database via xamp in a website.
1条回答 默认 最新
douling8087 2017-11-27 09:33关注Use this code to create a connection to your database from php
<?php $servername = "localhost"; $username = "root"; $password ="db-password"; $dbname = "db-name"; //create connection $conn = new mysqli($servername,$username,$password,$dbname); //check connection if ($conn->connect_error) { die("connection failed" .$conn->$connect_error); } ?>use this link to understand how to create and execute queries.
解决 无用评论 打赏 举报