vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   MySQL error 1064 in vB 3.0.3 + PHP5.0.0 using forums/global.php user authentication (https://vborg.vbsupport.ru/showthread.php?t=66946)

run.exe 07-07-2004 03:52 PM

MySQL error 1064 in vB 3.0.3 + PHP5.0.0 using forums/global.php user authentication
 
MySQL error 1064 in vB 3.0.3 + PHP5.0.0 (gold/release)

--------------------------------------------------------------------------------

Hello and thank you for your time.

I am running vBulletin v3.0.3 (no hacks whatsoever), within the following context:


- Microsoft Windows Server 2003 Enterprise
- Apache 2 v2.0.50 (as a module, *NOT* CGI)
- mod_ssl v2.0.50
- MySQL v4.0.20d
- PHP5.0.0 (gold/release)


I receive the following error when attempting to access a forum link in vBulletin - which passes variables to a PHP page -
which, in turn, should access a MySQL database (via: action=new).

Said link remains unchanged since before my upgrade from vB 3.0.1-->3.0.3.

Any/all help will be MOST appreciated; thank you, in advance...


**************************************************


Database error in vBulletin :

Invalid SQL:
SELECT * FROM style
WHERE (styleid = 0 AND userselect = 1)
OR styleid =
ORDER BY styleid ASC
LIMIT 1

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 'ORDER BY styleid ASC
LIMIT 1' at line 4

mysql error number: 1064


Date: Wednesday 07th of July 2004 09:44:55 AM
Script: http://www.500ecstasy.com/forums/re....php?action=new
Referer:
IP Address: xxx.xxx.xxx.xxx


**************************************************

Modin 07-07-2004 04:29 PM

well, the sql string is missing a value after "OR styleid ="

this means a variable is empty somewhere, are you sure you haven't touched the code? I'm not sure what would cause this.

run.exe 07-07-2004 05:28 PM

Upon further investigation, it appears that this problem is directly related to the inclusion/requirement of forums/global.php for user authentication (in my vBulletin 3.0.3 user-group permission specified link).

Specifically, the code in question follows:


<?
$self_dir = getcwd();
chdir('../');
require_once('global.php');
chdir($self_dir);
?>



Of note is the fact that browsing directly to forums/global.php yields the identical MySQL error noted above (1064).

Is anyone else using the above method of user authentication?

If not, what is the recommended method, please?

run.exe 07-08-2004 01:55 AM

{EDIT: preemptive bump deleted, in the interest of netiquette}

Xenon 07-08-2004 11:29 AM

there is no need to bump a thread within 24h, that will just reduce your chance of getting help..

have you tried to add the importat variables/arrays before you call global.php.
there's a reason why these are on every page ;)

run.exe 07-08-2004 02:17 PM

Thank you very much for your time and assistance.

Being a network engineer and not a coder (by any real standard), I do not follow your suggestion/implication; please pradon my (PHP) ignorance.

Given that nothing has changed in my PHP or HTML code - or environment - save the "upgrade" to PHP5 RC3, what is now missing that wasn't missing before? Has PHP syntax changed, somehow, post v4.3.6?

Would you be so kind as to provide some (generic, code) examples, please?

Dark_Wizard 07-08-2004 02:52 PM

Post the top part of your code...about 100 lines or so so we can see whats going on.

run.exe 07-08-2004 03:16 PM

Quote:

Originally Posted by Dark_Wizard
Post the top part of your code...about 100 lines or so so we can see whats going on.


Which code, please?

global.php

or

index.php {the file I cannot open, successfully}

Dark_Wizard 07-08-2004 03:29 PM

The file that contains this code you posted above:

Code:

<?
$self_dir = getcwd();
chdir('../');
require_once('global.php');
chdir($self_dir);
?>


run.exe 07-08-2004 03:59 PM

Code:

<?
$self_dir = getcwd();
chdir('../');
require_once('global.php');
chdir($self_dir);
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>TITLE</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="styles/styles.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style1 {
        font-size: 30px;
        font-style: italic;
        font-weight: bold;
}
.style2 {
        font-size: 10px;
        font-style: italic;
        color: #CCCCCC;
}
.style4 {font-size: 12px; font-style: italic; font-weight: bold; }
.style11 {font-size: 12px; font-style: italic; font-weight: bold; color: #FFFFFF; }
.style12 {color: #999999}
.style13 {color: #FFFFFF}
.style15 {color: #FF0000}
.style16 {color: #CCCCCC}
.style21 {font-size: 24px}
.style23 {font-size: 14px; font-style: italic; font-weight: bold; }
.style24 {font-size: 14px}
.style25 {
        font-size: 24px;
        color: #FFFFFF;
        font-style: italic;
        font-weight: bold;
}
.style28 {font-size: 10px}
.style29 {font-size: 14px; font-style: italic; font-weight: bold; color: #CCCCCC; }
-->
</style>
</head>
<body bgcolor="#333333" text="#CCCCCC" link="#666666" vlink="#999999" alink="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<? if($bbuserinfo['userid'] == 0) { ?>
<table width="100%" height="100%" cellpadding="3" cellspacing="0" border="0">
        <tr valign="middle"><td align="center">
                <table width="618" height="30" border="0" cellpadding="3" cellspacing="0">
                        <tr>       
                          <td colspan="2"width="612" height="27" align="center" bgcolor="#F0F0F0"><span class="section">500E OWNER REGISTRY</span></td>
                  </tr>
                        <tr bgcolor="#999999">       
                        <td colspan="2" height="1"></td>
                        </tr>
                        <tr bgcolor="#FFFFFF">       
                       
                        <table width="618" height="20" border="0" cellpadding="3" cellspacing="0">
                                <tr bgcolor="#FFFFFF">       
                                <td align="center"><span class="note">NOT LOGGED IN</span></td>
                                </tr>
                                <tr bgcolor="#FFFFFF">       
                                <td align="center"><span class="text"><a href="http://path.to.my/forums/">log in</a></span></td>
                                </tr>
                  </table>
          <tr>
                                <td colspan="2" align="left"><span class="text">&nbsp;</span></td>
          </tr>
        </table>
                </td></tr>
</table>
<? } else { // is logged in ?>

<?php



All times are GMT. The time now is 03:51 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.01509 seconds
  • Memory Usage 1,751KB
  • 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
  • (2)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete