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 (https://vborg.vbsupport.ru/showthread.php?t=68581)

Osterling 08-21-2004 03:04 AM

Code:

$journal_views = $DB_site->query("
                                                        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 " . "$vboptions[journals_viewdisplaylimit]
                                                        ");

that' it... thank you so much :)

Davey 08-21-2004 03:07 AM

Could you try replacing it with this, and telling me what happens then?

Code:

$journal_views = $DB_site->query("
                                                        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 $vboptions['journals_viewdisplaylimit']
                                                        ");

Thanks.

Osterling 08-21-2004 03:08 AM

i get this error:

Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/exas77ko/public_html/forum/journal.php on line 1211

Brad 08-21-2004 03:09 AM

Try this instead:

PHP Code:

$limit_views intval($vboptions['journals_viewdisplaylimit']);
$journal_views $DB_site->query("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" $limit_views); 


Davey 08-21-2004 03:11 AM

Ah, brad.loo to save the day. :p

edit. hey brad.loo, maybe you could help with my problem :devious: :p look about 10 threads down lol.

Osterling 08-21-2004 03:12 AM

Quote:

Originally Posted by Brad.loo
Try this instead:

PHP Code:

$limit_views intval($vboptions['journals_viewdisplaylimit']);
$journal_views $DB_site->query("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" $limit_views); 


when i did that, i got this error

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 LIMIT0
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 'LIMIT0' at line 1

mysql error number: 1064

Brad 08-21-2004 03:13 AM

Argh...damn array, use this:

PHP Code:

$journal_views $DB_site->query("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"  $vboptions['journals_viewdisplaylimit']); 


Osterling 08-21-2004 03:20 AM

Quote:

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 1

mysql error number: 1064

Date: Saturday 21st of August 2004 12:19:31 AM
Script: http://www.exasko.info/forum/journal.php
thats the error i get when made the other change

Brad 08-21-2004 03:25 AM

Wait, is the the journal script posted on evB? Last I heard that has alot more errors then just then one, just so you know.

You can try throwing this at it, are you sure you set up all the vBoptions for that script correctly?

PHP Code:

$journal_views $DB_site->query("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".$vboptions[journals_viewdisplaylimit]); 

Altho im not sure why the single quotes in the array would throw it off any.

Osterling 08-21-2004 04:21 AM

no.. didn't fixc the problem :(


All times are GMT. The time now is 12:47 PM.

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.01102 seconds
  • Memory Usage 1,752KB
  • 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
  • (4)bbcode_php_printable
  • (2)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