Jump to content

Php And Mysql

Recommended Posts

Hi...below the php code for user login details<?phpinclude "pass.php";session_start();$user = isset($_POST['user']) ? $_POST['user'] : $_SESSION['user'];$pass = isset($_POST['pass']) ? $_POST['pass'] : $_SESSION['pass'];mysql_query("insert into login('', '$user', '$pass')");$a = mysql_connect("localhost", "time", "");if($a){ $db = mysql_select_db("time", $a);}if(!isset($pass)){?> <form method=POST action=""> <div align=center >Enter login details</div><br> <table align = center> <tr><td>Username</td><td><input type=text name=user value=""> <tr><td>Password</td><td><input type=password name=pass value=""> <tr><td><input type=submit value="Submit"></td></tr> </table> </form><?php}$user = $_SESSION['user'];$pass = $_SESSION['pass'];$sql = "select * from login where username = '$user' and password = password('$pass')";$result2 = mysql_query($sql);if(mysql_num_rows($result2)){ echo "Authentication Failed";}?>Error will be occuredWarning: mysql_connect(): Can't connect to MySQL server on 'localhost' (10061) in d:\time schedule\admin\myauth.php on line 8Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in d:\time schedule\admin\myauth.php on line 33what is the issue for that?Pls give a correct php code......Regardssubha

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...