Forum Moderators: coopster
<?phpmysql_select_db(database);
$query = "SELECT * FROM tag ORDER BY rand() LIMIT 50";
$result = mysql_query($query);
while ($row = mysql_fetch_array($result)) {
echo ($row['tag']).(" ");
}
mysql_free_result($result);
mysql_close();
?>
something like this,
<a href="http://www.example.com/<?php echo ($row['tag']);?>.html"><?php echo ($row['tag']);?></a>
Thanks in advance.
[edited by: dreamcatcher at 3:28 pm (utc) on Oct. 11, 2007]
[edit reason] Use example.com, thanks. [/edit]
while ($row = mysql_fetch_array($result)) {
echo '<a href="http://www.example.com/'.$row['tag'].'.html">'.$row['tag']).'</a>';
}
Parse error: syntax error, unexpected ')', expecting ',' or ';' in C:\xampp\htdocs\php\t.php on line 11
-----
Update,
I removed the ) and it's working now, thanks alot.
[edited by: asson at 8:49 pm (utc) on Oct. 11, 2007]
echo '<a href="http://www.example.com/'.$row['tag'].'.html">'.$row['tag'].'</a>';
try that one :)