Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing a variable?

Status
Not open for further replies.

danima

Programmer
Jan 9, 2002
134
CA
Hi folks:

I'll apologize in advance for my question. I'm not a programmer like most of you. I get buy (some cutting, pasting, modifying)...but I have great programmers to do our work. Problem is they are all busy and I think I bit off a bit more than I can chew on one of our projects.

We are doing a site for a local hotel and they have 4 seperate packages they offer their visitors (room, wedding, meeting and social packages). In another system we have (that I moved over and started modifying) there is a function called displayPropertyPackage(). This gets called in the index file of the individual package pages. Problem is...it pulls up all of the packages (from all 4 categories). I need all 4 pages (Wedding, Room, Social and Meeting) to pull up just the packages that pertain to that group. So, I modified the query as follows:

$sqlquery = "
SELECT * FROM package_groups
WHERE package_group_display = 1 and package_group_id = 2
ORDER BY package_group_order ";

I added the "and package_group_id = 2"

Of course, this just brings the Room categories up (Room is id 2). I was really proud of myself but then realized I'd have to copy the function 3 times to accomodate the other 3 package_group_id numbers. So, I asked our programmer what to do. He's busy and getting ready to go away...so, he thinks I can handle this (tee hee). He says "pass a variable to the function". "simple just add a variable in the brackets of the function called group_id"

I realize that he wants this to happen
displayPropertyPackage(something here)
... and he thinks I can handle this...I do understand it...but do not know how to execute it...

I'm just not certain how to write this...and he's out of town for the next few days....and I'm in a bind. Any help would...well, helpful.

Thanks in advance.


 
Is that PHP? If so, you'd be better off posting it in the PHP (or whatever) forum, as it's a programming issue, really nothing to do with MySQL.
 
WHoops...you are right...wrong forum.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top