Jump to content

[SOLVED] sintax error


gevo12321

Recommended Posts

hi

 

i made this template that looks into a database and brings all the articles into a page than when u click on the article it opens it

 

but i think there is a syntax error because when i click on the article, nothing on the page changes except the url

 

can someone plz look and make sure that all my code is right

 

i would really appreciate it

 

thx

<?php
require_once('connect.php');
$articleID=$_GET['newsnumber'];
$query=mysql_query("SELECT * FROM news WHERE newsnumber=$articleID") or die(mysql_error());
$row=mysql_fetch_object($query);
$date1=$row->date;
$title=$row->title;
$news=$row->news;
$date=date('m-d-Y',strtotime($date1));
echo $title;
echo "<br>";
echo $date;
echo "<br>";
echo $news;
?>

<?php
require_once('connect.php');
$query=mysql_query("SELECT newsnumber,date,title FROM news ORDER BY date desc") or die(mysql_error());
while($row=mysql_fetch_object($query))
{
$date1=$row->date;
$title=$row->title;
$newsnumber=$row->newsnumber;
$date=date('m-d-Y',strtotime($date1));
echo "<a href=\"?article.php?newsnumber='$newsnumber'\">";
echo $date;
echo " ";
echo $title;
echo "</a>";
echo "<br>";
}
?>

 

thank you

Link to comment
https://forums.phpfreaks.com/topic/56895-solved-sintax-error/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.