SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    Formerly known as RockNRollPig Shpigford's Avatar
    Join Date
    Dec 2002
    Location
    Denver, CO
    Posts
    2,877
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    how would i set up my variable to do this?

    okay...im not real positive on the best way to do this but here's sorta what i was thinking. i want to have a variable that does something like
    PHP Code:
    if ($category action) {
    print 
    "<a href=""\"#\">";

    but im confused as to what i set "$category" to...the page is setup to query my database and display all the games in a certain category and next to each game i want to display a link to the main section of each game (ie 'action games')....do i set "$category" to "genre" (which is the field that contains what each genre of game is)? if you go HERE you'll see what im trying to do...i just did that with html...it's the small text in parenthese next to each game....i hope i explained all the correctly...sorry if i didn't...

  2. #2
    Prolific Blogger silver trophy Technosailor's Avatar
    Join Date
    Jun 2001
    Location
    Before These Crowded Streets
    Posts
    9,446
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yeah use genre. It would make the most sense far as I can tell. also, you'll want to use 2 ='s for the comparison

    if($category == 'genrename') {
    Aaron Brazell
    Technosailor



  3. #3
    Formerly known as RockNRollPig Shpigford's Avatar
    Join Date
    Dec 2002
    Location
    Denver, CO
    Posts
    2,877
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    how would i print that where i want? the chunk of code i would like to include it in is listed below...right after "description":

    PHP Code:
    echo("<td><a href=""\""$row["game_page"] ."\"><img src=""\""$row["image_small"] ."\"></a></td>");
      echo(
    "<td valign=top><a href=""\""$row["game_page"] ."\">".$row["game_name"]."</a><br>");  
      echo(
    $row["description"]. [b][color=red]I WANT THE LINK HERE[/color][/b]"</td>"); 


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •