I'm only a week old in php so i want to know
if this next test for a login script is a good or a badd aproach:
<?php
if ($submit)
{
//conection stuff goes here
$result = mysql_query(" select * from people where user like '$user' and password like '$passwds' ");
$numer = mysql_num_rows($result);
if ( $numer == 1 ){
// i take some action if user/password //are ok
}
else {
// i take other some action if //user/password ar grong
}
}
else
{
//show the form.....
?>
<?php
}
?>
cos there will be only one user/password pair match in the database i think it was a good idea to do:
$numer = mysql_num_rows($result);
if ( $numer == 1 )
would it be better to use an primary key for the test?