Hey guys,
Well I've been working on my fan site a lot lately, but I have run into a problem.
I want the site to display info about in-game items in a table. I have entered all the data to go in the table in a MySQL database. Then I used PHP to enter the data into my table. Works perfect, except.... I need to make the table look nice, but if I try to add things like align="center" into the <td> tag, it gets messed up by the quotes because I am using the echo function to write the tables.
http://kd91.x10hosting.com/rappelz/page2.php <- My tables with info
And here's a snippet of my code to help communicate what I am talking about:
See how if I add the align="center" to the <div> tag that it would mess up the echo?
Is there a way for me to do things like center the data and change the properties of the table cell?
Well I've been working on my fan site a lot lately, but I have run into a problem.
I want the site to display info about in-game items in a table. I have entered all the data to go in the table in a MySQL database. Then I used PHP to enter the data into my table. Works perfect, except.... I need to make the table look nice, but if I try to add things like align="center" into the <td> tag, it gets messed up by the quotes because I am using the echo function to write the tables.
http://kd91.x10hosting.com/rappelz/page2.php <- My tables with info
And here's a snippet of my code to help communicate what I am talking about:
PHP:
<?php
$result = mysql_query(
"SELECT * FROM weapons WHERE weap_id='1'");
if (!$result) {
echo("<P>Error performing query: " .
mysql_error() . "</P>");
exit();
}
while ( $row = mysql_fetch_array($result) ) {
echo "<tr>";
echo "<td><div>1</div></td>";
echo "<td><div>".$row['weap_1patck']."</div></td>";
echo "<td><div>".$row['weap_1matck']."</div></td>";
echo "<td><div>".$row['weap_1spd']."</div></td>";
echo "<td><div>".$row['weap_1cost']."</div></td>";
echo "</tr>";
echo "<tr>";
Is there a way for me to do things like center the data and change the properties of the table cell?