Hi, can anyone see why this "or die" statement at the end isn't working when someone enters a name that isn't found? Right now if you put in a name that isn't in the database, the page just returns blank. And I would like an error to appear.
<?php
$con = mysql_connect("mysql","test","password")
OR die('Could not connect: ' . mysql_error());
mysql_select_db("test", $con) OR die(mysql_error());
if(!$POST){?><form action="" method="post>
<input type="text" size="12" name="name" value="<?=$POST['name'] ?>" /> <input type="submit" style="width:107px" value="Check name" /></form><?}
else{$modify = mysql_real_escape_string($_POST['name']);
$query = "SELECT name FROM checkname WHERE name = '$modify'";
$result = mysql_query($query) or die('Error in name.' . mysql_error());
The just above "or die," error after the query, won't appear, when a name in the database isn't found. Need to fix it. Thank you very much.