Just recently...

 
Post new topic   Reply to topic    Aprelium Forum Index -> PHP
View previous topic :: View next topic  
Author Message
greensmurf
-


Joined: 02 Jun 2004
Posts: 1

PostPosted: Thu Jun 10, 2004 8:31 pm    Post subject: Just recently... Reply with quote

I have just recently begun teaching myself php and mssql. i have been trying to execute a sql code and output the table info but only specific parts. for example,

SELECT * FROM tblGameID1 ORDER BY Lvl+STotalBonus DESC

that's the code i have. it organizes everyone by their "rank" from highest value to lowest.

the database is redmoon and i have a script that logs me in called config.php, i know it works.
here's the code for that

<?php

//MSSQL Host IP
$db_host = 'localhost';

//MSSQL Username
$db_user = 'RMGS';

//MSSQL Password
$db_pass = 'S#d885fk';

//MSSQL Database
$db_name = 'redmoon';

$conn = mssql_connect($db_host,$db_user,$db_pass);
mssql_select_db($db_name,$conn);
?>

here are my problems. i don't understand how to include the config.php in the rank.php and make the php execute this command into mssql and output colunms GameID, Lvl, Strength, Spirit, Dexterity, and Power.

also, i've noticed that this doesn't make the change to the table permanent, is there anyway to do that?

here is what i've got.

<?

include (config.php);

$query="SELECT * FROM tblGameID1 ORDER BY Lvl+STotalBonus DESC";
$result = mssql_query($query,$conn);

if (mssql_num_rows($result) > 0) {

echo "<b>Error 1.</b>";

}

else {

echo "<b>Player Ranks</b><br><br>";
while ($f = mssql_fetch_array($result)) {

echo "<b>Error 2.</b>";
echo "<b>".$f['GameID']." -- ".$f['Lvl']." -- ".$f['Strength']." -- ".$f['Spirit']." -- ".$f['Dexerity']." -- ".$f['Power']."</b><br>";

}

}

?>
Back to top View user's profile Send private message
masa
-


Joined: 05 Apr 2004
Posts: 182
Location: Hong Kong

PostPosted: Fri Jun 18, 2004 1:02 pm    Post subject: Reply with quote

try to delete the 2 root users in phpmyadmin but im not too sure if it works or not
_________________
Visit http://web26.hopto.org:443/ please help me make my site better http://web26.hopto.org:443/
Back to top View user's profile Send private message Send e-mail Visit poster's website
Anonymoose
-


Joined: 09 Sep 2003
Posts: 2192

PostPosted: Fri Jun 18, 2004 1:22 pm    Post subject: Reply with quote

Masa, they are using MSSQL not MYSQL. There is no reason for them to have PHPMyAdmin installed. Learn to read before you post. *sigh*
Back to top View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> PHP All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group