CabConModding
Facebook
Twitter
youtube
Discord
Contact us
RSS
Menu
CabConModding
Home
New
Top
Premium
Rules
FAQ - Frequently Asked Questions
Games
Fornite
Call of Duty: Black Ops 3
Clash of Clans
Grand Theft Auto 5
Apex Legends
Assassin’s Creed Origins
Forums
Premium
Latest posts
What's new
Latest posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Log in
Register
What's new
Premium
Latest posts
Menu
Log in
Register
Navigation
Install the app
Install
More options
Dark Theme
Contact us
Close Menu
Forums
Tech Boards
Web Development
Web Development Questions & Requests
How can I sort Items in a database created chart in PHP?
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="CabCon" data-source="post: 5510" data-attributes="member: 1"><p>Hello,</p><p>I need agian your help <img src="/styles/default/xenforo/smilies.emoji/people/smile.emoji.svg" class="smilie" loading="lazy" alt=":grinning:" title="Grinning :grinning:" data-shortname=":grinning:" />. I have created a database which contains people from a run with the ammount of rounds which they ran. After that I created this script (with some google work <img src="/styles/default/xenforo/smilies.emoji/people/wink.emoji.svg" class="smilie" loading="lazy" alt=":wink:" title="Wink :wink:" data-shortname=":wink:" />) which create a html chart.</p><p></p><p><strong>The script:</strong></p><p>[PHP]<?php</p><p> $db = new PDO("mysql:host=HIDDEN;dbname=HIDDEN", 'HIDDEN', 'HIDDEN') or die ("Verbindung nicht möglich");</p><p> $query_temp = $db->prepare("SELECT * FROM runners");</p><p> $query_temp->bindParam(':id', $id);</p><p> $id = 1;</p><p> $query_temp->execute();</p><p> echo '<table class="table table-hover">';</p><p> echo '<tr>';</p><p> echo '<th>ID</th>';</p><p> echo '<th>Name</th>';</p><p> echo '<th>Runden</th>';</p><p> echo '</tr>';</p><p> while($id_table = $query_temp->fetch(PDO::FETCH_ASSOC)) {</p><p> echo '<tr>';</p><p> echo '<td>'.$id_table['runner_id'].'</td>';</p><p> echo '<td>'.$id_table['runner_name'].'</td>';</p><p> echo '<td>'.$id_table['runner_rounds'].'</td>';</p><p> echo '</tr>';</p><p> }</p><p> echo '</table>';</p><p> ?>[/PHP]</p><p></p><p><strong>The Database:</strong></p><p><strong><img src="http://img.prntscr.com/img?url=http://i.imgur.com/WklMcTG.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /> </strong></p><p><strong></strong></p><p><strong>Screenshot how it looks:</strong></p><p><strong><img src="http://img.prntscr.com/img?url=http://i.imgur.com/v2zbOSu.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /> </strong></p><p><strong></strong></p><p><strong></strong></p><p>Now I want to give the users the ability to sort the people for their ammoun of rounds which they ran. Like the most person is at the first place. How can I do this?</p><p></p><p></p><p>Regards,</p><p>CabCon.</p></blockquote><p></p>
[QUOTE="CabCon, post: 5510, member: 1"] Hello, I need agian your help :grinning:. I have created a database which contains people from a run with the ammount of rounds which they ran. After that I created this script (with some google work :wink:) which create a html chart. [B]The script:[/B] [PHP]<?php $db = new PDO("mysql:host=HIDDEN;dbname=HIDDEN", 'HIDDEN', 'HIDDEN') or die ("Verbindung nicht möglich"); $query_temp = $db->prepare("SELECT * FROM runners"); $query_temp->bindParam(':id', $id); $id = 1; $query_temp->execute(); echo '<table class="table table-hover">'; echo '<tr>'; echo '<th>ID</th>'; echo '<th>Name</th>'; echo '<th>Runden</th>'; echo '</tr>'; while($id_table = $query_temp->fetch(PDO::FETCH_ASSOC)) { echo '<tr>'; echo '<td>'.$id_table['runner_id'].'</td>'; echo '<td>'.$id_table['runner_name'].'</td>'; echo '<td>'.$id_table['runner_rounds'].'</td>'; echo '</tr>'; } echo '</table>'; ?>[/PHP] [B]The Database: [IMG]http://img.prntscr.com/img?url=http://i.imgur.com/WklMcTG.png[/IMG] Screenshot how it looks: [IMG]http://img.prntscr.com/img?url=http://i.imgur.com/v2zbOSu.png[/IMG] [/B] Now I want to give the users the ability to sort the people for their ammoun of rounds which they ran. Like the most person is at the first place. How can I do this? Regards, CabCon. [/QUOTE]
Verification
Post reply
Forums
Tech Boards
Web Development
Web Development Questions & Requests
How can I sort Items in a database created chart in PHP?
CabConModding is now on facebook! Check the latest Updates, the Site Status and much more now!
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.
Accept
Learn more…
Top