Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

php problem

  • 05-05-2008 02:13PM
    #1
    Closed Accounts Posts: 179 ✭✭


    this code deosnt seem to print back out the data from my table, any suggestions wud be appreciated


    GLOBAL $bookmark_table, $cell_color;

    $query = "SELECT id, site_name, url, DATE_FORMAT(date_added,'%m-%d-%Y') AS
    date_added, description
    FROM $bookmark_table
    ORDER BY date_added DESC";

    $result = count($id);

    print "<div align=\"center\"><table cellpadding=\"2\" cellspacing=\"1\"
    border = \"0\" width = \"600\">";

    for ($row = $result; $row >= 1; $row-=1) :

    print "<tr><td>";
    print "<b>".$row["site_name"]."</b> | Posted:
    ".$row["date_added"]."<br>";
    print "</td></tr>";

    print "<tr><td>";
    print "<a href = \"http://".$row["url"]."\"&gt;
    http://".$row["url"]."</a><br>";
    print "</td></tr>";

    print "<tr><td valign=\"top\">";
    print $row["description"]."<br>";
    print "</td></tr>";

    print "<tr><td><hr></td></tr>";

    endfor;


Comments

  • Closed Accounts Posts: 8,866 ✭✭✭Adam


    You're not actually executing the mysql query. Set $result=mysql_query($query); and then $row=mysql_fetch_array($result);


  • Closed Accounts Posts: 179 ✭✭mrDuke


    cheers that work a sweet!


  • Closed Accounts Posts: 8,866 ✭✭✭Adam


    No probs!


Advertisement