开发者

PHP help with styling content from a database

I'm new to PHP as building a site for my company as a college project. I'm looking to style and split the text into two columns on the following page... http://c-hall.the-word.com/assignment/artwork.php Was wondering the best way to go about this. I get that some of this will be done using CSS, but as the text is pulled in from a database how do I split this into two columns? As for styling am I right in using for example <h1> tags etc in the text on the database?

Thanks for开发者_开发问答 your help - Charley


In what format is the text that you retrieve from the database? Here is a semi-pseudo-code that shows how to retrieve text from db and show it in two columns:

echo "<table>";
$result = mysql_query(...)
while($row = mysql_fetch_assoc($result))
{
    echo "<tr><td>" . $row['lefttext'] . "</td><td>" . $row['righttext'] . "</td></tr>";
}
echo "</table>";

Still we can't help you until we know in what format the retrieved text is.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