vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Problem with a script after upgrading to mySQL 5 and PHP 5 (https://vborg.vbsupport.ru/showthread.php?t=144087)

Cloud Strife 04-05-2007 05:14 PM

Problem with a script after upgrading to mySQL 5 and PHP 5
 
I run a script and I get a mysql 1604 error on ths piece of code.

PHP Code:

       $vbulletin->db->query_write("
                UPDATE " 
TABLE_PREFIX "user
                SET thetime = '
$currentunixtime'
                    WHERE username = '
$theuser';   "); 

I get this error


Invalid SQL:

Quote:

UPDATE user
SET thetime = '1175797034'
WHERE username = 'Rowuy')';;

MySQL Error : 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 3
Error Number : 1064
It worked prior to the upgrade but no longer works. Any ideas?

Adrian Schneider 04-05-2007 05:39 PM

PHP Code:

$username $vbulletin->db->escape_string($theuser);

$vbulletin->db->query_write("
    UPDATE " 
TABLE_PREFIX "user
    SET thetime = 
$currentunixtime
    WHERE username = '
$username'
"
); 


Cloud Strife 04-05-2007 06:21 PM

Thanks a lot, it's working perfectly now :)

Cloud Strife 04-06-2007 10:30 PM

I have one last script thats causing me troubles. I get this error:-

Quote:

Fatal error: Cannot use object of type vB_Session as array in et/home/siteupload/public_html/forums/showthread.php(1953) : eval()'d code on line 33
From this line of code:-

PHP Code:

    while ($user $db->fetch_array($result))
    {
            
array_push($viewers"<a target=\"_blank\" href=\"member.php?".$vbulletin->session['sessionurl'] . "u=".$user['userid'] . "\">" htmlspecialchars($user['username']) .    "</a>");
    } 

Thanks for the help :)

Adrian Schneider 04-06-2007 10:49 PM

$vbulletin->session->vars['sessionurl']
instead of
$vbulletin->session['sessionurl']

Cloud Strife 04-07-2007 10:35 AM

Really appreciate the help. Things are in tip top working condition now :p


All times are GMT. The time now is 08:11 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01093 seconds
  • Memory Usage 1,728KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete