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

Displaying different page content, depending on the logged in user.
Hi all, I am new to ASP.net (and web development in general), and have a question about how I can di

SWF image using php?
Hello once again.

My latest en devour requires me to produce an image of a static .swf that i

get multiple rows
Hi I want to get multiple rows from a db

I am using this for the db query
Code: public

Lining up columns nicely.
Hello everyone, I'm having problems with making columns line up properly. Here is my code:

Java API in PHP?
I have an application that we use internally here at the office.

The software company provide

SAP BCS. BPS
Hi all,

I am seeking reading note on the following in BW

BCS, BPS
ADVANCE

PHP doesn't send my mail
Hi all, I found this and used it to send mail. Simple contact form with some required fields. The va

How can use this array as a key?
Say I have this array for example:


print_r($array);

Prints:
Code: [Select]Array

Working with Global Variables
hi, I'm not really sure why the following code is returning a "Call to a member function getBan

Need help urgant
why down my code ony return one item instead of all the items selected.

$arr = array($date,$

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