Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 08-21-2004, 02:14 AM
Osterling Osterling is offline
 
Join Date: Jan 2004
Posts: 381
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default mysql error

I'm not sure if I can get support here since I downloaded this hack from another forum but it's a mysql problem and I was just hopeing some one here could provide me the answer:

PHP Code:
Database error in vBulletin 3.0.0:

Invalid SQL
                            
SELECT u.usernamej.journalidj.titlej.descriptionj.timestampj.useridj.entriesj.views
                            FROM journal j
                            LEFT JOIN user u ON u
.userid j.userid
                            WHERE j
.enabled 1
                            ORDER BY j
.views DESC
                            LIMIT 
                            
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 6

mysql error number
1064

Date
Friday 20th of August 2004 10:58:40 PM
Script
http://www.
Refererhttp://www.
Usernameexasko
IP Address

Anyone have any idea to fix this?
Reply With Quote
  #2  
Old 08-21-2004, 02:36 AM
Davey Davey is offline
 
Join Date: Nov 2002
Location: England
Posts: 383
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

At a first glance, it looks like you are missing parameters for the LIMIT part.
LIMIT, as its name implies, limits your results to the set amount.
Ex:

|------table: vb3_bankbalance-------|
// not even remotely my real bank records, i wouldn't be that stupid.
id, in, out, balance
1, 0.00, 10.00, 560.00
2, 300.00, 0.00, 860.00
3, 0.00, 50.00, 810.00
4, 0.00, 20.00, 790.00
5, 100.00, 0.00, 890.00
6, 0.00, 500.00, 390.00
7, 100.00, 0.00, 490.00
|------end--------|

$DB_site->query("
SELECT balance
FROM " . TABLE_PREFIX . "mybankrecords
LIMIT 2,7
");

Should grab rows 2 -> 7 and leave row 1 in the database.
A 'LIMIT' can't have no parameters. That's probably why you are getting that error, anyway.
Reply With Quote
  #3  
Old 08-21-2004, 02:40 AM
Osterling Osterling is offline
 
Join Date: Jan 2004
Posts: 381
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
CREATE TABLE journal (
journalid int(11) NOT NULL auto_increment,
title text NOT NULL,
description text NOT NULL,
imagename text NOT NULL,
entries int(11) NOT NULL default '0',
views int(11) NOT NULL default '0',
enabled smallint(6) default '0',
timestamp int(11) NOT NULL default '0',
userid int(11) NOT NULL default '0',
mood text NOT NULL,
np text NOT NULL,
PRIMARY KEY (journalid)
) TYPE=MyISAM ;
thats the sql i ran, could you fix it to make it right because to be honest your post didn't make much sense to me
Reply With Quote
  #4  
Old 08-21-2004, 02:45 AM
Davey Davey is offline
 
Join Date: Nov 2002
Location: England
Posts: 383
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Code:
Your SQL-query has been executed successfully
 
SQL-query :
CREATE TABLE journal ( journalid int(11) NOT NULL auto_increment, title text NOT NULL, description text NOT NULL, imagename text NOT NULL, entries int(11) NOT NULL default '0', views int(11) NOT NULL default '0', enabled smallint(6) default '0', timestamp int(11) NOT NULL default '0', userid int(11) NOT NULL default '0', mood text NOT NULL, np text NOT NULL, PRIMARY KEY (journalid) ) TYPE=MyISAM
Nothing wrong with that.
Reply With Quote
  #5  
Old 08-21-2004, 02:47 AM
Osterling Osterling is offline
 
Join Date: Jan 2004
Posts: 381
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

then i hate to sound stupid, but what should i do to fix this? i am really new to mysql..

is there something i could run to fix it, or do something? god i hate sounding stupid..
Reply With Quote
  #6  
Old 08-21-2004, 02:50 AM
Davey Davey is offline
 
Join Date: Nov 2002
Location: England
Posts: 383
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well I straight off ran that query copy + paste, and it executed it fine. Not sure why it isn't working in your case. What exactly is it saying? Have you tried running the query from phpMyAdmin? That is where I ran it from.
Reply With Quote
  #7  
Old 08-21-2004, 02:52 AM
Osterling Osterling is offline
 
Join Date: Jan 2004
Posts: 381
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No it runs prefectly.. its when I try to view it.. see,


http://www.exasko.info/forum/journal.php

that is the problem i am getting..
Reply With Quote
  #8  
Old 08-21-2004, 02:55 AM
Davey Davey is offline
 
Join Date: Nov 2002
Location: England
Posts: 383
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I just see "there has been a technical problem with the database"
Reply With Quote
  #9  
Old 08-21-2004, 02:57 AM
Osterling Osterling is offline
 
Join Date: Jan 2004
Posts: 381
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Database error in vBulletin 3.0.0:

Invalid SQL:
SELECT u.username, j.journalid, j.title, j.description, j.timestamp, j.userid, j.entries, j.views
FROM journal j
LEFT JOIN user u ON u.userid = j.userid
WHERE j.enabled = 1
ORDER BY j.views DESC
LIMIT

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 6

mysql error number: 1064

Date: Friday 20th of August 2004 11:55:56 PM
Script: http://www.exasko.info/forum/journal.php
Referer:


that is the error i get on that page..
Reply With Quote
  #10  
Old 08-21-2004, 03:00 AM
Davey Davey is offline
 
Join Date: Nov 2002
Location: England
Posts: 383
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Open up 'journal.php' in your favourite editor.
Find the line with the text:
"SELECT u.username, j.journalid, j.title, j.description, j.timestamp, j.userid, j.entries, j.views"
Paste all of the query including $DB_site->query bit.
Maybe put it inside [code] braces?
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:59 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.04240 seconds
  • Memory Usage 2,259KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (1)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete