Help in focusing on what number that row is

So I have a slightly running login script. I can’t exactly explain my problem, but here is a bit of an example.

I signed up with the username Mini and the password of Coder.

When I want to sign in, I need to find out what number row that Mini is on, and what number row that Coder is on.

I really need help. I’ve been trying this over 3 months. Help!! Thank you very much. Sorry this is very vague

what do you mean what row? from where? a database??

Yeah, a row from a table, the specific columns email and password

Well, when you do your QUERY, you get a result. Then, you FETCH the result as either an array or an associated-array. Which did you do? If array, you have to use $row[0], $row[1], etc… this is based on how you set up the database’s table. row0 is the first col. row1 is the second. If the username is the 4th item, it would be $row[3]… Now, if you use fetch_assoc (associated-array), you use $row[‘userid’] and $row[‘password’] to access them. You use the “associated” name or “key” of the field in the row. The results of that is the value of what is inside that col. $x=$row[‘userid’]; if the userid field had “Ernie” in it, that assigns $x to Ernie…

Hope that helps…

Sponsor our Newsletter | Privacy Policy | Terms of Service