PHP Error

cajkan

Active Member
Hello recently i have been contacted by anonymous user

He linked me some error code :

Code:
Fatal error: Database error in
"/home/MYSITE/public_html/sources/user_cp/join_existing.php" on line
324
 
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 ')' at line 4 in /home/MYSITE/public_html/sources/sql/mysql.php
on line 89
Can anyone preview this problem and tell me how to fix If exist.

Ive tryed to register new user / edited profile etc... everything was working but idk where did error code appear.

Thanks
 

Morus

www.votezone.eu , www.privateserversranking.com
License Active
whats your website? I will try,
you have syntax error in sql

thats what I have in /sources/user_cp/join_existing.php between line 321 and 324

Code:
        $DB->query("INSERT INTO {$CONF['sql_prefix']}_sites
                    (username, password, url, short_url, title, description, category, banner_url, email, join_date, active, openid, user_ip, owner {$custom_fields})
                    VALUES ('{$TMPL['username']}', '{$password}', '{$TMPL['url']}', '{$short_url}', '{$TMPL['title']}', '{$TMPL['description']}', '{$TMPL['category']}', '{$TMPL['banner_url']}', '{$TMPL['email']}', '{$join_date}', {$CONF['active_default']}, 0, '{$user_ip}','{$TMPL['owner']}')
                    {$custom_fields_value})", __FILE__, __LINE__);
 

cajkan

Active Member
This is my /sources/user_cp/join_existing.php

PHP:
      $DB->query("INSERT INTO {$CONF['sql_prefix']}_sites
                    (username, password, url, short_url, title, description, category, banner_url, email, join_date, active, openid, user_ip, owner {$custom_fields})
                    VALUES ('{$TMPL['username']}', '{$password}', '{$TMPL['url']}', '{$short_url}', '{$TMPL['title']}', '{$TMPL['description']}', '{$TMPL['category']}', '{$TMPL['banner_url']}', '{$TMPL['email']}', '{$join_date}', {$CONF['active_default']}, 0, '{$user_ip}','{$TMPL['owner']}')
                    {$custom_fields_value})", __FILE__, __LINE__);
I think its same but idk whats the problem

Maybe Mark or Basti will reply
 

Basti

Administrator
Staff member
Indeed, there is a syntax error

see this part
'{$TMPL['owner']}')

The red char should not be there
 

cajkan

Active Member
Thanks for reply LemoniscooL

but Basti already made a patch for it.

so i think its fixed now
 

Basti

Administrator
Staff member
Nope lemonis, its ok like it is. On new line below is an extra tag which handles custom join fields from admin. If such a field exist that function add in a comma before it calls the next tag, if not the tag is blank.
 

LemoniscooL

Member
oh okay then, didnt know that but it looked like there was a missing comma ^^ but that makes sense, cuz if the last one was empty there would be 1 comma too much if you add a comma before it .. which would then lead to a syntax error again

sorry for the unreasoned comment then ^^
 
Top