pls help me fix sql error

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    pls help me fix sql error

    SQLSTATE[42000]: Syntax error or access violation: 1064 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 '` DESC limit 0, 5' at line 1
    Raw SQL : SELECT a.A_countrycode, a.A_id, a.A_country
    FROM AOG_members a INNER JOIN AOG_online b ON a.A_id = b.A_mid ORDER BY b.A_time` DESC limit 0, 5

    #2
    There a space or can be wrong value ..

    try to cut the space like limit 0,5 ( example )
    Visit: Chat4u.mobi - The New Lay Of being a site of your dreams!
    Visit: WapMasterz Coming Back Soon!
    _______
    SCRIPTS FOR SALE BY SUBZERO
    Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders.
    FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others...
    _______
    Info & Tips
    php.net
    w3schools.com

    Comment


      #3
      Thank
      it is fixed but i have another error again!

      Code:
      Time : 08:52:05
      SQLSTATE[HY093]: Invalid parameter number
      Raw SQL : SELECT COUNT(*) FROM `AOG_friends` WHERE ((`A_mid` = :id AND `A_to` = :to) OR (`A_mid` = :to AND `A_to` = :id)) AND `A_accepted` = 'yes'
      Added after 3 minutes:

      Real codes/script part

      PHP Code:
      $AOG_re $this->AOG_db->AOG_single("SELECT COUNT(*) FROM `AOG_friends` WHERE ((`A_mid` = :id AND `A_to` = :to) OR (`A_mid` = :to AND `A_to` = :id)) AND `A_accepted` = 'yes'", array('id'=>"$AOG_mid"'to'=>"$AOG_to")); 
      Last edited by arnage; 05.03.14, 13:45.

      Comment


        #4
        at a guess (without seeing what is defined in rest of script)
        PHP Code:
        $AOG_re $this->AOG_db->AOG_single("SELECT COUNT(*) FROM `AOG_friends` WHERE ((`A_mid` == $AOG_mid AND `A_to` == $AOG_to) OR (`A_mid` == $AOG_to AND `A_to` == $AOG_mid)) AND `A_accepted` == 'yes'"); 
        Last edited by something else; 04.03.14, 10:24.

        Comment


          #5
          Do you know that i using pdo to access my db for most security. What about the array to set the parameter

          i know that your above code will work but not most secure

          Comment

          Working...
          X