hi,
I had a project page where we can see projectname and allocate memory text boxes. so my query is that wen we enter a project name and if already a project exists with the same name then i should get a popup. i mean it should not allow duplicate entries.
Thank u.

Member Avatar for rajarajan2017

Logic:

I assumed that you have a variable name $pname which contains the project name you currently entered.

Now connect to database and with the table do the following:

Select projectname from projects where projectname=$pname;

If your query returns 0 (means no result from databse). This will confirm you there is no record in the database with the name you entered. Thats it!

Now update the database with yur new project. Simple!

I hope you understand the logic!

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.