Sublime directory Surf the web anonymous Pagerank Monitor


Online game

xefus
Mon 26 December 2005, 07:48 am GMT +0100
HI.

I am just practecing to create online game. :-[

And i have i problem : Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/r/rpg.h16.ru/WWW/bk/reg.php on line 31
Table 'rpg6.users' doesn't exist

As i know i have to have admin for database, i have it. And i have to create table  'rpg6.users'  and i dont know number of fields! I also dont know another things, such as Field, Type, Attributes, Null, Default, Extra.

THANKS 8)

meth0d420
Mon 26 December 2005, 07:53 am GMT +0100
show us the code that u are using for the file that is displaying the errors..

xefus
Mon 26 December 2005, 08:19 am GMT +0100
<?
/*Middleages Enlightment         */
/*September 2004                 */
/*programming by chisto_tolyan   */
/*                               */
/*регистрация                    */

include "conf.cfg";

$chas = date("H");
$server_date=date("d.m.Y", mktime($chas-$GSM));
$server_time=date("H:i:s", mktime($chas-$GSM));

$data = mysql_connect($rpg6, $rpg6, $624153);
    if(!mysql_select_db($rpg6,$data)){
     print "Ошибка при подключении к БД<BR>";
     echo mysql_error();
     die();
    }

?>
<HTML>
<HEAD>
<TITLE>Средневековье - регистрация</TITLE>
<LINK REL=StyleSheet HREF="style.css" TYPE="text/css">
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<?
   if(!empty($login)){
    $QUERY = mysql_query("SELECT id FROM users WHERE login='$login'");
    $CHECK = mysql_fetch_array($QUERY);
       if($CHECK){
        print "<SPAN CLASS='err'>Ошибка!Логин \"$login\" уже занят! Выберите другой логин.<BR>";
        print "<A HREF=\"javascript:history.back()\" CLASS='link'>назад</A>";
        die();
       }

    if(empty($ip))
    {
               if (getenv('HTTP_X_FORWARDED_FOR'))
                {
                        $ip=getenv('HTTP_X_FORWARDED_FOR');
                }
                       else
                {
                        $ip=getenv('REMOTE_ADDR');
                }
    }

    $login=htmlspecialchars($login);
    $login=trim($login);
    $password=htmlspecialchars($password);
    $level = "0";
    $email=htmlspecialchars($email);
    $icq=htmlspecialchars($icq);
    $homepage=htmlspecialchars($homepage);
    $name=htmlspecialchars($name);
    $city=htmlspecialchars($city);
    $birthday=htmlspecialchars($birthday);
    $about=htmlspecialchars($about);
    $about=str_replace("\n","<BR>",$about);
    $password = base64_encode($password);
    $def_city = "Моунтаун";
    $def_city_game = "mountown";
    $def_room = "пл.Базарная";
      if($sex == "male"){
       $def_obraz = "m/1.gif";
      }
      else{
       $def_obraz = "f/1.gif";
      }
    $def_status = "рекрут";

    $INSERT = "INSERT INTO `users`(login,login_display,password,mail,sex,icq,homepage,name,hobie,town,birthday,date,reg_ip,city,city_game,obraz,status,room) VALUES('$login','$login','$password','$email','$sex','$icq','$homepage','$name','$about','$city','$birthday','$server_date-$server_time','$ip','$def_city','$def_city_game','$def_obraz','$def_status','$def_room')";
    $SQL = mysql_query($INSERT);

       if($SQL){
        print "<SPAN CLASS='norm'>Регистрация прошла успешно!<BR>Авторизируйтесь с <a href='index.php' class='link'>главной страницы</a>.</SPAN>";
        $INSERT_REPORT = mysql_query("INSERT INTO `report`(date,time_stamp,login,action,type,ip) VALUES('$server_date-$server_time','".time()."','$login','Персонаж зарегистрировался','0','$ip')");
       }
       else{
        echo mysql_error();
       }
   }
   else{
?>
<script>
function sub(){
n=document.registration;
if(n.login.value==""){alert('Вы не ввели Ваш логин!!!');}
else if(n.password.value==""){alert('Вы не ввели Ваш пароль');}
else if(n.password_confirm.value==""){alert('Вы не подтвердили пароль!!!');}
else if(n.password.value!=n.password_confirm.value){alert('Пароли в полях не совпадают!!!');}
else if(n.email.value==""){alert('Вы не ввели Ваш e-mail!!!');}
else if(n.birthday.value==""){alert('Вы не ввели Вашу дату рождения!!!');}
else if(n.rules.checked!=true){alert('Вы должны принять правила The Middleages: Enlightment');}
else{
n.submit();
}
}
</script>
<CENTER>
<FORM NAME="registration" ACTION="reg.php" CLASS="norm" METHOD="POST">
<TABLE BORDER="0" CELLPADDING="7" CELLSPACING="7" WIDTH="400" BGCOLOR="rgb(248,248,248)" CLASS="tab">
<TR><TD>
<CENTER>
<SPAN CLASS="header">
The Middleages
</SPAN>
</CENTER><BR>
Регистрация. Заполните все поля.
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0">
<TR>
<TD WIDTH="200">
Логин <SMALL>(макс. 30 симв.)</SMALL>:
</TD>
<TD>
<INPUT TYPE="text" NAME="login" CLASS="field" SIZE="30" MAXLENGTH="30">
</TD>
</TR>
<TR>
<TD>
Пароль <SMALL>(макс. 30 симв.)</SMALL>:
</TD>
<TD>
<INPUT TYPE="password" NAME="password" CLASS="field" SIZE="30" MAXLENGTH="30">
</TD>
</TR>
<TR>
<TD>
Подтвердите пароль:
</TD>
<TD>
<INPUT TYPE="password" NAME="password_confirm" CLASS="field" SIZE="30" MAXLENGTH="30">
</TD>
</TR>
<TR>
<TD>
E-mail <SMALL>(макс. 50 симв.)</SMALL>:
</TD>
<TD>
<INPUT TYPE="text" NAME="email" CLASS="field" SIZE="30" MAXLENGTH="50">
</TD>
</TR>
<TR>
<TD>
Ваш пол:
</TD>
<TD>
<SELECT NAME="sex" CLASS="field" STYLE="width=203;">
<OPTION VALUE="male">Мужской</OPTION>
<OPTION VALUE="female">Женский</OPTION>
</SELECT>
</TD>
</TR>
<TR>
<TD>
ICQ UIN <SMALL>(макс. 15 симв.)</SMALL>:
</TD>
<TD>
<INPUT TYPE="text" NAME="icq" CLASS="field" SIZE="30" MAXLENGTH="15">
</TD>
</TR>
<TR>
<TD>
Имя <SMALL>(макс. 50 симв.)</SMALL>:
</TD>
<TD>
<INPUT TYPE="text" NAME="name" CLASS="field" SIZE="30" MAXLENGTH="50">
</TD>
</TR>
<TR>
<TD>
Сайт <SMALL>(макс. 30 симв.)</SMALL>:
</TD>
<TD>
<INPUT TYPE="text" NAME="homepage" CLASS="field" SIZE="30" VALUE="http://" MAXLENGTH="30">
</TD>
</TR>
<TR>
<TD>
Город <SMALL>(макс. 50 симв.)</SMALL>:
</TD>
<TD>
<INPUT TYPE="text" NAME="city" CLASS="field" SIZE="30" MAXLENGTH="50">
</TD>
</TR>
<TR>
<TD>
День рожденья <SMALL>(макс. 10 симв.)</SMALL>:
</TD>
<TD>
<INPUT TYPE="text" NAME="birthday" CLASS="field" SIZE="30" MAXLENGTH="10">
</TD>
</TR>
</TABLE>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0">
<TR><TD>
Немного о себе <SMALL>(макс. 1024 симв.)</SMALL>:<BR>
<TEXTAREA NAME="about" CLASS="field" ROWS="6" COLS="60" MAXLENGTH="1024"></TEXTAREA><BR>
<INPUT TYPE="checkbox" NAME="rules">Я принимаю <A HREF="rules.php" CLASS="link" TARGET="blank">правила The Middleages</A><BR>
<INPUT TYPE="checkbox" NAME="subscribe">Я хочу подписаться на "The Middleages News"<BR><BR>
<INPUT TYPE="button" OnClick="sub()" CLASS="but" VALUE="Зарегистрировать" STYLE="width=382">
</TD></TR>
</TABLE>
<br>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="100%">
<TR>
<TD ALIGN="left">
<!--Rating@Mail.ru COUNTER--><script language="JavaScript" type="text/javascript"><!--
d=document;var a='';a+=';r='+escape(top.document.referrer)
js=10//--></script><script language="JavaScript1.1" type="text/javascript"><!--
a+=';j='+navigator.javaEnabled()
js=11//--></script><script language="JavaScript1.2" type="text/javascript"><!--
s=screen;a+=';s='+s.width+'*'+s.height
a+=';d='+(s.colorDepth?s.colorDepth:s.pixelDepth)
js=12//--></script><script language="JavaScript1.3" type="text/javascript"><!--
js=13//--></script><script language="JavaScript" type="text/javascript"><!--
d.write('<a href="http://top.mail.ru/jump?from=654449"'+
' target=_top><img src="http://top.list.ru/counter'+
'?id=654449;t=134;js='+js+a+';rand='+Math.random()+
'" alt="Рейтинг@Mail.ru"'+' border=0 height=40 width=88><\/a>')
if(11<js)d.write('<'+'!-- ')//--></script><noscript><a
target=_top href="http://top.mail.ru/jump?from=654449"><img
src="http://top.list.ru/counter?js=na;id=654449;t=134"
border=0 height=40 width=88
alt="Рейтинг@Mail.ru"></a></noscript><script language="JavaScript" type="text/javascript"><!--
if(11<js)d.write('--'+'>')//--></script><!--/COUNTER-->

</TD>
<TD ALIGN="right" VALIGN="TOP">
<SPAN CLASS="small">
The Middleages: &copy2004.<BR>
By chisto_tolyan
</SPAN>
</TD>
</TR>
</TABLE>
</TD></TR>
</TABLE>
</FORM>
</CENTER>
</HTML>

<?
   }
