<div class="ui-widget">
<form method="POST">
<?php
if(isset($_POST['search'])){
$connection = mysql_connect('localhost', 'root', '1234');
mysql_select_db('hoppers');
$query = "SELECT user_name FROM users WHERE {$_POST['username']} = user_name";
$result = mysql_query($query) or die ("MySQL-Error: " . mysql_error());
$row = mysql_fetch_array($result);
if($row = TRUE){
$present = $row['user_name'];
echo $present;
}else{
echo "This User does not exist!";
}
}
?>
<label for="tags">Username: </label>
<input type="text" id="tags" name = "username">
<input type="submit" name="search" value="Suchen!">
</form>
</div>
So I'm always getting the this error-message: MySQL-Error: Unknown column 'dompol171' in 'where clause'.
So it is comparing the username that I entered with the column "user_name" itself. I keep freaking out...since I have no clue how to compare it in a different way!