Using a MySQL query result in the value of a form
Posted: Mon Nov 22, 2004 3:42 pm
Ok I am trying to create a page where people can edit the entry in the db. When I run the code, I only get the first word of the varchar from the db.
The $row[1] should return the description of the task such as "Enter the new values into the db", only all I get back is "Enter". Why doesn't it return the entire string? The PrjDesc var works fine, and they are the same type in the MySQL db.
Thanks for any help you can give!
Xt07t
Code: Select all
<?php
include'func.php';
$id = $_GETї'ID'];
$query_string = "SELECT * FROM PRJtrack WHERE id='$id'";
$result = mysql_query($query_string,$global_dbh) or die(mysql_error());
// Create the table and the headers to go across the top.
print("<TABLE BORDER=1 WIDTH=100%>\n");
while ($row = mysql_fetch_array($result))
{
print("<tr><th>Project Number</th><td><input type=text name=PrjNum value=$rowї1] Size=20 MAXLENGTH=50></td></tr>
<tr><th>Project Description</th><td>$rowї2]</td></tr>
<tr><th>Cacti Status</th>
<tr><th>Orion Status</th>
<tr><th>Tacacs Status</th>
<tr><th>CW Status</th>
<tr><th>Edit</th>
<tr><th>Delete</th>
<tr><th>Complete</th></tr>");
}
?>Thanks for any help you can give!
Xt07t