View Full Version : MySQL and PHP Database question

11-29-2010, 06:09 PM
Hi all,

Just wandering how i would go about showing the database entry with the same ID number as the value of a variable.

Lets for now say this said variable is called $Current_Item.

If $Current_Item = 5, i want to show the Database record with the ID number 5.

I know how to echo the values of the database, but i cant seem to work this out.

Any help is greatly appreciated! Thanks.

11-29-2010, 06:31 PM
you probably have to concatenate the value out of the statement, maybe like:
$sql = "select whatever from table where field = '" . $current_item . "'";I believe that's only for strings though.