Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    Regular Coder
    Join Date
    Jun 2008
    Posts
    680
    Thanks
    114
    Thanked 2 Times in 2 Posts

    Problem with getting info

    Okay well first off really the only I want right now is for my titlehistory.php script which shows all of my titles and when you scroll over one it says titlehistory.php?id="whatever" and when you click on it I want it to bring up that titles info which shows all kinds of things.

    The example page of the info that should show up when you click the title on the title history page.http://www.kansasoutlawwrestling.com/titlehistory3.php

    It's just not getting the info.

    Here's titlehistory.php

    PHP Code:
    <?php

    // Connects to your Database
    $link mysql_connect("?""?""?") or die(mysql_error());
    mysql_select_db("?",$link) or die(mysql_error());
     
    if (!
    mysql_select_db("?"$link)) {
    echo 
    'Could not select database';
    exit;
    }


    print 
    '<table border=0 cellspacing="0" cellpadding=3 width=575>';
    print 
    '<tr><td background="images/bg_bar4.gif" height=35>&nbsp;<font color="white">Title Histories</font></td></tr>';
    print 
    '</table>';
    print 
    '<table border=0 cellspacing="0" cellpadding=3 width=575>';
    print 
    '<tr><td background="images/bg_bar3.gif" height=35 colspan=4>&nbsp;Active Titles</td></tr>';
    print 
    '<tr>';

    //Define the query
    $query "SELECT * FROM titles WHERE status = 'Active'"// Active rows

    if ($r mysql_query ($query)){ // Run the query. 

        
    while ($row mysql_fetch_array ($r)){
        
            print 
    '<td><a href="titlehistory3.php?id=' $row['id'] . '" title="View KOW '.$row['titlename'].' History">';
            print 
    '<img src="/images/' $row['titleimage'] . '" border=0 alt="View KOW '.$row['titlename'].' History" height="115px" width="115px"></a></td>';
        
        }

    } else {
        die (
    '<p>Could not retrieve the data because <b>' mysql_error() . '</b>. The query was $query.</p>');
    //End of query IF 

    print '</tr>';
    print 
    '</table>';
    print 
    '<img src=images/spacer.gif><br>';
    print 
    '<table border=0 cellspacing=0 cellpadding=3 width=575><tr><td background="images/bg_bar3.gif" height=35 colspan=2>&nbsp;Inactive Titles</td></tr>';
    print 
    '<tr>';

    //Define the query
    $query "SELECT * FROM titles WHERE status = 'Inactive'"// Inactive Rows

    if ($r mysql_query ($query)){ // Run the query. 

        
    while ($row mysql_fetch_array ($r)){
        
            print 
    '<td><a href="titlehistory3.php?id=' $row['id'] . '" title="View KOW '.$row['titlename'].' History">';
            print 
    '<img src="/images/' $row['titleimage'] . '" border=0 alt="View KOW '.$row['titlename'].' History" height="115px" width="115px"></a></td>';
        
        }

    } else {
        die (
    '<p>Could not retrieve the data because <b>' mysql_error() . '</b>. The query was $query.</p>');
    //End of query IF 

    print '</tr>';
    print 
    '</table>'
    ?>

    Here's titlehistory3.php
    PHP Code:
    <?php
    // Connects to your Database
    $link mysql_connect("?""?""?") or die(mysql_error());
    mysql_select_db("?",$link) or die(mysql_error());
     
    if (!
    mysql_select_db("?"$link)) {
    echo 
    'Could not select database';
    exit;
    }

    //Define the query
    $query "SELECT * FROM titlehistory";

    if (
    $r mysql_query ($query)){ // Run the query. 


    print '<table border=0 cellspacing="0" cellpadding=3 width=575>';
    print 
    '<tr><td background="images/bg_bar4.gif" height=35>&nbsp;<font color="white">Title Histories</font></td></tr>';
    print 
    '<tr><td></td></tr>';
    print 
    '</table>';
    print 
    '<table border=0 cellspacing="0" cellpadding=3 width=575>';
    print 
    '<tr><td background="images/bg_bar3.gif" height=35 colspan=2>&nbsp;KOW '.$row['titlename'].'</td></tr>';
    print 
    '<tr><td width=200><img src="/images/' $row['titleimage'] . '" width=208px height=156px border=0 alt="View KOW '.$row['titlename'].' History"></td><td valign=top>';
    print 
    '<table cellpadding="2" cellspacing="0" border="0" width=100%>';
    print 
    '<tr><td align=center bgcolor=#E0E0E0><b>Date Created</b></td></tr><tr><td align=center>'.$row['datecreated'].'</td></tr>';
    print 
    '<tr><td bgcolor=#E0E0E0 align=center><b>Status</b></td></tr>';
    print 
    '<tr><td align=center>'.$row['status'].'</font></td></tr>';
    print 
    '<tr><td bgcolor=#E0E0E0 align=center><b>Longest Reign</b></td></tr>';
    print 
    '<tr><td align=center><a href=bio.php?'.$row['longestreign'].'><b>'.$row['longestreign'].'</b></a> ('.$row['numdays'].')</td></tr>';
    print 
    '<tr><td bgcolor=#E0E0E0 align=center><b>Most Successful Defenses</b></td></tr>';
    print 
    '<tr><td align=center><a href=bio.php?'.$row['sucessdefenses'].'><b>'.$row['sucessdefenses'].'</b></a> ('.$row['numdef'].')</td></tr>';
    print 
    '</table>';


    } else {
    die (
    '<p>Could not retrieve the data because <b>' mysql_error() . '</b>. The query was $query.</p>');
    //End of query IF 
    ?>

  • #2
    Regular Coder
    Join Date
    Jan 2007
    Posts
    142
    Thanks
    9
    Thanked 1 Time in 1 Post
    Looks like that if $r is wrong. What's $r?

    Also, there is no loop in the titlehistory3.php file.

  • #3
    Regular Coder
    Join Date
    Jun 2008
    Posts
    680
    Thanks
    114
    Thanked 2 Times in 2 Posts
    What should it be? That's what I've been running on all my scripts.

    And what loop do I need?

  • #4
    Regular Coder
    Join Date
    Jan 2007
    Posts
    142
    Thanks
    9
    Thanked 1 Time in 1 Post
    Quote Originally Posted by CoolAsCarlito View Post
    What should it be? That's what I've been running on all my scripts.

    And what loop do I need?
    I really don't know. I don't use an approach like that on mine. I was just popping off the first things that I saw that didn't look like they would work but if it does on your other ones then I'm probably wrong. I'm just a self-taught novice.

  • #5
    Regular Coder
    Join Date
    Jun 2008
    Posts
    680
    Thanks
    114
    Thanked 2 Times in 2 Posts
    So am I.

  • #6
    Regular Coder
    Join Date
    Jan 2007
    Posts
    142
    Thanks
    9
    Thanked 1 Time in 1 Post
    Seems like you would need a while loop in the titlehistory3 file just as you do in the first file.


  •  

    Posting Permissions

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