Jump to content

Funce

Moderator
  • Posts

    602
  • Joined

  • Last visited

  • Days Won

    19

Posts posted by Funce

  1. Well, the two things you've got for standard styling is to add an ID to that element, or add a class to it. Then use CSS selectors that match (`#ID` or `.class`)

  2. Hey there! Welcome to the forums!

    This one can be a bit mind boggling. But I did manage to get it to work.

    It involves using GROUP BY on both `artist` and `title`. Take a look!

    SELECT *, COUNT(title)
    FROM plays
    GROUP BY artist, title

     

  3. What I was going to get to, is that while the manner at which you create the HTML is different, its still going to be HTML.

    This means that you while you can create a fixed link like the following

    <tr width:100%="">
             <td text-align:="" left;="" width:="" 50%;="">Good Morning!</td>
             <td text-align:="" center;="" width:="" 50%;=""><a href="https://www.website.com/goodmorning.php">https://www.website.com/goodmorning.php</a></td>
    </tr>

    Because you know how to make a link.

     

    To make a link with something from a database is the same. You know that referencing your database fields resolves them to Text. You just need to put that text in the right spaces inside your HTML. Just because we make it with PHP, doesn't stop this.

    Including dsonesuk's solution:

    <?php
    	while($row = $result->fetch_assoc()) {
            $the_url = $row["the_url"];
        echo "<tr width:100%>
             <td text-align: left; width: 50%;>" . $row["some_text"] . "</td>
             <td text-align: center; width: 50%;><a href='" . $row["the_url"] . "'>" . $row["the_url"] . "</a></td>
             </tr>";
        }
        echo "</table>";
        } else { echo "0 results"; }
            echo "The URL--> " . $the_url;

     

  4. Think about it like this. Your output is just straight HTML.

    <tr width:100%="">
             <td text-align:="" left;="" width:="" 50%;="">Good Morning!</td>
             <td text-align:="" center;="" width:="" 50%;="">https://www.website.com/goodmorning.php</td>
    </tr>

    Do you know how to add a link in HTML?

  5. First of all, do you have code that can read when you click on the markers? Which markers? LongLat coordinates?

    After you get that information, you need to find a service which gives you weather information based on given Longitude and Latitude coordinates. Or whichever data you've received from Google Maps.

    Then you need to learn how to access the service you've found, and process any output accordingly.

  6. Hey there, welcome to the forums!

    Your code looks pretty solid, you just need to add the anchor (<a>) surrounding each database output. Just as you've done with the <td> elements.

     

    Think of it like a normal HTML page, but rather than typing in the numbers, the PHP is doing that for you. Just because you're using PHP, doesn't stop you from needing to still format the HTML properly.

×
×
  • Create New...