Before you echo-ing the above xml template, you must do the following step:
- connect to database
- send query to database
- fetch the query result
Here is a direction taken from php manual, I hope you can understand the logic here:
PHP Code:
<?
// connect db
mysql_connect('localhost', 'mysql_user', 'mysql_password');
mysql_select_db('indexu_database_name');
// send query
$query = "select * from idx_link";
$result = mysql_query($query);
// fetch
while ($row = mysql_fetch_assoc($result)) {
echo $row["link_id"];
echo $row["title"];
echo $row["url"];
}
?>