Hi

> OK, if I am extracting a row from a mysql DB where I know 
> that there is only ONE row:
> 
> $result = "SELECT company, fname, lname FROM table_name WHERE 
> id = \"$id\"
> ";
<snip>
> So my question, shouldn't I be able to use the variables 
> $company $fname $lname before the WHILE loop since I know 
> that there is only one record?

You have to make use of the mysql_result() function, the code would look
something like this:

$result = mysql_query("SELECT company, fname, lname FROM table_name WHERE id
= '$id'");

$company = mysql_result($result,"0","company");
$fname =  mysql_result($result,"0","fname");
$lname =  mysql_result($result,"0","lname");

Emil

-- 
Emil Rasmussen
http://www.noget.net

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to