I need some quick help....

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mostwanted
Forum Newbie
Posts: 2
Joined: Mon Apr 02, 2007 4:53 pm

I need some quick help....

Post by mostwanted »

Hi guys!
I'm new here and also very new to PHP... so please bare with me...
What I need help in is, I'm trying to display 4 of the last images I added from my database with 2 images on the top and 2 images on the bottom.
Could anyone please help me with this??


Thanks in advance!
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: I need some quick help....

Post by John Cartwright »

mostwanted wrote:What I need help in is, I'm trying to display 4 of the last images I added from my database
Assuming your using mysql..

Do you have an auto incrementing key? If so, you could use a query like

Code: Select all

SELECT * FROM `images` ORDER BY `id` DESC LIMIT 4
mostwanted wrote:with 2 images on the top and 2 images on the bottom
Not sure what this means.
mostwanted
Forum Newbie
Posts: 2
Joined: Mon Apr 02, 2007 4:53 pm

Post by mostwanted »

How would I be able to have them show up..
I tried that and it didn't work.. :?

As far as the, "with 2 images on the top and 2 images on the bottom". I would like to have 2 images show on top and 2 images on the bottom of a table...

Thank you very much for the reply!!
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

You need to use the mysql_* functions to connect to the database, execute the query, fetch the results and echo them.
Post Reply