Hi,
I am new to coding PHP and using MySQL I am designing a page to display some information from a database onto the page. I have tried to figure out this problem before asking for help, but I think I've come to a standstill with my knowledge. I am trying to get a section of code to changed depending on the active field. If the field is set to 1 (active) I want a player link and a download link, if the active field is 0 (unactive) I want only [Archived] to appear.
Example: If Active=1
John Urban Show (show date) [PLAYER LINK][DOWNLOAD LINK]
Show desription
If Active=0
John Urban Show (show date) [archived]
Show desription
<?php
include 'connect.php';
$query = "SELECT show_num, orig_date, show_desc, filename, active FROM `show` WHERE year=2008" ;
$result = mysql_query($query);
while($row = mysql_fetch_assoc($result))
{
echo "John Urban Show #{$row['show_num']} ({$row['orig_date']});"
if({$row['active']}=1 {
echo "[<a href=\"http://myurl.com/pc/{$row['filename']}\">Download Show</a>] [<a href=\"http://myurl.com/player.php?id={$row['show_num']}\">Listen in Player</a>] <br>" .
}
echo "[Archived]<br>" .
echo "Show Descript : {$row['show_desc']} <br><br>";
}
?>
I am pretty sure that this probably isn't hard, but with being as new with programing with this as I am, I can't figure this out, any help would be greatly appreciated.