Answers for "use mysql in php"

PHP
1

using mysql database with php

<?php
$servername = "localhost";
$username = "yourusername"; // For MYSQL the predifined username is root
$password = "yourpassword"; // For MYSQL the predifined password is " "(blank)

// Create connection
$conn = new mysqli($servername, $username, $password);

 
// Check connection

 if ($conn->connect_error) {

    die("Connection failed: " . $conn->connect_error);
}

echo "Connected successfully";

?>
Posted by: Guest on June-01-2020
1

php mysql

In order to send data to a databse securely use prepared statements otherwise 
you can get attacked by an SQL Injection easily.
----
https://www.w3schools.com/php/php_mysql_prepared_statements.asp
Posted by: Guest on October-28-2020

Browse Popular Code Answers by Language