Nothadoth
06-28-2006, 04:54 PM
I know that I am probably annoying you guys with all my problems, and i'm sorry, but I would appreciate it if you could point me in the right direction with this.
I am using the WHERE function to connect to my database and show the news item where the news id is equal to $id.
However, when I do it it messes up the script. Look: View news page (http://www.finalfantasyfan.net/sitenews.php?id=1)
This is the code I am using.
mysql_connect('localhost','noth','pass');
mysql_select_db('noth_phpb1');
$query = mysql_query("SELECT * FROM sitenews WHERE 'id'='".$_GET['id']."'");
while($news = mysql_fetch_array($query)) {
if( $_GET['id'] == "" ) {
print "Error: You have not specified a correct news article. Please go back and try again.";
} else {
print "<font size='1'><font color='#D0D0D0'>".$news['title']." (".$news['date_day']."/".$news['date_month']."/".$news['date_year'].")</font><br>
".$news['smalltext']."<br>
<div align='right'><font color='#D0D0D0'>
<a href='http://www.finalfantasyfan.net/sitenews.php?id=".$news['id']."' style='text-decoration: none'>[Read More]</a></font></div><br></font>";
}
Thank you.
I am using the WHERE function to connect to my database and show the news item where the news id is equal to $id.
However, when I do it it messes up the script. Look: View news page (http://www.finalfantasyfan.net/sitenews.php?id=1)
This is the code I am using.
mysql_connect('localhost','noth','pass');
mysql_select_db('noth_phpb1');
$query = mysql_query("SELECT * FROM sitenews WHERE 'id'='".$_GET['id']."'");
while($news = mysql_fetch_array($query)) {
if( $_GET['id'] == "" ) {
print "Error: You have not specified a correct news article. Please go back and try again.";
} else {
print "<font size='1'><font color='#D0D0D0'>".$news['title']." (".$news['date_day']."/".$news['date_month']."/".$news['date_year'].")</font><br>
".$news['smalltext']."<br>
<div align='right'><font color='#D0D0D0'>
<a href='http://www.finalfantasyfan.net/sitenews.php?id=".$news['id']."' style='text-decoration: none'>[Read More]</a></font></div><br></font>";
}
Thank you.