Forum Moderators: coopster
and wanna when user 1 time login Cant Connect to site again (only 1 time) may i must add a new fild in Users Tabele with value of 0 and 1 . when user login value change from 0 to 1 and again users with value 1 cant login.. any one can change this script for me?(i'm not a coder)
$check = mysql_query ("SELECT $userlevel_value FROM $table_value WHERE username='$user_value' AND password='$pass_value'"); // Query to see if user exists
#
$verify = mysql_num_rows ($check);
[edited by: eelixduppy at 2:26 pm (utc) on Sep. 18, 2007]
[edit reason] removed excess code dump [/edit]
I'm sorry but we cannot do people's "homework" here otherwise nobody would ever learn. We can, however, help you along the way with any problems you encounter. If you want to check the value of a column in a table to see whether or not they logged in or not, you could do something like the following in the login query:
$query = "SELECT $userlevel_value FROM $table_value WHERE `username`='$user_value' AND `password`='$pass_value' AND `logged_in`=0";
This will not return any results if they have logged in before. Then later on in the code, once they have been verified and have truly logged in for the first time, you are going to have to update their row in the table and replace the '0' with a '1' signifying that they have logged in before. The query for that would look something like this:
$query = "UPDATE $table_value SET `logged_in`=1 WHERE `username`='$user_value'";
If you need help with any of this there are a few places to look. One would be mysql.com, as they have excellent documentation for the syntax of queries, etc.. The other would be php's mysql functions [php.net] as they directly apply here. We also have a few threads in our library that you may want to take a look at:
Commonly used mysql commands [webmasterworld.com]
basics of extracting data from mysql [webmasterworld.com]
good luck