I have this code:
<?php
$mysql_host='localhost';
$mysql_user='root';
$mysql_password='you cant know mypassword';
mysql_connect($mysql_host,$mysql_user,$mysql_password);
@mysql_select_db('attempt');
?>
<?php
$sql="IF NOT EXISTS ( SELECT person FROM kid WHERE Subs=45 )
BEGIN
echo 'hey'
END"
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
if ($conn->query($sql) === TRUE) {
echo "Done";
} else {
echo "Error: " . $sql . "<br>" . $conn->error;
}
?>
The php page is supposed to echo'hey' because no such record exists but the page itself is not even loading at all but returning a HTTP localhost 500 error saying that localhost cannot handle the request.
I know I'm doing something wrong but I'm not sure exactly what.Please help