I want to search for data in a database using data from PHP
for example:
<?php
$con = mysql_connect("localhost", "root");
if (!$con){
die('Could not connect: ' . mysql_error());
}
mysql_select_db("UsersDB", $con);
$name = "Jack"
$result = mysql_query("SELECT Username
FROM Users
WHERE Username = $name", $con);
echo $result;
mysql_close($con);
?>
But that doesn't work.
Is it possible to use $name
in the select statement?