PDA

View Full Version : >< function problems


Neo
08-25-2002, 06:59 AM
alright here is a example of the code I am using...


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.