Here I have two functions, the first returning a value to the second.
When I put print_r() on the last line of the first function, I can see
that the correct values are in the array as expected. But when I put
print_r() in the second function, around the array supposedly returned
from the first function. I get nothing. What should I look for?
function getJustOneEntry($cbId) {
$query = $this->secure("SELECT * FROM mcContentBlocks WHERE
cbId=$cbId AND cbBelongsToWhichWebsite='$this->cbBelongsToWhichWebsite'");
$result = $this->db->query($query);
$dbArray = dbResultIntoArray($result);
if ($dbArray) $dbArray = processArray($dbArray, "stripslashes");
// 04-05-03 - I'm introducing this new $entryArray right now
tonight. From now on
// 1 dimensional returns will return a 1 dimensional array, called
$entryArray.
// $dbArray will continue to be 2 dimensional.
$entry = $dbArray[0];
print_r($entry);
return $entry;
}
function printEditUserFormForAdmin2($warning="", $entryId=0) {
// 06-23-03 - redoing this form tonight.
global $users, $sql, $forms;
$users->check("root");
// 06-23-03 - normally this forms submits and calls updateUserInDs()
to process the input, but
// if the two passwords don't match, then updateUserInDs() needs to
kick the admin back to this page,
// with a warning and the id of the entry under discussion. Thus the
parameters for this function.
if ($entryId) $cbId = $entryId;
if (!$entryId) $cbId = getGetVar("cbId");
$entry = $sql->getEntryFromDb($cbId);
echo "<hr> $entry[1] <hr>";
extract($rwArray=$sql->putEntryInNamedArray($entry));
startPage($warning);
startForm("Edit a users name, password, or permissions here:");
$forms->text("Enter a name for this user:", "newUserName",
$newUserName);
$forms->text("Optional: What is this users email address?",
"cbEmail", $cbEmail);
$forms->password("Enter a password:", "cbPassword1", $cbPassword);
$forms->password("Enter the same password again:", "cbPassword2",
$cbPassword);
$forms->text("What permission should this user have? The options are
'basic', 'verified', 'associate', and 'root'. You're insane if you
give 'root' to anyone you don't totally trust.",
"cbUserSecurityLevel", $cbUserSecurityLevel);
$forms->output("n");
endForm("updateUserInDsForAdmin", "cbId", $cbId);
endPage();
} 2 1851
In article <da**************************@posting.google.com >, lk******@geocities.com (lawrence) wrote: Here I have two functions, the first returning a value to the second. When I put print_r() on the last line of the first function, I can see that the correct values are in the array as expected. But when I put print_r() in the second function, around the array supposedly returned from the first function. I get nothing. What should I look for?
In the code you posted, the the second functions never calls print_r nor
does it call the first function. Did you copy the right pair of functions?
--
CC
CC Zona <cc****@nospam.invalid> wrote in message news:<cc**************************@netnews.attbi.c om>... In article <da**************************@posting.google.com >, lk******@geocities.com (lawrence) wrote:
Here I have two functions, the first returning a value to the second. When I put print_r() on the last line of the first function, I can see that the correct values are in the array as expected. But when I put print_r() in the second function, around the array supposedly returned from the first function. I get nothing. What should I look for?
In the code you posted, the the second functions never calls print_r nor does it call the first function. Did you copy the right pair of functions?
After I went home for dinner it occured to me that I was using an
alias and the alias could be faulty. I'd ruled that possibility out in
my head, because I was certain I'd used the alias before. But
apparently not. Sure enough, this morning I check, and the alias
wasn't returning anything. The corrected alias looks like this:
function getEntryFromDb($cbId) {
// 07-15-03 - alias of above
$entry = $this->getJustOneEntry($cbId);
return $entry;
} This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: beliavsky |
last post by:
If a function that normally returns N values raises an exception, what
should it return? N values of None seems reasonable to me, so I would
write code such as
def foo(x):
try:
# code setting...
|
by: wired |
last post by:
Hi,
I've just taught myself C++, so I haven't learnt much about style or
the like from any single source, and I'm quite styleless as a result.
But at the same time, I really want nice code and I...
|
by: Jef Driesen |
last post by:
I need to implement a function to implement the rounding of floating point
values. At the moment i have two different implementations, depending on the
type of the return value (integer or double)....
|
by: anguo |
last post by:
i find in many hash function use 5381,for exampla:
static constmap_hash hash(char *pchData, int iLen)
{
unsigned char cBuf;
constmap_hash ulHashId;
ulHashId = 5381;
while (iLen > 0)
{
cBuf =...
|
by: ben.carbery |
last post by:
Hi,
I have just written a simple program to get me started in C that
calculates the number of days since your birthdate.
One thing that confuses me about the program (even though it works) is...
| |
by: Michael |
last post by:
Hi,
I'm having difficulty finding any previous discussion on this -- I
keep finding people either having problems calling os.exec(lepev), or
with using python's exec statement. Neither of...
|
by: Beta What |
last post by:
Hello,
I have a question about casting a function pointer. Say I want to make
a generic module (say some ADT implementation) that requires a function
pointer from the 'actual/other modules'...
|
by: D |
last post by:
Hello all...I have an issue with one of my java script functions that
I'm hoping someone can easily help with. I have a web based application
that we use to create/sign up for overtime. When we...
|
by: DiAvOl |
last post by:
Hello everyone,
Please take a look at the following code:
#include <stdio.h>
typedef struct person {
char name;
int age;
} Person;
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |