If I change the 'compname's to 'compid' it works but its not that use friendly to delete a record using a number instead of a name
company_form.php
<form action="company_delete.php" method="get">
<div id="centre">
<p>Name:<br /><input name="compname" type="text"></p>
<input name="Delete" type="submit" value="Delete">
</div>
</form>
company_delete.php
<?php
require "connect.php";
$compname = $_GET['compname'];
$query = "delete from company where compname = $compname";
$result = @mysql_query($query, $connection)
or die ("Unable to perform query<br>$query".mysql_error());
header("Location: company_page.php");
exit();
?>
I can't get my head around why this works with compid but not compname, it would be great if someone could help me out and explain why this happens