Hi all, I am going crazy with this issue. When I want to lookup a row in a table on a MySQL databse like so:
[php]$search=“MadLife”;
$res = mysqli_query($mysqli, “SELECT * FROM Players WHERE player = $search”);
$row = mysqli_fetch_assoc($res);
echo $row[‘player_portrait’];[/php]
I get the following error:
However when I alter it to this:
[php]$search=“MadLife”;
$res = mysqli_query($mysqli, “SELECT * FROM Players WHERE player = ‘MadLife’”);
$row = mysqli_fetch_assoc($res);
echo $row[‘player_portrait’];[/php]
it works! >:(
Any ideas why I am having issues please? The column on the table is set to varchar(30).
I have used the following before and it worked fine!:
[php]$result = mysql_query(“SELECT * FROM item_table WHERE item_number = $search_query”);[/php]
Thanks