<? 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?
You have an error in your SQL syntax; (1 viewing) (1) Guest
Go to bottom Post Reply Favoured: 0
TOPIC: You have an error in your SQL syntax;
#1234
stgeorge (User)
Fresh Boarder
Posts: 9
graphgraph
User Offline Click here to see the profile of this user
The Net Web Location: UK
You have an error in your SQL syntax; 2 Years, 1 Month ago Karma: 0  
I am getting the following error when clicking on a link I have added from Admin:
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 ('', '3', 'EDIT', 'Opera/9.80 (Windows N' at line 1

The link is clicked on from the front end.

Has anyone seen this before?

I have tried it in Firefox and Opera.

I have added the link but there is not reciprocal link inserted and no e-mail address.

Could this be the reason?

The Dew Links link with the script gives out the same error.

Although I wish to use DewLinks for Reciprocal Links I also just want to be able to add Links in Categories so that I can use it for a personal bookmark system, (although of course it would be public).
The idea is to create a Link Directory to CMS and phpScripts, extensions, FAQ and web design related content.

Anyone wishing to use it for reciprocal links is welcome to do so although primarily I want to as it for a directory as described above.
This means that most links will not be reciprocal.

Server version: 5.0.85-community
Protocol version: 10
PHP version 5.2.11

phpMyAdmin - 2.11.9.5
MySQL client version: 4.1.22
Used PHP extensions: mysql

Apache version 2.2.14 (Unix)

Any ideas out there anyone?

Thanks in advance.
 
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.
#1235
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, 1 Month ago Karma: 9  
It seems MySQL 4 and 5 treat NULL values differently.

In your out.php file, locate near the bottom
Code:

$sql = "insert into $tb_track values ('', '$ID', '$page_desc', '$user_agent', '$ip', '$date_added')";
I think MySQL 4 is complaining the '' being used to indicate a NULL value, try one of these variations, one should work with your version
Code:

$sql = "insert into $tb_track values (, '$ID', '$page_desc', '$user_agent', '$ip', '$date_added')"; or $sql = "insert into $tb_track values (NULL, '$ID', '$page_desc', '$user_agent', '$ip', '$date_added')";
 
Report to moderator   Logged Logged  
 
Nothing to it but to Dew it !
Dew-Code.com
  The administrator has disabled public write access.
#1236
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, 1 Month ago Karma: 9  
PS, that MySQL query is used for the reports function available though the admin panel, if you don't plan to use that feature the whole block could be commented out, saving a database call

Disabling that whole chunk would look like this

Code:

/* 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()); } */
 
Report to moderator   Logged Logged  
 
Nothing to it but to Dew it !
Dew-Code.com
  The administrator has disabled public write access.
#1242
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, 1 Month ago Karma: 0  
Thanks for the Reply Dewed.

I will try your suggestions a little later and report back.

Wrapped up in some Joomla templating at the moment.
 
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.
#1243
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, 1 Month ago Karma: 0  
Thought I would give it a quick try:
Well both lines avoid the sql error but I am getting white screened on the link which I have set to open within dewphplinks in a new tab.
Also when trying to add a site from the front end I get:

Code:

Invalid query: 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 'order by RAND() LIMIT 1' at line 1
As this could be a files permissions issue, (white screening often is), I have chmodded all files to 644 and directories to 755. I will read the included docs a little later. Thanks again Dewed.
 
Report to moderator   Logged Logged  
 
Last Edit: 2010/01/07 08:49 By Dewed.
 
Never Say Never!
Anything is Possible!
http://thenetweb.co.uk
phpDewLinks:
http://thenetweb.co.uk/phplinks/
  The administrator has disabled public write access.
#1244
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, 1 Month ago Karma: 9  
White screening can also be a regular PHP error, when error reporting is turned off. Possibly you have an error_log file ?

Might be a good idea to pester your host to upgrade to MySQL 5 Version 4 was buggy regarding things like treatment of nulls for autoindex columns

Anyway, where did you get this copy of the script you are running ? What version is it ?
 
Report to moderator   Logged Logged  
 
Nothing to it but to Dew it !
Dew-Code.com
  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