• I am trying to make a list of players and display them on a page, then I want to show their scores on a new page when a players name is clicked, how can i do this, this is a wordpress plugin.

    functions.php

    function bowling_players_list()
    {
    include(‘shortcodeplayers.php’);
    }
    add_shortcode(‘bowlingplayers’, ‘bowling_players_list’);

    shortcodeplayers.php

    <?php
    //Browse the results
    global $wpdb;
    $table = $wpdb->prefix . “bowling_plus_players”;
    $req = “SELECT * from $table order by player_name;”;
    //TODO Test variable
    $res = mysql_query($req);
    $number = mysql_num_rows($res);
    if ($number == 0) {
    _e(‘No results for the moment’, ‘Bowling_Plus’);
    } else {
    while ($games = mysql_fetch_array($res)) {
    echo ‘<table border=”1″><tr><td>’;
    echo ‘‘;
    echo $games[‘player_name’] . $games[‘player_lname’] . ‘
    ‘;
    echo ‘</td></tr></table>’;
    }
    }
    ?>

    I want it to go to a new page that only shows scores, I have not created template.php yet since I dont know what to put in it or if thats even the right way to go.

    The current page is https://127.0.0.1/?page_id=1

    how to i generate a new page with only the scores when the link is clicked?

Viewing 1 replies (of 1 total)
  • I’m having the same problem with him.

    Using the PHP shortcode I was able to connect my wordpress Site into an external database from my server.
    I planning to have a page wherein users can search a specific records and when a result found, site will offer a specific link for that specific record.

    Is that possible? I’m a newbie in wordpress.
    I know it is possible in PHP/MYSQL but wordpress is a different thing.

Viewing 1 replies (of 1 total)
  • The topic ‘Add pagination or create page from mysql with wordpress plugin shortcode?’ is closed to new replies.