Whats wrong with my SQL syntax?

  • RedBMedia
  • Proficient
  • Proficient
  • User avatar
  • Joined: May 01, 2007
  • Posts: 315
  • Status: Offline

Post March 3rd, 2009, 11:47 am

Can you tell me whats wrong here???

Code: [ Select ]
SELECT count( * ) AS COUNTER, DATE( date ) AS DATER FROM results WHERE feedid = '$feedid' AND date >= '$dateFrom 00:00:00' AND date <= '$dateTo 23:59:59' GROUP BY DATE( date )


$feedid, $dateFrom, and $dateTo are all variables filled previously with PHP. Have any ideas!? I am lost!
Joe Hall
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post March 3rd, 2009, 11:47 am

  • joebert
  • Sledgehammer
  • Genius
  • No Avatar
  • Joined: Feb 10, 2004
  • Posts: 13455
  • Loc: Florida
  • Status: Offline

Post March 3rd, 2009, 12:18 pm

What does the error retrieval function of the PHP SQL extension you're using say is wrong with it ?
Strong with this one, the sudo is.
  • RedBMedia
  • Proficient
  • Proficient
  • User avatar
  • Joined: May 01, 2007
  • Posts: 315
  • Status: Offline

Post March 3rd, 2009, 12:26 pm

its not returning any errors, just no content. When I run this query in phpMyAdmin it works great! but its not working in my script.
Joe Hall
  • joebert
  • Sledgehammer
  • Genius
  • No Avatar
  • Joined: Feb 10, 2004
  • Posts: 13455
  • Loc: Florida
  • Status: Offline

Post March 3rd, 2009, 12:32 pm

When you run it in phpMyAdmin are you using a copy printed from within your application which includes values that are actually being used, or did you enter values you knew were going to be good ?
Strong with this one, the sudo is.
  • RedBMedia
  • Proficient
  • Proficient
  • User avatar
  • Joined: May 01, 2007
  • Posts: 315
  • Status: Offline

Post March 3rd, 2009, 1:17 pm

problem solved! one of the varibles wasn't filled correctly in the same function that the sql call was being made! Thanks for your help anyways!
Joe Hall
  • joebert
  • Sledgehammer
  • Genius
  • No Avatar
  • Joined: Feb 10, 2004
  • Posts: 13455
  • Loc: Florida
  • Status: Offline

Post March 3rd, 2009, 1:19 pm

Certainly. :)
Strong with this one, the sudo is.

Post Information

  • Total Posts in this topic: 6 posts
  • Users browsing this forum: No registered users and 236 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.