HOME | DOWNLOAD | SUPPORT | INSTALLATION | FAQ | SUPPORT FORUM | DEMO
 ° Forums ° Statistics ° Registration ° Search ° Manual °
SkaLinks Forum / Technical Support / Mysql version
Author Message
bug


Posted: 23 Nov 2005 10:40:11


While save setting on admin/setting.php I've got:

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 't place reciprocal link(s) to yet, please use the following in' at line 1

Mysql version is 5.0

skalinks
Admin

Posted: 24 Nov 2005 03:11:36


Hi bug
I can not say you exactly if this problem with mysql ver. 5.0 ? because we didn't test script with this mysql version, but is very possible that the problem in 5.0 version, because this is not perfect version of mysql.
Thank's

bug


Posted: 24 Nov 2005 06:52:28


I am using 5.0.16 in production environment for a while with no problems. But while upgrading from MySQL-4.1 to MySQL-5.0 some applications need to to be slightly modified. The syntax changes between major versions. Please, show me the exact location of this wrong SQL statement, I will see and fix it.

computergenius


Posted: 24 Nov 2005 17:13:24


Temporarily, you could remove the quote in the message - do you have the word can't in there? That is what is causing the problem

bug


Posted: 25 Nov 2005 02:51:36


I don't touch messages at all. They are original Skalinks messages. Nevertheless, You are right: this is not MySQL problem: this is Skalinks problem. And this is old problem already discussed in this forum:

http://www.skalinks.com/forums/1_111_0.html

Admin promise to include php setting into new version, but have not done this in .htaccess file:

php_value magic_quotes_runtime 1

By the way, an good written code shouldn't be dependent on magic_quotes_xx settings.

skalinks
Admin

Posted: 25 Nov 2005 07:06:58


Ok, if anybody will have this problem, please, try to do that:
Open SkaLinks.class.php and find in this file this code
function SetParam( $p_name, $value )
{
$table_name = $this->m_ParamsTable;
$sql = "UPDATE `$table_name` SET `VALUE` = '{$value}' WHERE `Name` = '{$p_name}' LIMIT 1";
$res =& $this->db_Query( $sql );

return $res;
}

and replace this code with:

function SetParam( $p_name, $value )
{
$table_name = $this->m_ParamsTable;
$p_name = mysql_escape_string( $p_name );
$value = mysql_escape_string( str_replace( "\'","'", $value ) );
$sql = "UPDATE `$table_name` SET `VALUE` = '{$value}' WHERE `Name` = '{$p_name}' LIMIT 1";
$res =& $this->db_Query( $sql );

return $res;
}


The corrected code will be included in next version of SkaLinks
Thank's