Am I missing something here?

Discussion in 'Databases' started by cgo85, Jun 2, 2008.

  1. #1
    Am I missing something here? I'm getting a blank screen in return to this code:

    <?php
    
    include 'config.php';
    include 'opendb.php';
    
    
    $query  = "SELECT city, countyurl, abbr FROM demographic WHERE cityurl='cityurl' GROUP BY cityurl";
    $result = mysql_query($query);
    
    while(list($city,$countyurl,$abbr)= mysql_fetch_row($result))
    {
        echo "<a href=\"/$sub_city/$abbr-$countyurl-$cityurl.html\">$city ($abbr)</a> <br> ";
    }
    
    include 'closedb.php';
    ?>
    PHP:
    in the 'head' I already have:

    $sub = $_GET['sub'];
    $cityurl = $_GET['cityurl'];

    Thanks for any help!!!
     
    cgo85, Jun 2, 2008 IP
  2. MakeThatDollar

    MakeThatDollar Notable Member

    Messages:
    4,451
    Likes Received:
    158
    Best Answers:
    0
    Trophy Points:
    225
    #2
    Shouldn't:

    $query  = "SELECT city, countyurl, abbr FROM demographic WHERE cityurl='cityurl' GROUP BY cityurl";
    Code (markup):
    Be this:

    $query  = "SELECT city, countyurl, abbr FROM demographic WHERE cityurl='[b]$cityurl[/b]' GROUP BY cityurl";
    Code (markup):
     
    MakeThatDollar, Jun 2, 2008 IP
  3. cgo85

    cgo85 Peon

    Messages:
    380
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #3
    yep... you're right. Can't believe I missed that. THANKS!
     
    cgo85, Jun 2, 2008 IP
  4. MakeThatDollar

    MakeThatDollar Notable Member

    Messages:
    4,451
    Likes Received:
    158
    Best Answers:
    0
    Trophy Points:
    225
    #4
    No problem.:D
     
    MakeThatDollar, Jun 2, 2008 IP