-2

this is my code .! i dont know why is it occuring ! I have seen the previous Answers but i am unable to get a solution for this! and when i insert data to tables mannually it is duplicating itself.

so any help would be apprecieted !

<html>

<head>
    <title>
    LOGIN
    </title>
</head>
<body>
    <form action=''  method='post'>

        <table>
            <tr>

                <td>
            <p>USWERNAME </br><input type="text" name="username"/></p>
                </td>
            </tr>

            <tr>
            <td><p>PASSWORD </br> <input type="password" name="password"/></p></td>
            </tr>

            <tr>
            <td><p>LOGIN</br> <input type="submit" name="submit"/></p></td>
            </tr>
        </table>


    </form>
<?php
include ('include/db.php');

if(isset($_POST['submit']))
{

   $usera=$_POST['username'];
 $passa=$_POST['password'];



  if(!$query=mysql_query("select from admin_login where u_user='$usera' AND u_pass='$passa'"))
  {
      echo mysql_error();
  }

}



?>
</body>
</html>

1 Answers1

1

You have an syntax error here

select from admin_login where u_user='$usera' AND u_pass='$passa'

Your syntax like

select fieldsname from table_namewhere u_user='$usera' AND u_pass='$passa'
Devsi Odedra
  • 5,244
  • 1
  • 23
  • 37