Hi, I'm new in php and face some problem in mysql.

I want to check some data if it's remain on database. Example: in my form there are two form field. 1) url 2) name. So i want to check if session user have already this 'url' and 'name' in the database then it's must be show error message.

How do i do this. Anyone can please give me this solution.

Thanks.

You can take count of the desired field from DB.

$result = mysql( "select * from users where url='$url' and name='$name'" );
if (mysql_num_rows($result) > 0)
  echo "Error: User already in database";

Thanks for your reply @smantschef. But I want to check Individual session user has already this url and name. Then it's must be show a error message. How do i do this?

Lets see the code that you are working on and make it work.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.