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 3 of 3
  1. #1
    Regular Coder
    Join Date
    Jun 2012
    Posts
    133
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Values won't take effect

    http://mroldies.net/showtable.php?year=1960

    The flash player shows the same player for all years.
    It is supposed to change according to the year clicked.
    The $year value is being pased, but has no effect.

    Why?



    PHP Code:
    <?php

    $list
    [0]='<iframe id="ytplayer" type="text/html" width="480" height="270" 
    src="https://www.youtube.com/embed/tSsiS-v6_6M?playlist=Smlaq1ezQRM,
    mxfljegYXk4,E3meEmDpaDU,IE-AcC53OYY,QkMVscR5YOo,uVyBRdBVCiU,
    BGLR25EJtfE,kJ6yAYHsHqg,im9XuJJXylw,kHRbQfkmoSE&version=3" 
    frameborder="0" allowfullscreen>'
    ;

    $list[1]='<iframe id="ytplayer" type="text/html" width="480" height="270" 
    src="https://www.youtube.com/embed/ghFBvBmXv4E?playlist=iuZTk1hdpMs&version=3" 
    frameborder="0" allowfullscreen>'
    ;


    $year=$_GET['year'];

    if (empty(
    $year)) {$year=1960;}



    /* connect to the db */
    $con mysql_connect('localhost','user','password');


    if (!
    $con){die("can not connect: " mysql_error());}

    mysql_select_db('db',$con);

    $sql="SELECT * FROM A".$year;

    $myData=mysql_query($sql,$con);



    $i=1;
    echo 
    "<table border='1'>\n";
    echo 
    "<tr><th colspan='3'>".$year."</th>";
    echo 
    "<tr><th></th><th>Title/Flip</th><th>Artist/Label</th></tr>\n";

    while (
    $record mysql_fetch_array($myData)) {
    echo 
    "<tr>";
    echo 
    "<td class='atd'>$i</td>";
    echo 
    "<td class='btd'><div class='blu'><a href='http://mroldies.net/top100-$year.php?number=$i' rel='ajaxpanel' data-loadtype='iframe'>" $record['atitle'] . "</a></div><br>" $record['btitle'] . "</td>";
    echo 
    "<td class='ctd'>" $record['artist'] . "<br>" $record['label'] . "</td>";
    echo 
    "</tr>\n";
    $i++;
    };

    echo 
    "</table>";



    ?>

    </div>


    <div id="box3">


    <?php

    $year
    =$_GET['year'];

    if (empty(
    $year)) {$year=1960;}

    echo 
    $year."<br>";
    $year=(int)$year;

    if (
    $year=1960) { echo $list[0]."\n"; }
    if (
    $year=1961) { echo $list[1]."\n"; }

    echo 
    $year;


    ?>
    The first $year shows but the second one does not.
    Last edited by Suwannee_guy; 04-21-2013 at 03:20 AM.

  • #2
    Senior Coder
    Join Date
    Aug 2006
    Posts
    1,303
    Thanks
    11
    Thanked 283 Times in 282 Posts
    Code:
    if ($year=1960)
    This is an assignment ($year = 1960). You wanted a comparison ($year == 1960)

    Dave

  • #3
    Regular Coder
    Join Date
    Jun 2012
    Posts
    133
    Thanks
    0
    Thanked 0 Times in 0 Posts
    That worked thanks.


  •  

    Posting Permissions

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