Jump to content

[SOLVED] Making tables with sql data.


$username

Recommended Posts

Hello Ladies and Gents,

    I have a new issue.

 

I have a piece of code that throws my tables off.

 

while($row = mysql_fetch_array($query)) {
echo "<tr>";
echo("<td><a href=\"updateinfo.php?ID=" .  $row["ID"] . "\" title=\"".$row["ID"]."\">" . $row["ID"] .  "</a><td>"); 
echo "<td>".$row['FirstName']."</td>";
echo "<td>".$row['LastName']."</td>";
echo "<td>".$row['AddressStreet']."</td>";
echo "<td>".$row['AddressCity']."</td>";
echo "<td>".$row['AddressState']."</td>";
echo "<td>".$row['AddressZip']."</td>";
echo "<td>".$row['Paid']."</td>";
echo "<td>".$row['Amount']."</td>";
echo "<td>".$row['CaseNotes1']."</td>";
echo "<td>".$row['CaseNotes2']."</td>";
echo "<td>".$row['CaseNotes3']."</td>";
echo "<td>".$row['CaseNotes4']."</td>";
echo "<td>".$row['OtherInfo']."</td>";
echo "<td>".$row['ServBy']."</td>";
echo "<td>".$row['ClientName']."</td>";
echo "<td>".$row['County']."</td>";
echo "<td>".$row['ServDate']."</td>";
echo "</tr>";
}

?>

 

When I take out the link generator on the second line, then my tables line up. When the 3 lines is in there is throws everything off.

 

echo("<td><a href=\"updateinfo.php?ID=" .  $row["ID"] . "\" title=\"".$row["ID"]."\">" . $row["ID"] .  "</a><td>"); 

 

Here is a pic of what it looks like.

 

tabbleoff.JPG

 

When I don't have that code in there it looks like this.

 

echo "<td>".$row['ID']."</td>";

 

tablesoff2.JPG

 

Is there something I can do that would make the code work with in one table.

 

Thanks,

Brett

 

 

 

Link to comment
Share on other sites

Beat to it :P

 

Your not closing the <td>

 

Change:

echo("<td><a href=\"updateinfo.php?ID=" .  $row["ID"] . "\" title=\"".$row["ID"]."\">" . $row["ID"] .  "</a><td>"); 

 

To:

echo("<td><a href=\"updateinfo.php?ID=" .  $row["ID"] . "\" title=\"".$row["ID"]."\">" . $row["ID"] .  "</a></td>"); 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.