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
Pure VPN - Up to 27 Months
vgp
Updated:
Friday at 8:10 AM
එක පැකේජ් එකයි මාසෙටම Unlimited Internet. තාමත් DATA CARD දාන්න සල්ලි වියදම් කරනවද? අඩුම මිලට අපෙන්.
sayuru bandara
Updated:
Tuesday at 12:30 PM
Ad icon
ඉන්ටර්නෙට් එකෙන් හරියටම සල්ලි හොයන්න සහ Success වෙන්න කැමතිද? 🚀 (E-Money & Success Stories)
siri sumana
Updated:
May 30, 2026
Gemini AI PRO 18 months Offer
Hawaka
Updated:
May 27, 2026
Ad icon
koko account
DasunEranga
Updated:
May 27, 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
Winadiyakata thappara keeyak tibeda?
Post reply
Top
Bottom