Forum Moderators: coopster
<?php
$db=mysql_connect("localhost","#*$!","#*$!");
mysql_select_db("xxx", $db);
$result=mysql_query("SELECT * FROM presse ORDER BY datum DESC LIMIT 30", $db);
for($i=0; $i<mysql_num_rows($result); $i++)
{
$presse[$i]=mysql_fetch_object($result);
}
echo "<table border=\"0\">";
for($i=0; $i<mysql_num_rows($result); $i++)
{
echo "<tr>",
"<td>",
$presse[$i]->zeitung,
"</td>",
"<td>",
nl2br($presse[$i]->headline),
"</td>",
"<td>",
substr($presse[$i]->datum, 8, 2),
".",
substr($presse[$i]->datum, 5, 2),
".",
substr($presse[$i]->datum, 0, 4),
" ",
substr($presse[$i]->datum, 10),
"</td>",
"</tr>";
}
?>
This works, but it is not quite what I want. The fourth row in the db-table is the url which belongs to the set of data. I want, that when you klick on the headline, which has been given out, that you get to the url. I donīt see how i can do it and iīm not sure whether i can do it this way. I hope you can help me...
"<a href=\"" . $presse[$i]->url . "\" target="_blank">" ,
nl2br($presse[$i]->headline),
"</a>",
but as a consequence of that it gives me this error:
Parse error: parse error, unexpected T_STRING, expecting ',' or ';' in "#*$!" on line 60
where do I have to put in the target thing?