Jump to content
The mkiv Supra Owners Club

Caesard

Club Members
  • Posts

    545
  • Joined

Everything posted by Caesard

  1. Anyone who is knowledgeable in SQL and SQL syntax (coding). I have a minor problem with a database table, and asked the question on Stackoverflow. Even though I got some answers, I cannot make head or tail of it as I always get errors on trying to execute. Here is the question. My MySQL database Table has the following columns: Primary_ID, Begin_Date, End_Date, Timestamp How do I update using phpmyadmin, selected rows with randomly generated begin_dates and timestamp within a specified date range (eg: 30 days in a month). E.g of desired outcome Primary_id--- Begin_Date -------------Timestamp 1.------------2008-09-02--------------2008-09-02 21:48:09 2.------------2008-09-03--------------2008-09-03 15:19:01 3.------------2008-09-14--------------2008-09-14 01:23:12 4.------------2008-09-27--------------2008-09-27 19:03:59 Date Range between 2008-09-01 and 2008-09-31. Time is variable 24 hrs I am a newbie, so a syntax that will work in phpmyadmin will help greatly. We are making a presentation for a gym site with 500 members but the added member values all have the same begin date and time. Trying to separate them into different monthly registrations in the database, eg 50 people registered in August at different days and times, 35 people in October, etc. When I try some of the answers here, I get this error: #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '$randomDate = rand(1,31)' at line 1. So ideally, a code I can copy and paste into phpmyadmin with minimal editing will be appreciated. In sequence if possible. For a total dummy to understand and execute with as close to one or two clicks as possible. Here is the answer I got. I'd start with something like this. A bunch of these can be combined, but I split it up so you can see what I'm doing. To get random numbers, you can use rand(). Get one for the date, hour, minute, and second $randomDate = rand(1,31); $randomHour = rand(1,24); $randomMinute = rand(0,59); $randomSecond = rand(0,59); You will want leading zeros (03 instead of 3) so you can use str_pad to add them, if required $randomDate = str_pad($randomDate, 2, '0',STR_PAD_LEFT); //The '2' is how many characters you want total //The '0' is what will be added to the left if the value is short a character Do the same with all your other random values. Just because I like neat queries, you should make up your final update strings next. $newDate = '2008-09-'.$randomDate; $newTime = $randomHour.':'.$randomMinute.':'.$randomSecond; Now I don't know how you're determining which rows you want to update, so I will leave that up to you. For an example, I will show you a query if you wanted to do this with Primary_id 3: $x = mysql_query("UPDATE yourTable SET Begin_Date=\"$newDate\", Timestamp=\"$newTime\" WHERE Primary_id = 3"); How do I get it working in phpmyadmin. Willing to buy thank you beers for any help.
  2. No pics at the moment. But it can fit, and most importantly, they are the cheapest dry carbon GT mirrors you will find on the planet currently.
  3. Final price drop £60. Need the funds ASAP. When this vanishes from here, it is gone, gone, gone.
  4. You Sir, must be a wealthy man to have 15 kids. Congratulations. Happy Days to your daughter and Son In law (For those wondering at my kid count, the cost of having the Supra is equivalent to 6 extra kids).
  5. I will see you back in one sooner than you anticipate. Mark my words.
  6. It wasn't me. Go to sleep
  7. Sure feels good. I find every opportunity to drive mine every day.
  8. As I am turning my entire car into as much carbon as I could, I bought these to fit too. But I need money in the short term, so selling some choice stuffs to help pay some bills. Here for sale, gents, is a genuine TC Sportline Dry Carbon GT3 wing mirrors. Never fitted. These are among the lightest mirrors you will find on the planet. Need funds for some bills. So reluctantly selling them. Bargain price £120 plus delivery. Open to offers. 100% dry carbon. Rare. Also eliminates the common blind spot in mirrors. Has base plate to fit a variety of cars, but fits the Supra with some custom fitting without the plate. This is a steal. Get it now ! You might not find another this cheap. Remember the last deal you lost out on by wasting time? http://img.tapatalk.com/6d98c3d0-1f4f-a743.jpg http://img.tapatalk.com/6d98c3d0-1f65-4a98.jpg http://img.tapatalk.com/6d98c3d0-1f78-5321.jpg http://img.tapatalk.com/6d98c3d0-1f94-a248.jpg 2
  9. Keron, what about the Autobox Gear knob you promised to send me pics of?
  10. Wow, damn good price. Can a Turbo conversion be done on the engine?
  11. Oh, sorry Pete. Sorting it now. Pmed you.
  12. Truly epic statement. I have 4 cars with theoretically bigger boot space than the supe, and I find I can carry more in the supra. Can't believe I can fit my mountain bike in it, for crying out loud. It can even take 2 or 3 bodies with their cement shoes already attached ready for their trip down the Thames
  13. Don't slate it if you don't like it. Others liked it enough to make it. I think its fab.
  14. Make me an offer fellas. Quality counts for your baby.
  15. Greddy Rare pillar pod is always a quality item and for £75, practically being given away.
  16. Crystal clear set of lights with Fog light conversion.
  17. Can't afford you Chris. Thought of doing this myself, but the sheer amount of work to be done +the number of hours + the fact my car is always sat outside on the street + the fact I don't really know what the heck I am doing has promptly made me give up the idea. Though the Lord knows my car sorely needs a wizard's touch like this.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. You might also be interested in our Guidelines, Privacy Policy and Terms of Use.