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

PHP XML extraction text
I would like to extract an xml text and have that text directly echo(print) out on my web page. Her

Sharing PHP Sessions Across Domains
I am in the process of writing a script to share a php session across various domains I have.
The

Searching keywords from array
Hello everyone, Im just wondering if someone could help me with another issue im having. Im still le

News script
Hi ...

I am not sure if this is the rite place to post this but if its not sorry

i am

need help modifying script
Hi guys,

I'm fairly new to php and am having a bit of trouble modifying a script.

This

asp authentication problem
Hello all, I want to use the asp authentication (from asp.net configuration) in my web site. there

Problem executing bash script using shell_exec
Hi there,
I created a bash script file using following code to convert doc documents to pdf using

check if string contain only a-z/A-Z
Is where any way to check if string contains only a-z/A-Z, without writing an array with all possibl

Kill a process
I have a question - how can I kill a process from a command line or by using Oracle SQL Developer? I

Get keys and values from an array
Hellow,

I have an array $Data with keys and values. With a foreach I can display all the valu

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