General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old October 4th, 2003, 08:30 PM
nestorvaldez nestorvaldez is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Posts: 40 nestorvaldez User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 m 21 sec
Reputation Power: 6
print graphics number .jpg from table

I'm trying to print numbers, I save a value in a column of the table, and I have all the number .jpg in the images/numeros
and I use this code to show it in the site... I have to repeat it all the number with each table's column.

this is the condition..

if ($row['num1']) = 1 print "<img src=\"images/numeros/01.jpg\" width=\"75\" height=\"40\">";
elseif ($row['num1']) = 2 print "<img src=\"images/numeros/02.jpg\" width=\"75\" height=\"40\">";

so on....

and it return me this error....
Parse error: parse error in /home/mailcrea/public_html/loto/index.php on line 63

I need to know if I can do this in another way...?
a more easy code to show number depending on the one save in the table...?

Reply With Quote
  #2  
Old October 4th, 2003, 09:08 PM
Bruski Bruski is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Toronto, Canada
Posts: 192 Bruski User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
just get your row from your database and say you declare it as
PHP Code:
 $number=$row['num1']; 

echo 
"<a href=\"images/numeros/$number.jpg\"></a>"


i think thats what you want im not too sure...this will simply take what you have in the database store it in a variable and when you call it for the picture it calls it in that variable...so if the variable would be equal to 2 then then it would display 2.jpg

hope this helps im not quite understanding the problem

the problem that i am seeing with your example is that your dont have the {} anywhere

here is the modded one that should work

PHP Code:
if (($row['num1']) = 1) { echo "<img src=\"images/numeros/01.jpg\" width=\"75\" height=\"40\">"
} elseif ((
$row['num1']) = 2) { echo "<img src=\"images/numeros/02.jpg\" width=\"75\" height=\"40\">";



something along those lines

Last edited by Bruski : October 4th, 2003 at 09:15 PM.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > print graphics number .jpg from table


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT