You have an error in your SQL syntax problem

 

Results 1 to 6 of 6
You have an error in your SQL syntax; check the manual that corresponds to your ...
  1. #1
    keysikg is offline Regular Member
    Join Date
    May 2012
    Posts
    200
    Thanks
    29
    Thanked 84 Times in 40 Posts

    Default You have an error in your SQL syntax problem

    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 'https://s-static.ak.fbcdn.net/common/error.png') top center ' at line 1

    I am getting this error on my website. Any way to fix it? It is really frustrating, I am trying to get my website to work for 3 days,and now this thing shows....




  2. #2
    innozemec's Avatar
    innozemec is offline ★★ InstantLinkIndexer.com
    Join Date
    Aug 2011
    Location
    www.Indexification.com
    Posts
    4,845
    Thanks
    1,281
    Thanked 1,608 Times in 1,269 Posts
    Blog Entries
    4

    Default Re: You have an error in your SQL syntax problem

    you are not escaping ' symbols in your query. Simply edit your source code and escape your variable with mysql_real_escape_string()
    if you use php

  3. #3
    keysikg is offline Regular Member
    Join Date
    May 2012
    Posts
    200
    Thanks
    29
    Thanked 84 Times in 40 Posts

    Default Re: You have an error in your SQL syntax problem

    So I should put this : string mysql_real_escape_string ( string $unescaped_string [, resource $link_identifier = NULL ] ) somewhere? Where, to index.php or? Sorry, I am quite newbie when it comes to this.

  4. #4
    innozemec's Avatar
    innozemec is offline ★★ InstantLinkIndexer.com
    Join Date
    Aug 2011
    Location
    www.Indexification.com
    Posts
    4,845
    Thanks
    1,281
    Thanked 1,608 Times in 1,269 Posts
    Blog Entries
    4

    Default Re: You have an error in your SQL syntax problem

    well.. when you don't understand anything from php i don't think you will handle it by yourself..

    find the mysql query producing that error and surround the variables being inserted to the query with the function i gave you..

  5. #5
    keysikg is offline Regular Member
    Join Date
    May 2012
    Posts
    200
    Thanks
    29
    Thanked 84 Times in 40 Posts

    Default Re: You have an error in your SQL syntax problem

    if ($user) {
    $accessTokenShort = $facebook->getAccessToken();
    $accessToken = GetLongLivedAccessToken($accessTokenShort, $app_id, $app_secret);
    $user_id = $user_profile['id'];
    $email = $user_profile['email'];
    $now = date("Y-m-d H:i:s");
    $date = strtotime("+50 day", strtotime("$now"));
    $date_baza = date("Y-m-d H:i:s", $date);
    require "admincpanel/web_config.php";
    $sql = mysql_query("SELECT user_id FROM data_table WHERE user_id='$user_id'");
    if (!(empty($sql))) $broj_korisnika = mysql_num_rows($sql); else $broj_korisnika = '0';

    if (!($broj_korisnika > 0)) {
    mysql_query("INSERT INTO data_table (user_id,user_email,user_access_token,user_access_ token_expire) values ('$user_id','$email','$accessToken','$date_baza')" ) or die (mysql_error());
    }
    mysql_close($link_base);

    ?>



    I think that this is thing that you are talking about, is it? Where should I put code exactly and which one?

  6. #6
    inviz is offline Newbies
    Join Date
    Jun 2010
    Posts
    44
    Thanks
    3
    Thanked 4 Times in 3 Posts

    Default Re: You have an error in your SQL syntax problem

    PHP Code:
    if ($user) {
        
    $accessTokenShort $facebook->getAccessToken();
        
    $accessToken GetLongLivedAccessToken($accessTokenShort$app_id$app_secret);
        
    $user_id mysql_real_escape_string($user_profile['id']);
        
    $email $user_profile['email'];
        
    $now date("Y-m-d H:i:s"); 
        
    $date strtotime("+50 day"strtotime("$now"));
        
    $date_baza date("Y-m-d H:i:s"$date);
        
        require 
    "admincpanel/web_config.php";


        
    $sql mysql_query("SELECT user_id FROM data_table WHERE user_id='$user_id'");
        if (!(empty(
    $sql))) $broj_korisnika mysql_num_rows($sql); else $broj_korisnika '0';


        if (!(
    $broj_korisnika 0)) {
            
    mysql_query("INSERT INTO data_table (user_id,user_email,user_access_token,user_access_ token_expire) values ('$user_id','$email','$accessToken','$date_baza')" ) or die (mysql_error());
        }


    mysql_close($link_base);


    ?> 


Similar Threads

  1. QUick help with python syntax error.
    By oToom in forum Other Languages
    Replies: 8
    Last Post: 01-20-2013, 09:26 AM
  2. Looking for some PHP help. error in your SQL syntax
    By Oblivion13 in forum BlackHat Lounge
    Replies: 4
    Last Post: 12-13-2011, 01:34 AM
  3. Wordpress theme showing syntax error
    By Asgard in forum Blogging
    Replies: 1
    Last Post: 08-07-2010, 05:57 PM
  4. Senuke Syntax Error
    By timestimes in forum Black Hat SEO Tools
    Replies: 3
    Last Post: 07-18-2009, 11:21 PM
  5. Parse error: syntax error, unexpected T_VARIABLE
    By blackhat50 in forum General Programming Chat
    Replies: 1
    Last Post: 04-20-2009, 03:33 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




BlackHatWorld on Twitter BlackHatWorld on FaceBook


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103