Search found 2 matches

by swibit
Sun Dec 02, 2012 1:41 am
Forum: PHP
Topic: PHP Blog Query
Replies: 3
Views: 1090

Re: PHP Blog Query

So the code should now be like this? function get_posts() { $sql = "SELECT `posts`.`post_id` AS `id`, `posts`.`post_title` AS `title`, LEFT(`posts.post_body`, 512) AS `preview`, `posts`.`post_user` AS `user`, DATE_FORMAT(`posts`.`post_date`, `%d/%m/%Y %H:%i:%s`) AS `date`, `comments`.`total_com...
by swibit
Fri Nov 30, 2012 6:39 pm
Forum: PHP
Topic: PHP Blog Query
Replies: 3
Views: 1090

PHP Blog Query

I've been following the blog with commenting tutorial but when it comes to the get posts query, I get the error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '$sql= "SELECT 'posts'.'post_id' AS id, 'posts'....