Newbie Spellweaver
- Joined
- Aug 28, 2013
- Messages
- 18
- Reaction score
- 1
Hello,
so... i was hardly doing some few things about tr and i did suceed,
in this tutorial
i will explain everyone how to make the top ten ranking using TR Database
and it's not manually... it's by database..
Let's Start!
First download ntwdlib.dll (Search on google)
then after that copy the ntwdlib.dll to
Apache bin folder
Apache Folder
PHP Folder (Overwrite)
Then enable these things in the php.ini
;extension=php_ming.dll => extension=php_ming.dll
;extension=php_mssql.dll => extension=php_mssql.dll
Restart Apache
after that you're ready to build the website!
so first here's the connecting codes you need :
After that you're connected to the database (only when you go to the webpage and you see no errors)
if you got an error contact me on skype (nathanadhitya)
after the connection etablished , let's open the rank table by executing an SQL Query
Then close the MSSQL Connection and the php
then look back the webpage... it will return 10 rows from 1-10 so it would be the top ten rank
i was seperating it with a space... to seperate it with a table look the html tutorials at w3schools
Have Fun!
And here's my full code
so... i was hardly doing some few things about tr and i did suceed,
in this tutorial
i will explain everyone how to make the top ten ranking using TR Database
and it's not manually... it's by database..
Let's Start!
First download ntwdlib.dll (Search on google)
then after that copy the ntwdlib.dll to
Apache bin folder
Apache Folder
PHP Folder (Overwrite)
Then enable these things in the php.ini
;extension=php_ming.dll => extension=php_ming.dll
;extension=php_mssql.dll => extension=php_mssql.dll
Restart Apache
after that you're ready to build the website!
so first here's the connecting codes you need :
PHP:
<?php
// Server in the this format: <computer>\<instance name> or
// <server>,<port> when using a non default port number
$server = 'NATHAN-PC\SQLEXPRESS';
// Connect to MSSQL
$link = mssql_connect($server, 'sa', 'talesrunner') // mssql_connect($server, 'username', 'password')
or die('Could not connect to MSSQL Server!');
// Database Name
mssql_select_db('TR_GAMESVR_DB')
or die('Could not select a database.');
if you got an error contact me on skype (nathanadhitya)
after the connection etablished , let's open the rank table by executing an SQL Query
PHP:
$SQL = "
SELECT TOP 10 *
FROM [dbo].[tblRank]";
$result = mssql_query($SQL)
or die('An MSSQL error occured');
// Fetch rows:
while ($Row = mssql_fetch_assoc($result)) {
echo $Row['fdRank'] . " " . $Row['fdNickname'] . " " . $Row['fdExp'];
echo '<br>';
}
PHP:
mssql_close($link);
?>
i was seperating it with a space... to seperate it with a table look the html tutorials at w3schools
Have Fun!
And here's my full code
PHP:
<?php
// Server in the this format: <computer>\<instance name> or
// <server>,<port> when using a non default port number
$server = 'NATHAN-PC\SQLEXPRESS';
// Connect to MSSQL
$link = mssql_connect($server, 'sa', 'talesrunner') // mssql_connect($server, 'username', 'password')
or die('Could not connect to MSSQL Server!');
// Database Name
mssql_select_db('TR_GAMESVR_DB')
or die('Could not select a database.');
$SQL = "
SELECT TOP 10 *
FROM [dbo].[tblRank]";
$result = mssql_query($SQL)
or die('An MSSQL error occured');
// Fetch rows:
while ($Row = mssql_fetch_assoc($result)) {
echo $Row['fdRank'] . " " . $Row['fdNickname'] . " " . $Row['fdExp'];
echo '<br>';
}
mssql_close($link);
?>