I'm really rusty in PHP , I was wondering if some one could whip up a simple PHP script that grabs the user's from a MSQL table and order's them by Level :) Thanks in advance.
Printable View
I'm really rusty in PHP , I was wondering if some one could whip up a simple PHP script that grabs the user's from a MSQL table and order's them by Level :) Thanks in advance.
I assume u know how to setup php to connect ur db.
Remember change Users to whatever you want load,PHP Code:'SELECT Users FROM Table order by Level desc'
Table to table where you want load,
and Level to match ur table level (like if collum says wLevel change it to wLevel)
I was wondering How can I display that with HTML? I've tried it and didn't succeed
Example script from ww.php.net/mysql
PHP Code:<?php
// Connecting, selecting database
$link = mysql_connect('mysql_host', 'mysql_user', 'mysql_password')
or die('Could not connect: ' . mysql_error());
echo 'Connected successfully';
mysql_select_db('my_database') or die('Could not select database');
// Performing SQL query
$query = 'SELECT * FROM my_table';
$result = mysql_query($query) or die('Query failed: ' . mysql_error());
// Printing results in HTML
echo "<table>\n";
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
echo "\t<tr>\n";
foreach ($line as $col_value) {
echo "\t\t<td>$col_value</td>\n";
}
echo "\t</tr>\n";
}
echo "</table>\n";
// Free resultset
mysql_free_result($result);
// Closing connection
mysql_close($link);
?>
Thanks for your help , I just want to display the Character's name after I get the , necessary information displayed. All I've added in the script was this
Here's the website http://pbgunz.sytes.net/test.phpCode:$query = 'SELECT * FROM cq_user order by Level DESC';
PHP Tutorial - Introduction easy tutorials ;o