im adding some values to my table in mysql to test it but nothing happens. it doesnt even give me an error.
<?php
//get values from index.php
$lecturerid = $_POST['studentid'];
$password = $_POST['Pass'];
// Create connection
$conn = mysqli_connect("localhost", "root", "", "coursework");
// Check connection
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
echo "Connected successfully";
$sql = "INSERT INTO studentlogin (studentid, password)
VALUES ('John', 'Doe')";
?>
can anyone tell me why.
mysqli::prepare()(php.net/mysqli.prepare) /mysqli::query()(php.net/mysqli.query)mysqli::prepare()if you're using variables in the query,mysqli::query()can be used for static queries.