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 10-27-2005, 09:00 PM
pyro.699 pyro.699 is offline
 
Join Date: Sep 2005
Location: Fredericton, New Brunswic
Posts: 261
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default [MYSQL] WHERE = 'Where is this code?'

sup, im making my rpg mod, still, and al i need now, is the where command, ive tryed tons of crap!

PHP Code:
$vbulletin->db->query_write(
"UPDATE "TABLE_PREFIX ."thread
SET rpg_name_int = '" 
$db->escape_string($vbulletin->GPC['rpg_name_int']) . "',
WHERE threadid = '" 
$vbulletin->threadinfo['threadid'] . "' "
); 
thats what i got so far

now, ive goten errors, and its showed me that the set command works, but, the WHERE command dosent... what do i ened to alter?

// More Info \\

Hook: newthread_post_complete

What its suposta do?: it is suposta write querys to the thread it just made..
\\ End More Info //
Reply With Quote
  #2  
Old 10-27-2005, 09:10 PM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

huh ?
Reply With Quote
  #3  
Old 10-27-2005, 09:15 PM
Guest190829
Guest
 
Posts: n/a
Default

Quote:
Originally Posted by pyro.699
sup, im making my rpg mod, still, and al i need now, is the where command, ive tryed tons of crap!

PHP Code:
$vbulletin->db->query_write(
"UPDATE "TABLE_PREFIX ."thread
SET rpg_name_int = '" 
$db->escape_string($vbulletin->GPC['rpg_name_int']) . "',
WHERE threadid = '" 
$vbulletin->threadinfo['threadid'] . "' "
); 
thats what i got so far

now, ive goten errors, and its showed me that the set command works, but, the WHERE command dosent... what do i ened to alter?

// More Info \\

Hook: newthread_post_complete

What its suposta do?: it is suposta write querys to the thread it just made..
\\ End More Info //
What's the exact error you're getting?
Reply With Quote
  #4  
Old 10-27-2005, 09:15 PM
pyro.699 pyro.699 is offline
 
Join Date: Sep 2005
Location: Fredericton, New Brunswic
Posts: 261
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

lol,?

umm, i need to write a query, and i need to know how to specify the thread that it has just created...?

umm, yeah, i linke umms, lol; ok, as i said above, its for adding the #1 to a table i created in the thread table, (i like tables aswell it seems/; ) leaves it alone, (need to make that code <)

hope that makes it easyer

as for the error question, i figured that out, i said when i got errors. i got the erorrs figured out ^^ i just need the where command
Reply With Quote
  #5  
Old 10-27-2005, 09:17 PM
Guest190829
Guest
 
Posts: n/a
Default

So it's not giving errors? But just not working? It could be your hook location.
Reply With Quote
  #6  
Old 10-27-2005, 09:19 PM
pyro.699 pyro.699 is offline
 
Join Date: Sep 2005
Location: Fredericton, New Brunswic
Posts: 261
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

lol, posts while im posting ^^, umm.... idk what other hook location to try? you got any ideas?

(im sorta new to plugins)
Reply With Quote
  #7  
Old 10-29-2005, 12:29 AM
pyro.699 pyro.699 is offline
 
Join Date: Sep 2005
Location: Fredericton, New Brunswic
Posts: 261
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ok, major breakthrew here, ill post yo the error i got

Quote:
Originally Posted by God Dam Error Generating System
Database error in vBulletin 3.5.0:

Invalid SQL:
UPDATE thread
SET rpg_name_int = '0',
WHERE threadid = '';

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 'WHERE threadid = ''' at line 3
Error Number : 1064
Date : Friday, October 28th 2005 @ 10:26:20 PM
Script : http://localhost/php_testing/test/newthread.php
Referrer : http://localhost/php_testing/test/ne...newthread&f=26
IP Address : 127.0.0.1
Username : Pyro
Classname : vB_Database
Thats right 127.0.0.1

anyways, as you can see the script knows everythign except for the location.

I looked threw a code that aj gave to me
PHP Code:
echo '<pre>'
print_r($vbulletin); 
echo 
'</pre>'
Made a plugin outa that, and i coudlent find the forum id, so... idk.. you figure it out... i really ned this last step! please help em!
Reply With Quote
  #8  
Old 11-03-2005, 04:46 AM
Softcore Softcore is offline
 
Join Date: Feb 2005
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I hope you don't mind me butting In here pyro.699,

I wish I knew the answer to your question, but I only know how to code for 3.0.9, not 3.5.0....however, I'd like to make It clear what your asking as I understood and It seems other did not....

He's trying to run a query that updates a field WHERE the threadid equal's the threadid he gives....The problem Is, as you can see from the query, It's not giving a thread ID, now this could be because he does not have the query correctly for vb 3.5.0 (as I said I have no Idea about), or because the, used to be $threadinfo array Is not being passed to his script....

Hope someone can help you, and hopefully they understand now
Reply With Quote
  #9  
Old 11-03-2005, 05:56 AM
Adrian Schneider's Avatar
Adrian Schneider Adrian Schneider is offline
 
Join Date: Jul 2004
Posts: 2,528
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It's working now, he was trying to run a query instead of using the datamanager.
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 12:38 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.05836 seconds
  • Memory Usage 2,241KB
  • 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
  • (3)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (7)postbit_onlinestatus
  • (9)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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete