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

Reply
 
Thread Tools Display Modes
  #1  
Old 06-19-2002, 07:08 AM
Velocd's Avatar
Velocd Velocd is offline
 
Join Date: Mar 2002
Location: CA University
Posts: 1,696
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default small...but deadly.

I'm trying to figure out why I keep getting an error message for this simple query, could anybody give me an answer why?

Code:
$person=$DB_site->query_first("SELECT userid,posts FROM user WHERE $idlog == userid LIMIT 1");
Here is the error message:

Code:
Parse error: parse error in c:\apache\htdocs\index.php on line 83
Thnx,
Velocd
Reply With Quote
  #2  
Old 06-19-2002, 08:25 AM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Try:

$person=$DB_site->query_first("SELECT userid,posts FROM user WHERE userid='$idlog' LIMIT 1");
Reply With Quote
  #3  
Old 06-19-2002, 12:32 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

logician is right, no == in SQL queries.
but shouldn't that produce an mysql error?
parse errors are something different normally.

when you applied logicians solution and it doesn' work also, pleas coppy some lines above line 83 perhaps there is an error and php shows the wrong line (which happends mostly if you forget an ' " } or something
Reply With Quote
  #4  
Old 06-19-2002, 12:41 PM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

yep nice catch by Xenon.. :glasses:

Your line was wrong but this does not produce parse error. If line 83 is this line you posted here, check one line above and see if it ends with ; or not.

After correcting the parse error your still need to correct your SQL query..
Reply With Quote
  #5  
Old 06-19-2002, 07:31 PM
Velocd's Avatar
Velocd Velocd is offline
 
Join Date: Mar 2002
Location: CA University
Posts: 1,696
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ah, just brilliant. Thanks
Reply With Quote
  #6  
Old 06-19-2002, 08:14 PM
Velocd's Avatar
Velocd Velocd is offline
 
Join Date: Mar 2002
Location: CA University
Posts: 1,696
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Another quick question:

The following code is for the member of the day hack, and I'm trying to apply alittle more features to it.

Wouldn't the following code be acceptable to displayfield5, field6, and field7 of the member of the day?

Code:
$newmember=$DB_site->query_first("SELECT userid,username
                                        FROM user
                                       WHERE userid<>$daybits[1]
                                         AND (usergroupid=5
                                          OR usergroupid=6
                                          OR usergroupid=7
                                          OR usergroupid=2)
                                       ORDER BY RAND()
                                       LIMIT 1");

    $newtemplate=$thisdate.'||vb||'.$newmember['userid'].'||vb||'.$newmember['username'];

    $DB_site->query("UPDATE template
                        SET template='".addslashes($newtemplate)."'
                      WHERE templatesetid=-2
                        AND title='memberoftheday'");
    $memberoftheday['userid']=$newmember['userid'];
    $memberoftheday['username']=$newmember['username'];

    $newmember2=$DB_site->query_first("SELECT field5,field6,field7
                                             FROM userfield
	                                        LINE 85: WHERE userid='$memberoftheday['userid']' LIMIT 1");


    $memberoftheday['interests']=$newmember2['field5'];
    $memberoftheday['anime']=$newmember2['field6'];
    $memberoftheday['quote']=$newmember2['field7'];
This code gives me the following error:
Code:
Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in c:\apache\htdocs\index.php on line 85
Line 85 is marked.
Reply With Quote
  #7  
Old 06-19-2002, 08:29 PM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PHP Code:
$newmember2=$DB_site->query_first("SELECT field5,field6,field7
       FROM userfield
       WHERE userid='"
.$memberoftheday['userid']."' LIMIT 1"); 
Reply With Quote
  #8  
Old 06-19-2002, 10:30 PM
Velocd's Avatar
Velocd Velocd is offline
 
Join Date: Mar 2002
Location: CA University
Posts: 1,696
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks again! That defiantly cleared my error, but the small hack still doesn't want to work, and I cant figure out for the life of me what the problem is..it seems totally logical.....

This code is located in my vbhome index file, and I'm displaying the member of the day on my home page, along with their interests, favorite anime, and personal quote. its just when using $memberoftheday[quote] in the template nothing appears....

Ps: and yes, they do have a quote
Reply With Quote
  #9  
Old 06-20-2002, 04:07 AM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

perhaps field7 isn't the qoute field
if it is, recheck your spellings
Reply With Quote
  #10  
Old 06-20-2002, 07:26 AM
Velocd's Avatar
Velocd Velocd is offline
 
Join Date: Mar 2002
Location: CA University
Posts: 1,696
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No, I have rechecked my spelling and to see if the fields are correct a million times, and that doesn't seem to be the problem (as much as I wish it were)

It must be in the code, but I can't figure out where........ :dead:
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 08:51 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.04457 seconds
  • Memory Usage 2,275KB
  • Queries Executed 12 (?)
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
  • (4)bbcode_code
  • (1)bbcode_php
  • (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