Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
php/mysql help?
11-24-2009, 11:10 AM
Post: #1
php/mysql help?
honestly i dont know if this is the correct spot but i did not see anywhere else

PHP Code:
<?
if ($_GET["cmd"])
{
    
$catname=$_GET["name"];
    
$catid=$_GET["ugh"];
?>

<p class="pageheader">\}<?=$catname?>{/</p><br>
<br>
html for my table goes here
<?
   
//display all the catigories
   
$result mysql_query("SELECT * FROM Files ORDER BY name"); 
   
   
//run the while loop that grabs all the catagories scripts
   
while($r=mysql_fetch_array($result)) 
   { 
      if (
$r["Category"] == $catid)
{
      
$catee=$r["Category"];
}
      
$filename=$r["FileName"];
      
$id=$r["ID"];
      
$desc=$r["Description"];
      
$type=$r["ContentType"];
      
$name=$r["Name"];
      
$addby=$r["AddedBy"];
      
$rank=$r["Rank"];
      
$locked=$r["Locked"];
//      $rank=$r["Rank"];grab the required rank
if ($r["Rank"]==7):
$rank="Tao Incarnate";
elseif (
$r["Rank"]==1):
$rank="Hopeful";
elseif (
$r["Rank"]==2):
$rank="Believer";
elseif (
$r["Rank"]==3):
$rank="Follower";
elseif (
$r["Rank"]==4):
$rank="Disciple";
elseif (
$r["Rank"]==5):
$rank="Adept";
elseif (
$r["Rank"]==6):
$rank="Guide";
endif;

if (
$catee == $catid && $r["Rank"] <= $omgitsgod && $type == "text/plain" || $type == "text/html")
{
      echo 
"<tr>";
      echo 
"$name";
      echo 
"<td class=\"downloads\">$catee and $catid</td>";
    } elseif (
$catee==$catid && $r["Rank"]>=$omgitsgod) {
more echos
    
} elseif ($catee==$catid && $type=="image/jpeg" || $type=="image/pjpeg" || $type=="image/gif" || $type=="image/bmp") {
even more echos
    
}
    } 

the problem im having is that once it pulls the information from the mysql db it will display it no matter what so i get stuff from blank and 1 for example to 5 and 1 and so on when its not the information im trying to pull, anyone have any ideas i have been pecking at this for hours.
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:

Contact UsThe SmartAssReturn to TopReturn to ContentLite (Archive) ModeRSS Syndication