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:
Yesterday 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: 6834833" data-attributes="member: 4103"><p>Ok I think I know your problem... you've set primary keys for "date" and "user_id" this doesn't work that way because "user A" and "user B" maybe getting only single row per day in the database.. right?</p><p></p><p>But the next day they are going to get another row... so having those fields as PK won't do it... because it needs to repeat.. you need a separate PK for this say for example "daily_id" or something...</p><p></p><p>You need to control your input in your script... in the script you make your own primary key by checking "user_id+today's date" when you want to put the record in.. you need to check today's date(string) and user_id combination.. </p><p></p><p>I'll try to give you the pseudo here..</p><p></p><p>[code]</p><p>variable my_id = A</p><p>variable today = 25022010</p><p>variable count = count rows in db where user_id= my_id and todays_date = today</p><p></p><p>if (variable count > 1)</p><p>{</p><p> allow edit only and pop-up msg "you cannot create a new row, would you like to edit the existing one?"</p><p>}</p><p>else </p><p>{</p><p> add a new row</p><p>}</p><p>[/code]</p></blockquote><p></p>
[QUOTE="sri_lion, post: 6834833, member: 4103"] Ok I think I know your problem... you've set primary keys for "date" and "user_id" this doesn't work that way because "user A" and "user B" maybe getting only single row per day in the database.. right? But the next day they are going to get another row... so having those fields as PK won't do it... because it needs to repeat.. you need a separate PK for this say for example "daily_id" or something... You need to control your input in your script... in the script you make your own primary key by checking "user_id+today's date" when you want to put the record in.. you need to check today's date(string) and user_id combination.. I'll try to give you the pseudo here.. [code] variable my_id = A variable today = 25022010 variable count = count rows in db where user_id= my_id and todays_date = today if (variable count > 1) { allow edit only and pop-up msg "you cannot create a new row, would you like to edit the existing one?" } else { add a new row } [/code] [/QUOTE]
Insert quotes…
Verification
Asuwa dahayen wadi kalama keeyada?
Post reply
Top
Bottom