?>

meth0d420
Mon 26 December 2005, 08:34 am GMT +0100
are u sure that the username you are using to connect to ur mysql db has DBA rights?

Nikolas
Mon 26 December 2005, 11:57 am GMT +0100
You need the tables that are described in the INSERT statements :

users :

login,login_display,password,mail,sex,icq,homepage,name,hobie,town,birthday,date,reg_ip,city,city_game,obraz,status,room

report :

date,time_stamp,login,action,type,ip

To see what type each field is, just check the variables in the insert statements

meth0d420
Mon 26 December 2005, 01:21 pm GMT +0100
xefus, what is the code for ur conf.cfg file?

xefus
Wed 4 January 2006, 05:37 am GMT +0100
i got that i have to do another one :(

meth0d420
Wed 4 January 2006, 06:30 am GMT +0100
is this a 3rd party script or is this something you wrote yourself?

xefus
Wed 4 January 2006, 06:31 am GMT +0100
NO

xefus
Wed 4 January 2006, 06:32 am GMT +0100
Does any one know where any online games? (RPG)

meth0d420
Wed 4 January 2006, 06:43 am GMT +0100
so its a 3rd party script then?

Nikolas
Wed 4 January 2006, 07:36 pm GMT +0100
Does any one know where any online games? (RPG)

http://php.resourceindex.com/Complete_Scripts/Games/

Enjoy my friend :)

xefus
Mon 9 January 2006, 09:17 am GMT +0100

Thanks, for sharing :)

Archive for SMF v1.00 by N.P. Valid XHTML 1.0 Transitional