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

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

Oracle Connectivity
Hi Every One,

Can we access SAP from oracle database.If it possible then please spec

need help about
i store the value of my select statement result to an array and stored it to a variable named $fname

Multi Level Array Problem
hi all,

For example I have array like below:

$temp = array(array('north america', 'us'

Using insert variable
need a way to inert variable data to mysql database

$acc = "212121212";
$nok =

problem in pagination when processing with selectbox form
Hi,

I have a search form, with select boxes, if am selecting the value from the form, it work

strtotime issue
Hey all,

I'm playing around with some code, and basically the idea is:

Person changes

Email with Attachments in PHP
Hi Friends

How to send email in PHP with attachment.
I know simple mail can be sent with

str_replace help
I am thinking str_replace is my only option to filter outputs from my database to convert them to sa

Run function every 5 mins ??
I have a function PostMessage()

How can I run it every 5 mins ??

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