Affiliate Marketing
Forum Search

Reply
 
LinkBack Thread Tools Display Modes

  #1 (permalink)  
Old 19-09-06
Keith's Avatar
Moderator
 
Join Date: Aug 2003
Location: Richmond North Yorkshire
Posts: 2,116
Thanks: 19
Thanked 5 Times in 4 Posts
Keith seems to know their stuff
  php / msql help displaying graphics

I am wanting to display a different graphic depending on the content of a field in a mysql database my code is below only problem is XX.gif displays regardless of content,


if ($row>X=="XX") {
$output .= "
<div><img src=XX.gif></div>";
}

i'm assuming its a basic error but i'm only a beginner when it comes to mysql
__________________
Keith
My Blog general ramblings. Internet Marketing Blogs UK all the blogs together in one place (pm for inclusion)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 19-09-06
OLBG's Avatar
aka Antony
 
Join Date: Mar 2005
Location: Bristol
Posts: 528
Thanks: 0
Thanked 0 Times in 0 Posts
OLBG is an unknown quantity at this point
Not sure I understand your sytax there but maybe its because I dont do the object oriented php

Hopefull this example will help

$mysql="SELECT link,image FROM table WHERE category='Lamps'";
$result=mysql_query($mysql);
while($row=mysql_fetch_array($result))
{
echo "<p><as href=\"".$row['link']."\"><image border=0 src=\"".$row['image']."\"></a></p>";
}
__________________
Antony
Free Tipster Competition
Affiliate Program on POR - up to £2/lead
Grand National Guide
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 19-09-06
morleymouse's Avatar
Super Member
 
Join Date: Aug 2003
Location: Costa Del Sheffield
Posts: 2,752
Thanks: 3
Thanked 10 Times in 6 Posts
morleymouse is an unknown quantity at this point
if ($row>X=="XX") {
$output .= "
<div><img src=XX.gif></div>";
}

$row>X=="XX"

should possibly be...


$row=="XX"

so...

if ($row=="XX") {
$output .= "
<div><img src=XX.gif></div>";
}


think might be about right, easier to see more code but the if greater than X == XX thing looked a bit off
__________________
Dan Morley
Alpharooms.com
daniel at alpharooms dot com - Hotels, Flights, Airport Transfers, Care Hire + More! sign up
My Blog | Cheap Holidays
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 19-09-06
Keith's Avatar
Moderator
 
Join Date: Aug 2003
Location: Richmond North Yorkshire
Posts: 2,116
Thanks: 19
Thanked 5 Times in 4 Posts
Keith seems to know their stuff
thanks for the input guys, all sorted now, I was trying to over complicate things
__________________
Keith
My Blog general ramblings. Internet Marketing Blogs UK all the blogs together in one place (pm for inclusion)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #5 (permalink)  
Old 19-09-06
Marc Gear's Avatar
Registered User
 
Join Date: Aug 2003
Posts: 572
Thanks: 0
Thanked 0 Times in 0 Posts
Marc Gear is an unknown quantity at this point
Quote:
Originally Posted by Keith
if ($row>X=="XX") {
$output .= "
<div><img src=XX.gif></div>";
}
Code:
$output = '';
$result = mysql_query('SELECT foo FROM bar');
$row = mysql_fetch_object($result);
if ($row->foo == 'xx' || $row == 'yy')
{
  $output .= '<div><img src="'.$row->foo.'.gif"></div>';
}
__________________
<b>Marc Gear
Senior Developer
Webgains Ltd.
<a href="mailto:marc@webgains.com">marc@webgains.com</a></b>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Internal PHP Processing Error (#99911) Donk Widgets, Coding, AJAX, PHP - Technology & Affiliate Marketing 1 20-02-06 05:50 PM
Anyone anygood with xml, php, mysql and Affiliate Window AnnonnyMouse The Affiliate Marketing Lounge 1 23-09-04 11:00 AM
PHP - No input file specified. - Problem Barry Widgets, Coding, AJAX, PHP - Technology & Affiliate Marketing 1 02-08-04 10:57 AM
Popunder php drivetowin Widgets, Coding, AJAX, PHP - Technology & Affiliate Marketing 4 16-06-04 02:40 PM
PHP or Browser Timeout? Barry Widgets, Coding, AJAX, PHP - Technology & Affiliate Marketing 6 28-04-04 01:04 PM


Affiliate Marketing RSS Feeds - Contact Us - Affiliate Marketing - Archive - Privacy Statement - Top

Content Relevant URLs by vBSEO 3.2.0 RC7