On 10/8/2012 11:11 PM, David McGlone wrote:
Hi all,

is there any other way to limit this code to only displaying 1 image other
than using return. When I use return, I can't get the other images to display
in lightbox, but when I use echo, all 5 of the images will correctly display
in lightbox, but they are also displaying on the page.

$result = mysql_query("SELECT * FROM properties");
       $row = mysql_fetch_array($result);
       $matches = glob('images/property_pics/212006966/' .$prefix. '*');
       foreach($matches as $match){
       echo "<a href=$match  rel='lightbox[$matches]' /><img src =

I'm not even sure if this is possible, but thought I'd ask before I scrapped
the idea. I've been at this code since last thursday trying to learn as much
as I can about it and I just keep going in circles and I'm starting to feel
like glob() is what is limiting me. I've tried various code blocks with things
like where(), str_repeat, basename, scandir, sort etc with no luck. :-/

I hate to sound condescending, but you are showing some serious deficiencies in your programming ability. I have to say that you are tackling some very complex processes without the basic understanding of programming that one needs. What I base this opinion on is that since you first revealed your lack of understanding of Return and echo in php, you have spent another 3 days and STILL don't understand? Really?

As for the code above - once again it looks like you have posted a re-typing of some code you have tried to execute. I say that because you have a query and a fetch of one record of the results THAT HAS NOTHING TO DO WITH THE REST OF THE CODE! Also - you have an array being used as part of the Rel tag? What's up with that? (I think you meant to use $match - but that further verifies that this is NOT the code you ran.)

Finally - the code is (from your description) doing exactly what it is designed to do (the running code that is). All the (repeated) "echo" statements are going to put something on your web page. The question you have is (apparently) how to hide them, since I believe Lightbox is going to have to have them present in order to do its thing. And so - in parting - I think you need to develop some html knowledge to facilitate that "hiding" part and some immediate skills in the general area of programming and learning to locate and read the right manuals. "Glob" is the least of your concerns.

Yes - I'm being rough (I say this to you David as well as the rest of the community that is still interested in this post) but somebody has to make you realize that you are seriously in over your head and don't even know it. Have you read a book on php and perhaps one on CSS to help with your "hiding" problem? (BTW - that last was a hint.)

AND PLEASE - don't post supposed "code snippets" again. Let us see what you really ran if you want us to help. Or do you not know how to copy and paste either? I/we can't help you if we can't see it.

Sorry to be so blunt.

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to