Jump to content

sql select query error


satbir

Recommended Posts

coding below is not working for selecting data from mysql

 

______________________________________________

 

<?php
    $name=$_REQUEST['name'];
    $password=$_REQUEST['password'];

    $connect=mysql_connect('localhost','root','') or die("Error to Connect Database");    

    if ($connect)
    {
        mysql_select_db('dental',$connect) or die("Error in DB Select");
    
        $qury="select * from admin where name=$name";        
        
        $run=mysql_query($qury, $connect) or die("error in sql query");
        
        $count=mysql_num_rows($run) or die ("error in rows");
        
        if ($count == 1)
            {
                $rows=mysql_fetch_assoc($runQury);
                
                if ($rows['password'] == $password)
                    {
                        header("location:adminarea.php");
                    }
                else
                    {
                        header("location:welcome.php");
                    }
            }
        else
            {
            }
    }
?>

Link to comment
https://forums.phpfreaks.com/topic/278902-sql-select-query-error/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

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.