vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   >< function problems (https://vborg.vbsupport.ru/showthread.php?t=42724)

Neo 08-25-2002 06:59 AM

>< function problems
 
alright here is a example of the code I am using...

PHP Code:

function tempinfo($vars...) {
  
// form html here
}

function 
newFunc($vars...) {

  
// error code and global here

  
if ($_GET['action']=="this") {
    
// tempinfo stuff here
  
}

  if (
$_POST['action']="that") {
    
$DB_site->query("UPDATE $dbtablename SET $dbtableset WHERE $dbtablewhere");
  }

newFunc($vars..., $dbtablename="user",$dbtableset="this='that'",$dbtablewhere userid="$bbuserinfo[userid]"); 

Now the error I get is at the DB query... it says that the query is empty and is does to return a empty query... but when I echo the variables they show up just fine, or when I define the variables in the function it will work somewhat... but that is not what I am shooting for... so if you could enlighten me as to why it does this I would be very greatful..

thanks for your time
- Neo Funk :bandit:

Logician 08-26-2002 07:34 AM

either globalize your $dbtablename, $dbtableset, $dbtablewhere variables in function newFunc (global $dbtablename, $dbtableset, $dbtablewhere;) or add them to your function parameters:
function newFunc($dbtablename=X, $dbtableset=Y, $dbtablewhere=Z, and other variables..)

g-force2k2 08-26-2002 01:54 PM

i was going to suggest that but im curious as to what the

($vars...) does? any word on that would be great :) regard...

g-force2k2

Neo 08-28-2002 02:19 PM

nevermind I got it working.. :)

thanks anyways

Scott MacVicar 08-29-2002 09:06 AM

I think he's just showing you one variable instead of the six he probably has.


All times are GMT. The time now is 07:36 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.01497 seconds
  • Memory Usage 1,727KB
  • 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
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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