Current location: Hot Scripts Forums » Programming Languages » PHP » [SOLVED] echoing multiple images based on mysql value


echoing multiple images based on mysql value

Closed Thread
  #1 (permalink)  
Old 02-06-12, 05:10 PM
gimmickdinger gimmickdinger is offline
New Member
 
Join Date: Feb 2012
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
echoing multiple images based on mysql value

I keep running into errors when trying to make a script to display multiple images based on the value of a mysql database entry.

Here's an example of what I'm trying to do.

Mysql entry name 'cats' (I currently have this set to VARCHAR)
'cats' = 3

I want to show cat.jpg 3 times in a row and have the amount of images change according to the value of the mysql entry.

I already have 'cats' associated with my functions.php so all I really need is an echo command.
  #2 (permalink)  
Old 02-07-12, 10:38 AM
Nico's Avatar
Nico Nico is offline
Community Leader
 
Join Date: Sep 2005
Location: Spain
Posts: 8,075
Thanks: 11
Thanked 88 Times in 83 Posts
I'm not completely sure if I understand what you're trying to do, but this might help:

PHP Code:

for ($i 1$i <= $row['cats']; $i++)
{
    echo 
/* Something cool */

The Following User Says Thank You to Nico For This Useful Post:
gimmickdinger (02-07-12)
Closed Thread

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
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 On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP and MySQL ? rob2132 Hot Scripts Forum Questions, Suggestions and Feedback 4 08-29-08 02:22 AM
Php based mysql query problome prasanth PHP 3 04-16-08 05:54 PM
Uploading multiple images in one batch bibodom JavaScript 1 03-04-05 09:10 AM
uploading multiple images mivec PHP 2 03-30-04 11:50 AM
inserting images into mysql coatsey PHP 3 12-01-03 07:04 PM


All times are GMT -5. The time now is 09:03 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.