Web Hosting Talk







View Full Version : PHP Questions


sasjamal
05-20-2003, 11:06 PM
Ok, I have 2 Classes, a Navigation Bar Class.

One of its methods is to add some paramaters to my SQL Query to limit it to 20 records out of say 300 records.

And another method is to create a Menu based upon how many Records there are, and how many you want to show at one time.

I have another class, and one of it's methods is to pull some records out, I use this class, and i apply the method of the previous class before I output the records.

My Dilemma Is:

On the actual PHP Page, I need to create an Object based off the First Class, so I can get the method to pull my Navigation Menu.

Is there any way, My Second Class can just use the same Instance of the Object I have already initialized?

When I Was coding this, I could not so I just coded around it by creating another instant of the object, but I wanna make my code as perfect as possible now, So I would like to know how you guys would do this? Or is it even possible.

In the mean time, I will go back to my book, and figure it out, but Maybe After I am done reading, it still will not click in my head (though if the book covers it, I do not see why not).

But let us say, I am done reading, and I did not get it, I hope someone has answered the Question for me by then, so I know.

Thanks lol :D

Wa Salamu 'Alaikum wa Rahmatullahi wa Barakatuh

<< total newBIE to PHP.

Joe Bonanno
05-21-2003, 12:05 AM
Edit: wound up in wrong thread.:blush:

digitok
05-21-2003, 12:22 AM
You can use:

WHERE user_id NOT IN(13,15,32)

sasjamal
05-21-2003, 01:43 AM
huh? lol