Search
Search titles only
By:
Search titles only
By:
Log in
Register
Search
Search titles only
By:
Search titles only
By:
Menu
Install the app
Install
Forums
New posts
All threads
Latest threads
New posts
Trending threads
Trending
Search forums
What's new
New posts
New ads
New profile posts
Latest activity
Free Ads
Latest reviews
Search ads
Members
Current visitors
New profile posts
Search profile posts
Contact us
Latest ads
RHCSA, RHCE, AWS, Docker, Kubernetes Training
Sanjeewani95
Updated:
Tuesday at 10:28 AM
🛡️ Kaspersky Antivirus – 1 Year / 1 Device | Rs. 2,300 | Only 9 Left
KSPathirana
Updated:
Monday at 2:42 PM
Ad icon
Professional CCTV Installation Service
Techguy231
Updated:
Sunday at 10:50 AM
Ad icon
I'll research & write an article - Rs. 2000 onwards
Blogerwiki
Updated:
Sep 3, 2026
House Plan
lenura
Updated:
Sep 2, 2026
Electronics
Vehicles
Property
Search
Reply to thread
Forums
Computers & Internet
Problems and Troubleshooting
mysql database help needed!!
Get the App
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Message
<blockquote data-quote="sri_lion" data-source="post: 6835999" data-attributes="member: 4103"><p>It doesn't matter bro... for this first of all you need a good form validation if the user input the data... make sure the data string passed by the form is always standard creating a date drop down is your best option!</p><p></p><p>Ok lets look at the picture below think that this is your table.. with data..</p><p></p><p>[ATTACH]13860[/ATTACH]</p><p></p><p>Whenever the user trying to create a new record (fill the form and hit submit) your script must look through the database whether the date format together with his ID exist or not, in the example above </p><p></p><p>user_id = 123 already has a row for the date 25022010</p><p></p><p>So when he wants to create another one for the same date, in the form he enters Feb 25, 2010 (will be converted to the string 25022010) now you look through the database for a row that's </p><p></p><p>user_id = 123 and for a string in the date column = 25022010 (which is the date he just entered)</p><p></p><p>if this is found in a single row, then a row exist, then you only allow UPDATE command in SQL.. not CREATE..</p><p></p><p>If the row found.. throw a message with Yes and No asking "Record already exist would you like to edit?" if "Yes" you take the user to an editing form but hide the date (or show the date as a label not as a input)</p><p></p><p>That's all... BTW what language you using for this?</p></blockquote><p></p>
[QUOTE="sri_lion, post: 6835999, member: 4103"] It doesn't matter bro... for this first of all you need a good form validation if the user input the data... make sure the data string passed by the form is always standard creating a date drop down is your best option! Ok lets look at the picture below think that this is your table.. with data.. [ATTACH]13860._xfImport[/ATTACH] Whenever the user trying to create a new record (fill the form and hit submit) your script must look through the database whether the date format together with his ID exist or not, in the example above user_id = 123 already has a row for the date 25022010 So when he wants to create another one for the same date, in the form he enters Feb 25, 2010 (will be converted to the string 25022010) now you look through the database for a row that's user_id = 123 and for a string in the date column = 25022010 (which is the date he just entered) if this is found in a single row, then a row exist, then you only allow UPDATE command in SQL.. not CREATE.. If the row found.. throw a message with Yes and No asking "Record already exist would you like to edit?" if "Yes" you take the user to an editing form but hide the date (or show the date as a label not as a input) That's all... BTW what language you using for this? [/QUOTE]
Insert quotes…
Verification
Awruddata maasa keeyada?
Post reply
Top
Bottom