problem with print and $row
Posted: Sat Nov 04, 2006 6:34 pm
Ok, I'm trying to take the customerID from my database and then include it in the link to my next page. The below code works, but I dont know the print function well enough to modify it. As it is, that prints out my records all on one line and all squashed together, not very attractive 
If someone with good knowledge of the print function could show me how to display the data logically with a coresponding label whilst preserving the current functionality that would be fantastic. The records, in the order theyre queried, are shown below.
Customer ID First Name Surname User Name Email Password
Thanks in advance for any help people.
If someone with good knowledge of the print function could show me how to display the data logically with a coresponding label whilst preserving the current functionality that would be fantastic. The records, in the order theyre queried, are shown below.
Customer ID First Name Surname User Name Email Password
Thanks in advance for any help people.
Code: Select all
//Fetch each of the query rows in $result array
while ($row = @ mysql_fetch_array($result))
{
// Print one row of results
print "<tr>" .
"<td>" . $row["CustomerID"] . "</td>" .
"<td>" . $row["Firstnames"] . "</td>" .
"<td>" . $row["Surname"] . "</td>" .
"<td>" . $row["Username"] . "</td>" .
"<td>" . $row["Email"] . "</td>" .
"<td>" . $row["Password"] . "</td>" .
//print a change/delete link at the end of each row
"<td><a href=editdetails.php?id=".$row[0].">Change/Delete</a></td>";
"</tr>";
}
// Then, finish the table
print "</table>";
?>