?
Solved

error retriving info from function

Posted on 2006-10-28
3
Medium Priority
?
170 Views
Last Modified: 2006-11-28
Im completely trying to change the way I original programmed a web application in php and Im expierencing some difficulties

on a certain page for example dealerFunctions.php, I want to have three available tasks all depending on permissions and the button clicked...

if create
if modify
if delete
if view

for any of those functions I call the appropriate function which contains mostly the sql statement

and then I have an includes for the html

because my sql is in the functions Im having troubles bringing the variables back over to appear in the includes file

however if I call function modify with the vehicleId and I echo my query I do get what I want !
0
Comment
Question by:prowebinteractive
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 29

Expert Comment

by:TeRReF
ID: 17826289
If you are dealing with globals, use the $GLOBALS superglobal inside functions...
0
 

Author Comment

by:prowebinteractive
ID: 17826302
please send me an example havent used globals before

Thanks
0
 
LVL 29

Accepted Solution

by:
TeRReF earned 2000 total points
ID: 17826361
<?php

// a function
function addBlah() {
        // use $GLOBALS to retrieve the global $string and add blah
        return $GLOBALS['string'].'blah';
}
// if you define a global var here
$string = 'blah';
// add blah to $string
$string = addBlah();
// returns blahblah
echo $string;


?>


0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses four methods for overlaying images in a container on a web page
There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question