I try to make a dynamic table. The data comes from a database. It works so far, but I want to make a table with seperate fields, not like my way. My code so far:
<?php
$result = mysql_query("SELECT buyTime, untilTime FROM users WHERE userName='".$_SESSION["user"]."';");
$num_rows = mysql_num_rows($result);
echo("Buy Date"."|Expire Date");
echo "<br />";
echo "<br />";
while ($row = mysql_fetch_array($result)) {
echo '<th>'.$row['buyTime'].'</th>'."|".'<th>'.$row['untilTime'].'</th>';
echo "<br />";
}
?>
The result:
So how can I make a correct table, not a pseudo one?
Thank you :)
Regards
mysqlfunctions for your own good (its depreciated in later PHP 5.6+). And also look into prepared statements when dealing with building the sql.