vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   [MYSQL] WHERE = 'Where is this code?' (https://vborg.vbsupport.ru/showthread.php?t=99464)

pyro.699 10-27-2005 08:00 PM

[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 //

Paul M 10-27-2005 08:10 PM

huh ?

Guest190829 10-27-2005 08:15 PM

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?

pyro.699 10-27-2005 08:15 PM

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

Guest190829 10-27-2005 08:17 PM

So it's not giving errors? But just not working? It could be your hook location.

pyro.699 10-27-2005 08:19 PM

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

(im sorta new to plugins)

pyro.699 10-28-2005 11:29 PM

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!

Softcore 11-03-2005 04:46 AM

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

Adrian Schneider 11-03-2005 05:56 AM

It's working now, he was trying to run a query instead of using the datamanager. :)


All times are GMT. The time now is 01:45 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.01862 seconds
  • Memory Usage 1,739KB
  • 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
  • (3)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete