Hi I am trying to select a row of data in my database using a select statement but want to use a where clause to select a row that matches a pre-defined variable. the code I am using looks like this:
$counter = 1;
$result = mysqli_query($link, ‘SELECT txtBagName FROM tblBag where lngBagID = $counter’);
while ($row =mysqli_fetch_array($result))
{
$names=$row[‘txtBagName’];
}
the problem I get is that when I run this I get a message saying something like unknown column $counter.
My aim with this is so that I can display different rows of information in a database when a user clicks a next button.
I am guessing that there is a very simple way to do this and I am barking up the wrong tree with what I am doing so any help would be appreciated. (I am completely new to php and have just started reading Kevin Yank’s book!)
many thanks
Hayden