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

Need help: how to catch acess of undefined class properties
Hello. I am learning OO with PHP and have hit a problem.
Some code runs as perfectly valid code,

PHP error. Need help urgently
Hi,

I am programming a php site and have a problem that i just cant find out how to fix. When

want a code for uploading and downloading
i m trying to upload and download to my site..i need upload and download code ...i use a code for up

Is there a function ... auto send IP
Is there some function that can be sent to a ddns service that returns the ip address of a ddns forw

How to search for several parameters from objects in a database?
I have a database with lots of information about objects.
Now I would like to search for 4 or 5 p

Renaming array keys
The issue: renaming array keys inside a foreach loop.

I'm trying to build a pie chart image w

How to copy a part of a vector in a raw memory
Hi,

How can I copy a part of a vector into a memory:

1
2
3
4
5

please, need help coding this voting for your favorite car polling system.
hi, my code needs a lot of work, but i want to be able to let users vote on their favorite car, upda

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

Getting a variable to work in function params
I have this fuction which is inside a class:

Code: public static function generateEmbedCode($

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