Hi, all,
As a result of trying to resolve an issue in the Newbies forum, I have actually learned a few things (bonus!) - one of which is you don't have to use this
$result = mysql_query("SELECT * FROM table_name LIMIT 1");
while ($row = mysql_fetch_array($result))
{
$var = $row['column_name'];
}
when you want one item only as a result of your query. Another way to get the results you seek is to use this
$query = mysql_query("SELECT column_name FROM table_name LIMIT 1");
$result = mysql_result($query,0);
instead.
Just for any other newbies out there who may be wondering how to select a single item from a table.
EDIT: I was using the label 'row_name' when I should have been using 'column-name.' Whoops.