Click to See Complete Forum and Search --> : Need some help displaying db values


rutledj
12-07-2005, 07:43 PM
I'm trying to display some data with a checkbox beside it. I don't think I have the single/double qoutes correct. Perhaps someone could explain.

Here is the code:

<?php
require_once('./db/mysql_connect.php');
$query = "SELECT * FROM prayerconcerns order by person";
$result = @mysql_query ($query);
$num_rows = mysql_num_rows ($result);

if ($num_rows > 0)
{
{
echo '<input type="checkbox" name="$row[0]" &nbsp value="$row[1]"';
}
mysql_free_result ($result);

mysql_close(); //close the database connection.
}
?>

All it does is displays a checkbox with nothing after it. $row[0] contains an id number and $row[1] contains a name.

Thanks,
Rut

chazzy
12-07-2005, 07:54 PM
you're not closing your tag here

echo '<input type="checkbox" name="$row[0]" value="$row[1]">';

and maybe use the php tags in your posts?