Check before inserting in DB ???


Posted on 16th Feb 2014 07:03 pm by admin

This is my code
---------------
if ( $_POST ['Submit'])
{{
Did you know?Explore Trending and Topic pages for more stories like this.
$username = $_POST ['usernm'];
$userpassword = $_POST ['userpw'];
}
/*insert data from the form into the db table*/

$querypost = mysql_query ("INSERT INTO users (usernm, userpw) VALUES ('$username','$userpassword')");
}
?>

How do I check before inserting whether that username and password is already inserted. I have an id assigned to every entry.
No comments posted yet

Your Answer:

Login to answer
158 Like 46 Dislike
Previous forums Next forums
Other forums

Echo-ing MySQL content and Keep Formatting?
I have data in my MySQL such as:

QuoteBlah blah

Blah blah

etc
but when i ech

header redirect problems? please help
Ok i am making a site that generates youtube thumbnails and i am generating an image that displays 1

limit string by words??
hello all,

I was wonder if there is a function to limit a string by the number of words inste

first few characters only
hi, does anyone know how to use PHP to take the first few words of a text and limit them? i have see

Upload simple problem
Really confused!! I run once and it worked, but when i tried today...it didn't work

Which par

Coding Critique
I was hoping someone could take a second and look down my code and see if they see any problems with

Php If in MySql query (hiding labels if a field is empty)
Okay, I've been trying to do this for a while, and I'm finally going to ask for help so I can get th

How to restrict the display of report variants
Hello All,

I want t know how to restrict the display of report variants.
I mean, whe

Need help with basic sql
Hi,

I am using oracle 10g, and having some small doubts related to sql , here goes the si

wav to mp3 + goDaddy
I need to convert wav files to mp3s. From what I have found so far one way to do it is to have my PH

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash