Check before inserting in DB ???


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

This is my code
---------------
if ( $_POST ['Submit'])
{{
$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

Creating Images from images in PHP
Okay well I am trying to make a 'dynamic' calender image with PHP.

I have images like this:

Syntax error
hi im having a little trobble with this script
-------------------------------------------------

Stuck with preg_replace
Hi,

I'm trying to use preg_replace to remove part of the IP address submitted using a form on

Baffled by Undefined Index in Simple Array: Please Help!
Hello. I have a form which posts an array to this script. However, I can't seem to access the values

Bandwidth monitoring?
Hi guys,

I need a little information I have written a php app and I occurred to that I need

Grabbing Values From an Array for Posting
I have a grid array that I am using with a form that when it hits the currently named test.php it lo

Must-Know Topics of PHP
Can you guys list the must-know topics of PHP. I am still a learner and I am trying to cover most of

Help a newbee save my job !
Hey guys i am dying here i am new to php and would like for someone to help me with this problem

How could I do this?
Ive got a simple lottery game, and am using an sql database to keep track of the numbers bought. But

How to Detect it is public_html or httpdocs?
How to check whether it is cPanel or Plesk?

If it found public_html perform <?php incl

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