PHP MYSQL order lists by popularity
Get the solution ↓↓↓Solution:
<div id="right-column-sidebar">
<ol>
<?php
$link = mysql_connect("localhost", "root", "password");
mysql_select_db("db", $link);
$query = "SELECT * FROM table";
$result = mysql_query($query);
while ($row = mysql_fetch_array($results)) :
?>
<li> <a href="#"> <?php echo $row['title']; ?> </a></li>
<?php endwhile;
?>
</ol>
</div>
This all assumes you have some data inside the databasedb
and inside the tabletable
you have a column calledtitle
which contains a bunch of entries with titles. This will loop through the results and display them.
Of course sorting the information just requires some extra info in your query.
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: you must enable the openssl extension in your php.ini to load information from https://repo.packagist.org
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.