kurt.santo Posted May 15, 2008 Share Posted May 15, 2008 I try to display the content of a field called first_name in a cell of a table. The query runs ok, but there is nothing displayed for the first_name. The code is as follows: $counties = "SELECT first_name,last_name FROM users WHERE user_id = 67";$result = mysqli_query ($dbc, $counties) or die ('Could not do a thing');?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Data test</title></head><body><table><tr><td width="300"><?php echo "<p>{$row['first_name']}</p>"; ?></td></tr></table></body></html> Checked my syntax in a book (echo "<p>{$row['first_name']}</p>"; ). Still, seems the problem lies in there... Any ideas where I go wrong?Kurt Link to comment Share on other sites More sharing options...
zppblood Posted May 15, 2008 Share Posted May 15, 2008 Insert this after $result=...$row=mysqli_fetch_assoc($result); Link to comment Share on other sites More sharing options...
kurt.santo Posted May 15, 2008 Author Share Posted May 15, 2008 Insert this after $result=...$row=mysqli_fetch_assoc($result);You certainly made my day! And I thought this was just for arrays...|-)Thanks a lot,Kurt Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.