Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 12th, 2003, 08:27 AM
Registered User
 
Join Date: Jun 2003
Location: Oshkosh, WI, USA.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to tenikiwon Send a message via MSN to tenikiwon
Default Maintaining Global variables

I've been working on a form/subform combination.
When you first call the page you get a dropdown box for the customers.
After picking the customer and clicking GO it brings up the customer form and displays the customers information. From there you can update the customer information by clicking on another button.

My problem comes in when I want to display a subform for the customer. In this case. Each customer can have several sites. I can bring up another drop down box that displays the sites for the customer, but when I what to select the site (by Clicking another GO button) it looses the global I have setup for the customer ID.

Here's a brief of what I've tried.
1 > Two files customer.php and site.php. Lost value when switching forms.
2 > Functions customer() and site() using two different switch functions.

I should add that my stucture is similar to this...
function update_customer() <--used when customer alreay exsits
function save_customer() <--used when adding a customer
function get_customer() <---Runs the query and returns the data
function customer_form(results from get_customer) <--form's format
and the same setup for customer_site with two switch functions $site and $customer.
I've also read about using the $gobals["variable"] but think I don't fully understand it.

What is the best way to accomplish a form/subform connecting to a MySQL database?

Thanks in advace.

Andrew J. Nowicki
Reply With Quote
  #2 (permalink)  
Old June 19th, 2003, 02:11 PM
Friend of Wrox
Points: 2,570, Level: 21
Points: 2,570, Level: 21 Points: 2,570, Level: 21 Points: 2,570, Level: 21
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: San Diego, CA, USA
Posts: 836
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I don't fully understand what you're trying to do... it sounds like you want to maintain variable state across multiple page requests. If so, use sessions.

If I'm not getting your drift, please re-explain your problem.


Take care,

Nik
http://www.bigaction.org/
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
global variables Komila ASP.NET 3.5 Basics 2 October 31st, 2008 01:14 PM
Global Variables in C# su C# 2 December 11th, 2006 06:18 PM
Global variables zarol Beginning PHP 3 May 10th, 2005 06:17 AM
Global Variables in .NET mbmsecret C# 5 July 6th, 2004 02:27 AM
Global variables ps124 ASP.NET 1.0 and 1.1 Basics 6 April 6th, 2004 02:48 PM



All times are GMT -4. The time now is 11:14 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.