Adding Amounts Of Time
I am looking for a way, as the title suggests, to add a length of time to a time-type field.I needed to type something, and this is what I logically typed (of course, incorrect):
SET playtime=playtime + '$length'
Let's say playtime = 00:10:30, and $length = 00:04:30. What do I need to change the above statement to, so that the new value of playtime = 00:15:00 ?
View Complete Forum Thread with Replies
Related Forum Messages:
How To Save Accounts Based On Variable Amounts Of Time
I'm currently building a website where users can signup for various accounts. An account may last 30 days, 12 months or 24 months. If a user's account is about to expire, an email notification is send, via a CRON Job. I want to save the different account types in the database, but I'm not sure how to save the duration of an account. If it was all months, I could simply save ཈' or པ' as an INT, but it also has an account for 30 days, which is more flexible. Edit: It would also be nice if I could ORDER BY duration..
View Replies !
Adding Time
I want to be able to have a field in the database that an entry on the input form that the user enters a time in the value of hh:mm and this is then added to the total time on the database. What is the best way to do this? I.E what field type, what default value? Is it just straightforward addition in the ASP script to add this to the total?
View Replies !
Time/Space Costs Of Adding Fields To A Table?
I've got a products table for the site I'm working on, and have been asked to extend it considerably so as to accommodate a smallish subset of items. For 20,000 or so of the products, these new fields I'm adding won't be used. For about 3,000 they will. I would be adding the following fields: 2 varchars (50, 50) 8 Floats 1 text (average 800 bytes) 1 tinyint So, assuming 40 bytes for the varchars, that's an average 913 bytes per entry. My question is, for rows that do not have values, will those 913 bytes still be spoken for? Maybe this is moot -- if my calculations are right, 913 bytes x 20,000 items is just around 17k and not a tremendously big deal? Are there any speed hits? I'm pretty careful about never doing a SELECT * FROM, so that shouldn't be an issue. Would it be useful to put all these new values in a new table, linked to the unmodified product table by the product's UID?
View Replies !
Mammoth Amounts Of Self Joins
I have a table that contains keywords (Varchars) each one mapped to a product. so the database schema is just an id column, product column and keyword column. I want to select the products that contain x,y,z keywords. Now if this query involves many keywords I end up with a massive amount of self joins on the keywords table, is there a better way to do this than self joins? What would work perhaps is multiple unions where I could discard non duplicated rows but you can't seem to do that. Any ideas... ?
View Replies !
Import Large Amounts
My client has a large database in MS Access. I need to put a section of this (approximately 900 rows) into MySQL to be displayed on a website. The thing is, every month I will be resupplied with updated data, which will need to replace the data that is currently in the SQL database. I am operating on a Mac and they've given it to me as an EXCEL spreadsheet, which I am trying to import into MYSQL using phpMyADmin with no luck. I've tried exporting from EXCEL to various formats, such as CSV, but I can't seem to get it to import into the MySQL database Does anyone know what I can do? I need it to be relatively simple so that every month I can simply reimport the new data. Is there some trick to importing the data from EXCEL, or should I ask the client to supply the data from MS Access in a different format.
View Replies !
Getting The Sum Of Amounts For Each User - How To Join?
I have a simple table for transactions that will store information like a bank account. To find the balance for a given user I want to sum all the amounts and display the result How can I do this for more than one user at a time? CREATE TABLE `transactions` ( `id` int(5) NOT NULL auto_increment, `user_id` int(10) NOT NULL default Ɔ', `created` datetime default NULL, `modified` datetime default NULL, `description` text character set latin1 collate latin1_general_cs NOT NULL, `amount` decimal(10,0) NOT NULL, PRIMARY KEY (`id`), KEY `user_id` (`user_id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 I'm hoping to get output like: user_id | balance(sum of amounts) ------------------------------------------ 1 | 70 2 | -70 3 | 10 4 | 5
View Replies !
Handling Large Amounts Of Text
I am desiging a web store to hold and manage up to 150,000 to 200,000 items and have run into a problem which I believe can be fixed but I am not sure about the way to go about it.The problem is that every product has a rich text description that contains a lot of extra HTML code that goes into the database with the product description. I would estimate every product has an average of 10k of description and code. Now instead of putting all of this into the database would it be possible to write this to a .txt file and keep it in a products_desc folder? Would this keep the database at a respectible size and optmize everything?Does anyone have any good examples or tutorials on going about this with PHP?
View Replies !
Inserting Large Amounts Of Data Into Mysql
I have a whole bunch of numbers and state, county, city, etc. data that i'm trying to load into a database for a demographics website. The data is all in excel currently so I could easily copy and paste it to a text file or another medium if necessary but I'm wondering what the quickest and most efficient way to get it all entered into mysql is.
View Replies !
PHP/MySQL Sorting By Date & Time (using Non Military Time)
This is probably a simple issue but I have searched online and can't find an answer. I am using PHP/MySQL and I guess the most intuitive would be to have three select boxes containing HOUR / MINUTE / AM,PM option. Then store the time into mysql using there functions so I can output the data sorting them all by date and time. All the examples I have seen are for military time only but I'm sure there has got to be a simple mysql function or php function that converts non military to military and a formatting function to display with the AM / PM. But I have not found it.
View Replies !
Compare Time Posted With Current Time Not Working
May I know how to get records with interval of 1 hour in database where the posting time is in this format '2008-05-15 00:10:40' I tried with this : $query="SELECT date,name FROM message WHERE (timediff(date,NOW())<=CRUDATE() CURTIME())"; But is not working. May I know what is the correct way of doing it?
View Replies !
Minutes + TIME = TIME Function
I need some way to convert minutes (e.g. 80 mins) to SQL TIME (e.g. 01:20:00) in order to add it to another TIME var. Is there any way to do this? I really dont want to convert my whole db. Basically, I want to do: e.g. 80 + 10:00:00 = 11:20:00.
View Replies !
How To Retrieve Mean Time Between Time Stamps
I have a table that stores failure information of external application. The time stamp of every failure event is stored. Now I'd like to make some system performance & reliability statistics calculations based on time stamps in certain recordset; mean time between failure MTBF, down time DT, etc. Example: 2007-09-27 12:23:52 2007-09-27 08:50:23 2007-09-26 23:31:34 2007-09-26 21:45:33 Here the times between are (hours:mins): 3:33, 9:18, 1:46 and MTBF=4:52 Any effective possibility to make this example within a single query - or a procedure is needed?
View Replies !
Time Format Military Time
I know the time format it HH:MM:SS in mysql but can I input military time? reason I can is that I want to later extract that information for calculations and military time is easier to work with.
View Replies !
Date-time Overlaps Another Time
had a time question in mysql... i have a start and end time for a meeting table and i am comparing whether a new meeting conflicts with another meeting in same room on the same date. i was wondering if i could check whether the 'date-time duration' in anyway overlaps another meetings date-time duration. visualized below... ............|____compareToThisMeeting__| .....|_________meetingNewOverlaps__________| i was doing something dumb before i realized i needed soemthing more complex (checking whether the start time of new meeting was 'BETWEEN' the start and end times of a meeting and whether the end time time is as well but i forgot the duration/middle value hehe). (using asp) and just returning booleans with a mySQL SELECT statement is what i am looking for like... //within a loop in asp for meetings on same date/room "SELECT '"+ year+"-"+month +"-"+day +" " + startHourString +":" + startMinuteString +":00''"+ " BETWEEN '"+ thisMeetingStart +"' AND '"+ thisMeetingEnd +"'"; (this doesnt cover the 'middle' overlap areas though)
View Replies !
Adding
I am trying to figure out how exactly to display that someone has signed up for a bunch of specific projects. How would I need to set my tables up? I would need one for users and one for projects. To add multiple signed up projects a person, would I have to create a new column in the users table for each project or could I store it all in one field somehow?
View Replies !
Adding A Value
I want to add a value to a value currently in the database... I have INSERT INTO products(quantity) VALUES ((select quantity from products where ProductId = '1')+10) ;
View Replies !
Adding 1
i cant find this anywhre.all i need to do is add 1 to a INT column. (so if the number is 10, i want it to be 11). sure, i can select from database, add 1, then update the database. but figure there has to be a better more effecient way of doing this.
View Replies !
Adding A Value +
This is what I am trying to do in my PHP code: mysql_query("UPDATE users SET tourneys_1st='tourneys_1st+1' WHERE id='$row[p1]'"); I've tried it both with and without the quotes, but neither work... does this not work at all or do I just have something slightly wrong?
View Replies !
Adding A Primary Key
I removed all the duplicate rows from my database. Now I need to create a primary key. I would like for it to be a number that autoincrement. How can I do this and still get the rows I all ready have in the database to be incremented?
View Replies !
Adding A User Through CLI
I am unable to access the mysql client on this suse10 box. However, the db is active and running. I just need to find a way to add a user for root@anyhost.
View Replies !
Adding AUTO_INCREMENT
i have i field in my database called id that is currently populated with lots of id numbers, but i want to know how from this point on i can set it to be auto_increment. is this possible?
View Replies !
Adding Data
My friend's band's site have a phpbb forum which uses one of my site's mysql databases. My site expires quite soon hence their forum will also go down. In the phpbb admin panel, you can chose to backup the database, so I have done that and am now left with a .sql file. So basically, I have another database set up for them and I'll need to do fresh install of their forums. Doing so will obviously wipe out all posts. So how can I get the data from the old database to the new one?
View Replies !
Adding Days
How can i add 7 days to a date type? Ive tryed simple now() + 7 to get seven days from now but when i checked the database it was still just today.
View Replies !
Adding Images
I'm looking at making an inventory of heritage buildings in my town and storing the information in a mysql database. I've managed to figure out mostly everything up to this point, except the ability to add photos of each building to the database. Anyone know how I might go about doing this in phpmyadmin?
View Replies !
Adding New Data
I have a MySql database which i access using phpmyadmin. I have many records which i need to insert, i can add records using phpmyadmin but this only allows me to add one at a time. I can access the and change the .SQL file but the chance of typos is to high. How can i add data which is currently in MS excel Format? I have tried to save in CVS but phpadmin shouts error at me.
View Replies !
Adding Row Values
Is there a way to do this wihtout GROUP BY that will SUM JobPostView as a single result? SELECT JobPostView, SUM(JobPostView) FROM JobPosts2 WHERE JobPosts2.JobID BETWEEN 1115 AND 1208 GROUP BY JobClass
View Replies !
Adding To A Column Value
I have something like this:PHP Code: TABLE: sectionrating section GOOD BAD 1 23 5 2 12 10 A user can comment on a section and either the good or bad value will be incremented accordingly by a value between 1and 5. My question is how do i add the value the user supplied to the value already in the column.
View Replies !
Adding Up Number
I have a diary table that looks like this did | dcompanyid | duid | ddate | dtime | dtimefinish did = p key dcompanyid = the companies unique id duid = the users unique id ddate = date format dtime = time format dtimefinish = time format I want to add up the number of hours in a particular day, or week an employee works for. so if he worked betweek 9 and 12, 12.30 and 3, 4 and 7 he would work 8.5 hours. I can do this using php and mysql but was wondering if it can be done soley in mysql.
View Replies !
Error Adding
I just finished installing MySQL 5.0 and MySQL Administrator v1.0.21. Everytime when I add new user, I received teh error "Error While Storing the User Information. The user might have been deleted. Please refresh the user list."
View Replies !
Mulipal Adding Up
this is what i have, SELECT addname, addsurname, addpostcode, clclientid, clname, clsurname, jobid, SUM(jobtotal, jobvat) AS TOTAL, SUM(paidpaid) AS TOTAL_PAID FROM clientcard c, jobcard j, address a, paid p WHERE c.clcompanyid = $companyid AND c.clclientid = a.addclientid AND a.addaddressid = j.jobaddressid AND j.jobid = p.paidjobid AND TOTAL != TOTAL_PAID GROUP BY addname, addsurname, addpostcode, addtelephone, clclientid, clname, clsurname, jobid it is a type of made up script that I have done making many assumptions like TOTAL !+= TOTAL_PAID and having to sums. basically TOTAL_PAID is made up of many rows, where as TOTAL is made up of just two numbers, I am trying to display all the rows that have unpaid bills, is this even possible, I have found using if statements in php to be unreliable
View Replies !
Adding To A Field
I need a MySQL script that will add a number to a field. Every time you click a button or something, in database "Database1" and table "Player1", the field "Test1" will then add a "5, " to it. So the first time it is "5," then "5,5," then "5,5,5," . I can't seem to get it to work.
View Replies !
Adding An Index
I've added indexes to the master server before but only after bring down all our JBoss apps, etc. and stopping replication.The main question now is, is it okay to add in index to a table in a live enviroment? Or, is there a possibility that I can mess up the table/DB/customer queries, etc.?
View Replies !
Avoid Adding More Than Once
im trying to do what i think is a fairly easy query but im having some problems. basically i want to only include a certain row of data in the results if it has previously met a certain criteria. however if it has met the criteria more than once i still only want it to return once.
View Replies !
Adding Birthdate Via Php
I'm playing around in the dark. I've created the necessary columns in MySQL and one is "birthdate" and so far I can only get the year entered and not the month or day. I've searched some sites and come up with the variation below and I don't know if I'm on the right track. If it is wrong can somebody correct it please? ....
View Replies !
Adding A Column
For a website I'm developing I'm trying to add a column of calculated values back into a table so that I can use those values for selection criteria. I have no problem generating the values, and displaying them in an html table. But I now need to rewrite these values into a table for a subsequent query. How do I do this?
View Replies !
Adding Two Tables
I am actually developing an application where Data from one table is added to the other.The thing is, both Table A and Table B are having the same attributes (ie both are same tables with different values) for eg ....
View Replies !
Adding Index
add index in a table on field say "abd". There are 6,73,00+ records in the table and it is almost 3 hours this query is running without any output. Id there any way i can identify that this much % is done of the task.... i don't know whether it is "Not Responding" ,"not working" or say I am not able to make out the status. It simple running with no output..... I am not ending the process with a thought it might end now..now ..now but then how much time it is going to take ?
View Replies !
Adding Users
I can add users but how do I make it so the users can not see all the DB, I know I can restrict the user so they cannot veiw the data but I dont want them to even see the other DB's
View Replies !
Adding Search
I hope someone can help me please. I would like to add a search engine to a website. I want the user to be able to enter a search string that will search the db and output results. I am using InnoDB tables so i am unable to do a full text search. I have tried using a SELECT statement: SELECT * FROM Table where name LIKE 'searchstring%', but all i get is all the records displayed. I hope someone can help and thanks for any help, advice and suggestion given in advance.
View Replies !
Adding Values?
How can i add the values of different rows in mysql using php? ie: id field! 1 3 2 2 3 4 4 2 5 6 6 20 7 7 8 5 n 1 ----------------- total = value of id#1 upto id# n. for this example total should be = 50
View Replies !
Adding Entries
I've got a database with approx 300 entries but i've got another 1000 to input and was wondering if anybody knows of a way (apart from using Microsoft Access) of entering the data into the table without having to complete each entry individually as I have all the information on my hard drive.
View Replies !
Adding New Users
I can't seem to add a new user to my database! I've tried it through phpMyAdmin (under privileges) and also running the query GRANT ALL PRIVILEGES ON *.* TO 'myusername'@'%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION which returned no errors and according to phpMyAdmin the user is entered into the `users` table. But when I try to login with that name I get Access denied for user: 'myusername@localhost' (Using password: YES) So all I can use to login is 'root' with no password. Not very secure!
View Replies !
|