Results 1 to 2 of 2

Thread: Which Better, Login via mysql_connect or database ??

  1. #1

    Thread Starter
    Member
    Join Date
    Mar 2006
    Posts
    47

    Question Which Better, Login via mysql_connect or database ??

    I 'm confused to make Login System (Authentication)..
    Which one is better :
    1. Login via mysql_connect :
    - like :
    $user=$_POST["TxtUser"];
    $pass=$_POST["TxtPass"];
    mysql_connect("localhost",$user,$pass);

    2. or via database / table :
    - like :
    mysql_connect("localhost","root","123");
    mysql_select_db("Login");
    $result=mysql_query("Select * from MsLogin where Username='".$user."' and Password='".$pass."'");

    Total User : more than 1400.., and every user have specific limitation on database and table..

    Thank you...

  2. #2
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Which Better, Login via mysql_connect or database ??

    You should only need at most one MySQL user per application. So, always the second option

    Not to mention the first option is wrought with hosting permissions issues with adding the users and granting permissions, etc. And you don't want to give full MySQL access to every user, far from it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width