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

an interesting question
Greetings folks, got to ask an interesting question...

let say
i have created a function s

IF Statement & Two Tables With Different Echoes
I'm retrieving two tables in a single query using UNION ALL, like so:

Code: $query = "SE

SAP Logon Failed
I tried to login to SAP through MMC.

When i click start and give password.

it

mails going in spam??
The mails I sent to folks in my database using mail(function) are going in spam??

Any idea ho

Warning: mysql_num_rows() supplied argument is not a valid MySQL result resource
This may be simple I just may need another pair of eyes..

When i get records back the below c

Delete records not in top 15
Hi,

I'm creating a hall of fame page in my game and the page will only display the top 15 sco

php code generators
All

Whilst enjoying learning a new language i have come accross a number of free code generat

Async WSAConnect failed on XP with error code = 2 ("File not found")
Hi all,

I have very strange bug, please help me if you can.

It is reproduced o

Count on multidimensional array
Hi, i got an array as below:

Array
(
=> Array
(

Quick variable question
hey guys/gals,
im trying to write a php script and it works fine as i have it, but i need to set

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