Hi friends,

How we check text box data with database data in php. If suppose we entered any one number in text box, it compared with database , this already available means give any error message. how we do this.

Member Avatar for rajarajan2017

Logic:

i) create a form with textbox & submit button with form attributes method="post" & action="compare.php"
ii) Within compare.php get the value of textbox with their name attribue $_POST
iii) Establish the connection and connect to database table
iv) Execute query "select * from table where comparefield=$_POST;
v) if returns rows > 0 then the data is already present else not present.

thank you.. how we get values from list into database . i want select values in list . it automatically stored in database. how to do frnd?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.