Jump to content

Recommended Posts

<?php
$host = 'localhost';
$user = 'root';
$pass = '';
$db = 'game';
 
$connect = @mysql_connect($host, $user, $pass) or die('socket error');
@mysql_select_db($db, $connect) or die('socket error - no db');
@mysql_query("SET NAMES 'utf8-polish-ci'");
 
session_start();
 
$user = @mysql_fetch_array(@mysql_query("select * from user where id = '".$_SESSION['user']."' limit 1")) or die('socket error - no table');
 
?>
 
i got errors socket error - no table
i have this table what is wrong?
Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Replace or die('socket error - no table'); with

or die(mysql_error());

 

and paste the error here

i have problem here i want create login and haslo this ius code

<?php require_once('game/config/config.php'); ?>
<?php

$db_user = @mysql_num_rows(@mysql_query("select * from user"));
$code = @mysql_query("select * from user order by id asc");
if(!empty($_POST['login'])){
if(!empty($_POST['haslo'])){
if(!empty($_POST['user'])){
$db_user_dane = @mysql_fetch_array(@mysql_query("select * from user where id = '".$_POST['user']."','".$_POST['login']."' and haslo = '".$_POST['haslo']."' limit 1"));
if(!empty($db_user_dane)){
$_SESSION['user'] = $_POST['user'];
header('Location: game.php');
} else {
echo "<span style='color: red; font-weight: bold;'>Bledny Login</span><hr>";
}
} else {
echo "<span style='color: red; font-weight: bold;'>Bledne Haslo</span><hr>";

}
}
}
?>






<center>
<form action='logowanie.php' method='post'>
<select name="user">
<?php
while($wczytuje = @mysql_fetch_array($code)){
echo "<option value='".$wczytuje['id']."'>".$wczytuje['nazwa']."(".$wczytuje['poziom'].")</option>";
}
?>
</select><br>
<input type='text' name='login' style='width: 100px;'><br>
<input type='password' name='haslo' style='width: 100px;'><br>
<input type='submit' value='Zaloguj'><br>
</form>
<hr>

when i paste wrong password message is wrong login when i paste wrong login i have wrong login and when i paste 123 password this is password and login and not work i see message wrong login

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.