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 12-10-2004, 11:27 PM
spick spick is offline
 
Join Date: Jan 2003
Posts: 75
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default how do i

hey i got a question



i am creating a vB3 battle system



im stuck on this problem i created a textfield with the name="winner"



and in my newreply.php i used the code



PHP Code:

// update battles

$winid $DB_site->query_first("SELECT username FROM ".TABLE_PREFIX."user WHERE userid='$winner'");

 

if (
$winid['username'] > 0

{

$DB_site->query("UPDATE ".TABLE_PREFIX."user SET wins=wins+1 WHERE username='$winid[username]'");

}

 

 

// end of battle update 


but it does nuthing and i tried more codes but dont seem to work can any body help me??
Reply With Quote
  #2  
Old 12-11-2004, 12:03 AM
Brad Brad is offline
 
Join Date: Nov 2001
Posts: 4,765
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Change $winner to

PHP Code:
$_POST['winner'
Reply With Quote
  #3  
Old 12-11-2004, 10:49 AM
spick spick is offline
 
Join Date: Jan 2003
Posts: 75
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

then ill get this error

PHP Code:
Parse errorparse errorunexpected T_ENCAPSED_AND_WHITESPACEexpecting T_STRING or T_VARIABLE or T_NUM_STRING in c:\program files\easyphp1-7\www\upload\newreply.php on line 334 
ill make a screen with it what im trying to build
Attached Images
File Type: jpg reply.JPG (127.3 KB, 0 views)
Reply With Quote
  #4  
Old 12-11-2004, 07:10 PM
Brad Brad is offline
 
Join Date: Nov 2001
Posts: 4,765
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What is on line 334 of that file?
Reply With Quote
  #5  
Old 12-11-2004, 07:28 PM
spick spick is offline
 
Join Date: Jan 2003
Posts: 75
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PHP Code:
// update battles 

$winid $DB_site->query_first("SELECT username FROM ".TABLE_PREFIX."user WHERE userid='$_POST['winner'] '"); 



if (
$winid['username'] > 0



$DB_site->query("UPDATE ".TABLE_PREFIX."user SET wins=wins+1 WHERE username='$winid[username]'"); 







// end of battle update 

this is on that line
Reply With Quote
  #6  
Old 12-12-2004, 05:55 AM
Mike343 Mike343 is offline
 
Join Date: Sep 2002
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

try chaning $_POST['winner'] to $_POST[winner]
Reply With Quote
  #7  
Old 12-12-2004, 12:14 PM
spick spick is offline
 
Join Date: Jan 2003
Posts: 75
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ok got the page back on now but it still doenst update

this is the template part i use for it maybe there is the error

PHP Code:
<!--START BATTLE SYSTEM UPDATER-->
                <if 
condition="$show['admincplink']">
                <
fieldset class="fieldset">
                    <
legend>Battle System Updater (ADMIN VIEW ONLY)</legend>
                    <
div style="padding:$stylevar[formspacer]px">
                        <
div>
Winner Id <br><form action="newreply.php"  name="name" method="update"><input type="textfield" name="winner" value="$winner"><br>vs <br>Loser Id<br><input type="textfield" name="losser" value="$losser"><input type=submit name=verzenden></form></div>
                </
fieldset>
                </if>
                <!--
END BATTLE SYSTEM UPDATER--> 
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:33 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04870 seconds
  • Memory Usage 2,256KB
  • Queries Executed 14 (?)
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
  • (5)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (1)postbit_attachment
  • (7)postbit_onlinestatus
  • (7)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_postinfo_query
  • fetch_postinfo
  • 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
  • postbit_attachment
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete