How to get the result of a select count(*) query in PHP?

前端 未结 10 1215
离开以前
离开以前 2021-02-03 10:49

I have this query to use in PHP:

mysql_query(\"select count(*) from registeredUsers where email=\".$_SESSION[\"username\"]);

When I use e

10条回答
  •  梦毁少年i
    2021-02-03 11:11

    It should give you the amount of registere users who have the email address that you provide as the parameter to this query. (Might be a check if the given email address is already registered for another user.) If the email address is not yet registered, an empty field will be returned. (That might be the reason why nothing gets printed out in your case. Try it with an email address that you are certain of to be in the database.)

提交回复
热议问题