[ul]Sorry if this is a dumb question, but I have adapted a forum post query code in hopes to have all new forum posts appear on my homepage. This code appears to be connecting to the mysql server and database properly but is not fetching data properly. I receive the following code from using “mysql_error()”…"Parse error: syntax error, unexpected T_WHILE in C:\wamp\www\index.php on line 88>
Im currently using wamp server with FluxBB running
MYSQL Version: 5.5.24
PHP (with phpMyAdmin) Version: 5.5.13
This is more likely due to improper PHP version but here is the code anyway. Hopefully someone can help me!
[php] <?php
$db = mysql_connect("localhost", "*****", "*********");
mysql_select_db(“forum”,$db);
$result = mysql_query(“SELECT * FROM Requests”,$db);
$server = ‘localhost’; // server location
$user = ‘’; // db username
$password = '****’; // db password
$db = ‘forum’; // db name
$link = mysql_connect("$server", “$user”, “$password”);
mysql_select_db("$db");
//
//
$query = “select destinct t.topics_id, t.topic_title
from posts p, topics t
where p.topic_id = t.topic_id
order by p.post_time desc
limit 10”;
$result = mysql_query($query);
//
//
print “
- ”;
while ($row = mysql_fetch_assoc($result)) {
$topic_id = $row[‘topic_id’];
$topic_title = $row[‘topic_title’];
print “[*]<a href=/forum/viewtopic.php?t=$topic_id”>$topic_title";
}
print "[/ul]
";
?>[/php]
Thanks in advance.