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

The type or namespace name 'ServiceModel' does not exist in the namespace 'System'
When I locally run the website, it works just fine, but when I uploaded it to the hosting environmen

duplicate record notification
In my database, after insertion of records, I want to know if the record inserted is duplicate or no

why is it over writing
Code: $filepaths[] = $_FILES['new_image'];
foreach ($filepaths as $filepath)
{
$imagename =

media recovery
Hi,
i startup the database i got the error

SQL> startup
ORACLE instance started.

calculator
I can't figure out why this code doesn't work. No error messages. Page loads.

Code: <

Exporting new records
Trying to figure out the best way to set this up.

People register my site.

Their prof

DBCA Templates
Hi all,

I'm working on creating a template for DBCA, but can't find any documentation on the

Problem in String replace program's output
Hi all,
I was trying to make a program which accepts a string and replaces it with another stri

PHP5 - Verifying a secure mail is secure
I need to send an e-mail from a form to a external department and because it contains personal custo

db entry based on primary key
My "topics" table contains 10 entires
*--------------*
topicid topic
------

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