I have only a little experience in interfacing PHP with MySQL, I'm trying to grab a single value from a database, specifically the name of an item stored with its details, in the following code I attempt to call the items name from the [Part_Name] column, for the given ID number in [PartID].
$query = "SELECT `Part_Name` FROM `".$list."` WHERE `PartID` = ".$partid.";";
$itemname = mysql_result(mysql_query($query), 0, 0);
echo "<p>This will delete the item: ";
echo $itemname;
echo ". Are you sure you want to do this?</p>";
The resulting line says: [This will delete the item: . Are you sure you want to do this?].
----------
Also, I tested that MySQL line and it output this:
+-----------+
| Part_Name |
+-----------+
| screen |
+-----------+
if that helps at all, I've tried changing the row and field values in mysql_result() but haven't had any success, am I using it wrong?
----------
Can anyone point me in the right direction? Thanks