Jump to content

Display of individual data from db


kurt.santo

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...