<? DEW-CODE.COM  

Downloads

Assorted scripts  (1)
DewNewPHPLinks  (9)





Lost Password?
No account yet? Register

Dew-Code Newsfeed

Resources


 USdigitalcable.com

Dew-Code
Welcome, Guest
Please Login or Register.    Lost Password?
Re:You have an error in your SQL syntax; (1 viewing) (1) Guest
Go to bottom Post Reply Favoured: 0
TOPIC: Re:You have an error in your SQL syntax;
#1250
stgeorge (User)
Fresh Boarder
Posts: 9
graphgraph
User Offline Click here to see the profile of this user
The Net Web Location: UK
Re:You have an error in your SQL syntax; 2 Years ago Karma: 0  
Sorry for the late reply Dewed.
The version I am running is:

v.2.1.0.1b SEF

Nothing is showing up in the error log file.
 
Report to moderator   Logged Logged  
 
Last Edit: 2010/01/15 03:28 By stgeorge.
 
Never Say Never!
Anything is Possible!
http://thenetweb.co.uk
phpDewLinks:
http://thenetweb.co.uk/phplinks/
  The administrator has disabled public write access.
#1251
Dewed (Admin)
Admin
Posts: 603
graph
User Online Now Click here to see the profile of this user
Dew-Code.com
Re:You have an error in your SQL syntax; 2 Years ago Karma: 9  
This still sounds like an error is occuring and stopping the script

You can view an unaltered copy of out.php here http://www.dew-code.com/source/?filename=./dew-newphplinks.v.2.1.0.1b.sef/out.php


and here is a copy where I have commented out the reporting portion

Code:

<?php // ******************************************************************* // out.php // ******************************************************************* include("./include/config.php"); include("./include/functions.php"); include("include/common.php"); $ID=$_GET['ID']; $REMOTE_ADDR = $_SERVER['REMOTE_ADDR']; if(isset($ID)){ $get_site = sql_query("select SiteURL, OutIP from $tb_links where ID='$ID'"); $get_row = sql_fetch_array($get_site); $url = $get_row[SiteURL]; } if($REMOTE_ADDR != $get_row[OutIP]){ $result = sql_query(" update $tb_links set HitsOut = HitsOut + 1, OutIP = '$REMOTE_ADDR', LastUpdate = LastUpdate where ID = '$ID' "); } /* if ($ID > 0){ $page_desc = "<a href=./edit_site.php?ID=".$ID.">EDIT</a>"; $user_agent = mysql_real_escape_string(getenv("HTTP_USER_AGENT")); $ip = getenv("REMOTE_ADDR"); $date_added = date("Y-m-d"); $table_name = "page_track"; $sql = "insert into $tb_track values ('', '$ID', '$page_desc', '$user_agent', '$ip', '$date_added')"; $result = mysql_query($sql) or die (mysql_error()); } */ header("Location: $url"); ?>
 
Report to moderator   Logged Logged  
 
Last Edit: 2010/01/15 07:20 By Dewed.
 
Nothing to it but to Dew it !
Dew-Code.com
  The administrator has disabled public write access.
#1252
stgeorge (User)
Fresh Boarder
Posts: 9
graphgraph
User Offline Click here to see the profile of this user
The Net Web Location: UK
Re:You have an error in your SQL syntax; 2 Years ago Karma: 0  
Thanks Dewed that worked.

Incidentally for anyone copying and pasting the altered version check your white spacing first before uploading. That is the cursor should return back to:

Code:

<?php
at the beginning of the script. and back to:
Code:

?>
at the end of the script. This can occasionally cause problems on some servers. I use about 8 different servers for different websites I am running, so I will look into a more suitable Server when I wish to use the reporting function. I have migrated this installation across different servers with no problem in the past. Thanks again Dewed, I can now get on and use this wonderful application. Still have to sort my import Bookmarks problem, posted at: http://www.dew-code.com/component/option,com_fireboard/Itemid,26/func,view/catid,2/id,1129/#1129 But that was on a different server so I will try it again.
 
Report to moderator   Logged Logged  
 
Never Say Never!
Anything is Possible!
http://thenetweb.co.uk
phpDewLinks:
http://thenetweb.co.uk/phplinks/
  The administrator has disabled public write access.
#1325
JasonD (User)
Fresh Boarder
Posts: 12
graphgraph
User Offline Click here to see the profile of this user
Gender: Male JDFP Location: Brisbane, Australia Birthdate: 1973-10-30
Re:You have an error in your SQL syntax; 1 Year, 9 Months ago Karma: 0  
I have a similar problem to this one when you try to click to go "out" to the website

but my line entry in the out.php file is


Code:

$sql = "insert into $tb_track values ('', '$ID', '$page_desc', '$user_agent', '$REMOTE_ADDR', '$date_added')";
It was a little different to yours so i was not game to change it The error message i got originally is 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 'values ('', '64', 'EDIT', 'Mozilla/5.0 (Window' at line 1 And my server is using MySQL 5.0.81
 
Report to moderator   Logged Logged  
 
Last Edit: 2010/04/16 04:01 By JasonD.
 
Donate your click to raise money for a school in NE Thailand
http://www.productreview.com.au/?a_aid=8ff0a267
  The administrator has disabled public write access.
#1326
Dewed (Admin)
Admin
Posts: 603
graph
User Online Now Click here to see the profile of this user
Dew-Code.com
Re:You have an error in your SQL syntax; 1 Year, 9 Months ago Karma: 9  
I suspect the $tb_track variable isn't defined.
Check near the bottom of include/config.php for a line like

$tb_track = 'phplinks_track';


You'll also want to ensure that mysql table actually exist, check if you can view it in PHPMyAdmin
 
Report to moderator   Logged Logged  
 
Nothing to it but to Dew it !
Dew-Code.com
  The administrator has disabled public write access.
#1327
JasonD (User)
Fresh Boarder
Posts: 12
graphgraph
User Offline Click here to see the profile of this user
Gender: Male JDFP Location: Brisbane, Australia Birthdate: 1973-10-30
Re:You have an error in your SQL syntax; 1 Year, 9 Months ago Karma: 0  
Bingo

No entry like that at all

Do i just add that little bit of code?

And no it looks like that table does not exist
 
Report to moderator   Logged Logged  
 
Last Edit: 2010/04/16 16:58 By JasonD.
 
Donate your click to raise money for a school in NE Thailand
http://www.productreview.com.au/?a_aid=8ff0a267
  The administrator has disabled public write access.
Go to top Post Reply
get the latest posts directly to your desktop
Outsource your projects to thousands of programmers at
ScriptLance.com
Newsflash
Interested in
advertising?

This space for rent!

Sign up for PayPal and start accepting credit card payments instantly.
Copyright Dew-Code 2008