• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

web, connecting to SQL - need help!

Faraonekkk

New Member
Joined
Feb 15, 2010
Messages
686
Reaction score
4
Please help, how i can make a web script that search. I mean i already have script but how to make it search this:

If vocation = 1
than on site is icon with gold coin
when vocation 2
icon with crystal coin ;P

Please help
 
PHP:
$l = mysql_connect("localhost", "root", "toor");
mysql_select_db($l, "db");
$x = mysql_query("SELECT * FROM players");
$y = mysql_fetch_array($x);
$voc = $y["vocation"];

if($voc == 1){
$main_content .= '<img src="images/gold_coin.gif"/>';
}

change root / toor to your username / password for the database :)
 
i just added it and its still write 0 and 1 ;/

its to search

$l = mysql_connect("localhost", "root", "pass");
mysql_select_db('db');
$x = mysql_query("SELECT * FROM players");
$y = mysql_fetch_array($x);
$redskull = $y["redskull"];

if($redskull == 0){
$main_content .= '<img src="http://otland.net/images/rotworm.gif"/>';


and


echo '<tr><td></td><td><font color="white">'.htmlspecialchars($a['redskull']).'</font></a></td></tr>'."\n";

not works ;/ help
 
Last edited:
$serwer = "localhost"; // nazwa serwera mysql
$login = "root"; // login do bazy
$haslo = "xxxx"; // haslo do bazy
$baza = "xxxx"; // nazwa bazy
$tabela = "players"; // nazwa tabeli
$dzial = $y["redskull"]; // red skull test
if (mysql_connect($serwer, $login, $haslo) and mysql_select_db($baza)) {
if ($dzial == 0) {
echo '<span style="color:white"><img src="http://otland.net/images/rat.gif" ></span>'."<br/>\n";

dude, when its 0 its showing image BUT, one player have redskull 1 and its showing for him too :/

Really please help guys, or just small idea for me how to make?
 
Back
Top