Jump to content

PHP & MYSQL Help


sonu
 Share

Recommended Posts

does your field have any unique column or primary key column?

Link to comment
Share on other sites

You dont need to send a query(reduce overhead) if you have any PK or unique constraint in your database table. if your database schema wants any unique column you should constraint it from the database. you can directly execute the INSERT, if there is no any duplication it will get inserted. otherwise when it fails it sends error, you check the specific error number using mysql_errno() and you can show any specific custom error on that. you can check list of mysql error number here ==> http://dev.mysql.com...ges-server.htmlhttp://php.net/mysql_errno

Edited by birbal
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...