• HuddersfieldH

    (@huddersfield-hosting)


    Hi,

    I’m wanting to have a table on my site that allows me to see the sub directory, blog id and mapped domains in a table.

    So far I’ve got how to show the blog id and directory from main domain, but can’t get the recalling mapped domains bit right.

    I’m using the main domain mapping plugin.

    The code I use to recall the current info is as follows:

    $con=mysqli_connect("localhost","USER","PASSWORD","DATABASE");
    // Check connection
    if (mysqli_connect_errno()) {
      echo "Failed to connect to MySQL: " . mysqli_connect_error();
    }
    
    $result = mysqli_query($con,"SELECT * FROM hh_blogs");
    
    echo "<table border='0'>
    <tr>
    <th>Blog ID</th>
    <th>Address</th>
    </tr>";
    
    while($row = mysqli_fetch_array($result)) {
      echo "<tr>";
      echo "<td>" . $row['blog_id'] . "</td>";
      echo "<td>" . $row['domain'] . "" . $row['path'] . "</td>"; }
      echo "</tr>";
    echo "</table>";
    
    mysqli_close($con);

    I want to recall the relevant domain(s) in the third column from hh_domain_mapping.

    You can see what I’ve done at
    https://huddersfieldhosting.co.uk/bloglist

    You need to login first though at
    https://huddersfieldhosting.co.uk/clients

    (If you don’t login you’ll get bounced to the clients page)

    Thank you

  • The topic ‘Calling information from database into tables.’ is closed to new replies.