Hi! Could someone help to find the error on line 11? I would very appreciate your help! <?php require("header.php"); $sql="SELECT entries.*, categories.cat FROM entries, categories WHERE entries.cat_id=categories.id ORDER BY dateposted DESC LIMIT 1 $result=mysql_query($sql); $row=mysql_fetch_assoc($result); echo "<h2><a href='viewentry.php?id=".$row['id']."'> ".$row['subject']. "</a></h2><br />"; echo "<i> In <a href='viewcat.php?id=".$row['cat_id']. "'> ".$row['cat']." "</a> - Posted on" .date("D jS F Y g.iA", strtontime($row['dateposted']))."</i>"; echo "<p>"; require("footer.php"); ?>
Try this <?php require ("header.php"); $sql = "SELECT entries.*, categories.cat FROM entries, categories WHERE entries.cat_id=categories.id ORDER BY dateposted DESC LIMIT 1"; $result=mysql_query($sql); $row=mysql_fetch_assoc($result); echo " < h2 > < a href = 'viewentry.php?id=".$row['id']."' > ".$row['subject']. " < / a > < / h2 > < br / > "; echo " < i > In < a href = 'viewcat.php?id=".$row['cat_id']. "' > ".$row['cat']."</a> - Posted on".date("D jS F Y g.iA", strtontime($row['dateposted'])). "</i>"; echo "<p>"; require ("footer.php"); ?> PHP:
Thanks, very very much for help. But now I just see a plain white page without anything. Of course, it is better than parse error.
I improved a bot. But now this happens: [home] < h2 > < a href = 'viewentry.php?id=1' > Welcome to my blog! < / a > < / h2 > < br / > Fatal error: Call to undefined function strtontime() in C:\xampp\htdocs\Blog\index.php on line 12 Any helpful suggestions?
Well strtontime isn't a function as the error clearly states You need to read some of the manual. These are simple errors, and it tells you the problem in plain english
Now it works, but the output is not what was expected: < h2 > < a href = 'viewentry.php?id=1' > Welcome to my blog! < / a > < / h2 > < br / > < i > In < a href = 'viewcat.php?id=1' > Life - Posted onSun 27th December 2009 1.53PM