I'm sure this is very simple - I'm just trying to query mysql and return the row that matches the last name entered into a HTML form - this works when the input (and query) is an integer, but not when I try to use the last name (Lname) Any idea's (i'm very very new to PHP and coding....)
<form name "namelookup" form action='main2test.php' method="post">
Last name: <input type="text" name="Lname" /><br />
<input type="submit" value="Submit" />
</form>
<?php
$Lname=$_POST['Lname'];
// sending query
$result = mysql_query("SELECT * FROM {$table} WHERE `Lname`=$Lname");
if (!$result) {
die("Query to show fields from table failed");
}