Programming :: How To Sort Two MySQL Table On Date Or Time Column

Jul 27, 2011

I have two different table in a database in mysql that has no share key with each other and I want to sort them with each other on their date time column I mean when I sort it row X of table A that is older that row Y of table B comes earlier.

View 3 Replies


ADVERTISEMENT

Programming :: MySQL And PHP - Table Column With Multiple Values?

Dec 1, 2008

I am writing a script to mine data from my game server logs which are going to mysql. My first question is syslog-ng is sticking $msg into one colum it self, $msg tends to be a long string here are a few examples:

cn name team frag death flags role host.
0 Maik CLA 2 0 0 normal *.70.233.118.
1 lizardncd RVSF -1 3 0 normal
[*.22.247.40] lizardncd fragged Maik.

And they are not always in the same format, How could I parse this data to do something useful, like creating a user stats page with frag counts and flag counts. Should I create a script that runs in a cronjob that parses this data to a new table maybe once a day. Even then the $msg string value is random and I am thinking in terms of awk.

Second. I would like to keep track of what ip's are using what nicknames. Kinda in the sense of and ip associated to a array of names that have been used on that ip address so I can keep track of users. How would this work logically with a mysql db, could a column allow multiple values, then loadable into an array, which then can add, remove, and store to mysql.

View 1 Replies View Related

Programming :: Importing MYSQL Table From Text File Wo Column Delimiters?

Jun 13, 2011

I am trying to import a data file from old DOS application into MYSQL table The file is clear text file with fixed-width columns, without column delimiters

Example file :
Code:
4444333666666
2222666555555
iiiiwwwcccccc

[Code]...

View 3 Replies View Related

General :: Sort The 3rd Column In A Table Numerically

Jun 22, 2010

i wanna sort the 3rd column in a table numerically ( no actual borders...only tabs seperating the columns)
it should be something like this but i cant get it right

Sort -u +1 -3 results

the file is called results

View 7 Replies View Related

OpenSUSE :: Kmail Akonadi And Mysql Errors - Can't Open And Lock Time Zone Table: Table

May 3, 2010

Kmail 1.13.2 Problem on startup, error is from nepomuk, data storage. "cannot find Redland backend, nepomuk is disabled until fixed. Also see the following error from the akonadi console:

100503 10:00:15 [Note] Plugin 'ndbcluster' is disabled.
100503 10:00:15 InnoDB: Started; log sequence number 0 31413862
100503 10:00:15 [Warning] Can't open and lock time zone table: Table
'mysql.time_zone_leap_second' doesn't exist trying to live without

[code]....

View 2 Replies View Related

Software :: Change Date Format In Mysql Table?

Jun 26, 2011

I want to insert a acess log file to mysql table.

my log file look like this;

08/Apr/2011 10:51:19 http://v4.netlogstatic.com/v6.00/385...t.messenger.js
08/Apr/2011 10:51:19 http://download.windowsupdate.com/ms...536945da07.exe
08/Apr/2011 10:51:19 http://www.google.lk/search?
08/Apr/2011 10:51:19 http://clients1.google.lk/generate_204

[Code].....

i want to insert this in to a table which having datetime (as it is in log file) and the site visited.

I created a mysql table using DATE using the date type and the TIME suing time type.but once i loaded this log to table date field shows empty. like following.

| 0000-00-00 | 04:18:29 | http://www.espncricinfo.com/navigati...scorecard.css?

how can I solve this problem.your responses are highly. My table should look like the following

| 08/Apr/2011 | 10:51:19 | http://www.radioeksen.com/song.txt

View 1 Replies View Related

Programming :: Concatenate File Sort By Date?

May 5, 2010

i have text file that filename contain the date of creation (i.e 2010.05.02.log).I would like to create a script that:-Ask for start date -Ask for end date- Concatenate all file on the requested period by date order.

View 1 Replies View Related

Programming :: PHP Ignores One MySQL Table But Not Others?

Sep 23, 2010

I have just run into a baffling error. I have a database set up in MySQL with six tables. My PHP based website performs queries of all kinds on these tables (SELECT, INSERT, UPDATE, DELETE). On my most recently setup table, the "Orders" table, I am able to perform queries from the server, as well as from my PHP MySQL Admin interface, but all activity from my webpage states that the Orders table does not exist. All other tables are running fine. I have tried rewriting the query script, checked for case sensitivity problems, even cut and pasted other working scripts in place, changing the table and field names as needed. No success. What could cause a single table to not show up like this?

View 2 Replies View Related

Programming :: Unable To Delete A Table In MySQL?

Oct 17, 2010

A sed mishap prior to a database import left me with a table name with, eh, well, this: Code: mysql> show tables;

+-------------------+
| Tables_in_someday |
+-------------------+
| day20101016 |
| day20101017); |
+-------------------+

I've corrected the sed mishap and imported the database the way it was intended Code: mysql> show tables;

+-------------------+
| Tables_in_someday |
+-------------------+
| day20101016 |
| day20101017); |
| day20101017 |
+-------------------+

But I can't seem to drop the table day20101017); because no matter how I seem to escape it it errors.

View 1 Replies View Related

Programming :: Using Perl To Update Mysql Table On Certain Event?

Feb 6, 2011

I'd like to use a perl script to update a fields in mysql database when pianobar (command line pandora radio player) starts a new song. Pianobar has the ability to run a script based on events, I'd like to take advantage of and use perl toparse the artist,song,album and update the corresponding fields. Then later retrieve them and display them with php/html. I am by no means proficient with perl. I started to use bash, but it looks like perl will be much more efficient and and less time consuming.

Code:
#! /usr/bin/perl -wT
use strict;

[code]...

View 2 Replies View Related

Programming :: Perl: Compare CGI Input With Data From A MySQL Table?

Nov 19, 2008

I have this program:

#! /usr/bin/perl
use DBI ;
use strict ;

[code]....

and I get this error simply running the program from the command line: DBD::mysql::st execute failed: 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 '' at line 1 at ./submit.cgi line 24.

is this the right syntax to use, both, for this line:

my (@param) = $cgi->param("firstname","lastname","type") ;

as well as this one:

$sth=$dbh->prepare ("SELECT firstname,lastname,type FROM dts WHERE firstname LIKE $param[0] AND lastname LIKE $param[1] and type LIKE $param[2]" );

or should there be quotes around the $param[0] or something? (also is it $param[0] or $param(0)?)

View 1 Replies View Related

Programming :: Shell Script To Get Count Of Records In A Mysql Table?

Oct 23, 2010

I'm using MYTHTV with AT&T's U-Verse system. AT&T apparently turns off the set-top box if the box doesn't receive any commands after some number of hours. When this happens the box takes so long to turn on that it doesn't process the lirc IR channel change command. I've rewritten my channel changer to add a lockfile, and added a cron entry to kick off an entry to just "ping" the set-top box once an hour. But, OK, I'd like to play the bandwidth saving game and not do this if there isn't anything in the "record" table.

So, how would I write a script that will check the number of rows in the "record" table in the "mythconverg" database and exit if there are zero rows? I'm afraid I don't know how to even start this. Here is my "keepalive.sh" script that does the pinging:

Code:
#!/bin/sh
#if there are no rows in the record table, just exit this script
# lock the lockfile - MUST be same one as channel lock
while [ `lockfile "/tmp/mythchanlock.lck"` ]

[Code]....

View 3 Replies View Related

Programming :: Split Mysql Date Query Or Hide Some Output?

Feb 22, 2011

So I've got a rather vast database, one of the columns is date in the following format: DD/MM/YY HH:MM:SS. This is starting to cause problems with a php page I'm writing which asks the user for a 'start date'. Would it be better for me to split the date column into date and say time? Or is there a way of using distinct and masking the times.

View 10 Replies View Related

Programming :: PHP Auto Removes Stale Sessions On It's Own But Doesn't Remove From MYSQL Table

Aug 24, 2010

I know PHP auto removes stale sessions on it's own, but that doesn't remove them from the MYSQL table. So I was gonna make a cron script that ran once every hour that removed any MYSQL shopping cart item from the table if the original session_id that created it does not exist anymore.

From my understanding a session_id is an "actual" file located somewhere on the harddisk (is it not? correct me if I'm wrong), so I was going to do a simple check for each item in the shopping cart to check for it's original session file, if it didn't exist on the harddisk, then simply remove it from the mysql table.

View 1 Replies View Related

Programming :: Add Date/Time To The Message Body?

Sep 6, 2009

- how to add the date/time to the email (message body)

- how to as the user to add a picture

- how add on an error page a button to send it back to the form so that the input does not get lost

Here the program so far:

<?php
/*
CHFEEDBACK.PHP Feedback Form PHP Script Ver 2.15.0
Generated by thesitewizard.com's Feedback Form Wizard 2.15.0.

[code]....

View 1 Replies View Related

Programming :: Ls -R Without Changing Access Time/date?

Aug 31, 2010

I am using cygwin in order to test a bash script that uses the ls -R command. When I use this, the access date of the subfolders are changed, and I need them to remain what they were before the command was run. I don't have access to a legitimate Linux system, so I'm not sure if this is the fault of cygwin or the ls command. The script is being used to find the last access date of all files underneath several subfolders and then return the latest date found in each subfolder as the last access date for that subfolder. For some reason, some of these folders have files in them that are newer than the folder's last access date, so the script is meant to give us a list of the true last access date for these folders.

View 5 Replies View Related

Programming :: DBD::mysql::st Execute Failed: Column Count Doesn't Match Value Count At Row 1

Feb 24, 2010

I have the following perl/DBI script:

Quote:

#!/usr/bin/perl
use DBI;
my ($db, $user, $pw) = ('dbname', '****', '***********');
my $dbh = DBI->connect("DBI:mysql:$db",$user,$pw) or die "Cannot connect to $db: $DBI::errstr

[code].....

The error message is

[Wed Feb 24 13:03:27 2010] myscript.cgi: DBD::mysql::st execute failed: Column count doesn't match value count at row 1 at myscript.cgi. [Wed Feb 24 13:03:27 2010] myscript.cgi: DBI::db=HASH(0x8a30c60)->errstr

View 2 Replies View Related

Programming :: Convert A Given Date To Epoch Time And Vice Versa?

Jan 5, 2011

I'm developing a C++ application which is run on linux. I need to calculate epoch time for a given date and vice versa. (no of seconds elapsed since 1979-01-01) I used the following two methods.I need to convert the given date to epoch time and again convert that epoch time to the corresponding date.But the following methods doesn't give me the correct answer. Method to calculate the epoch time:

Code:

time_t HistoryCache::ConvertTimeToEpoc(const char* _zTime,const char* _zFormat)
{
struct tm tmTime;
strptime(_zTime,_zFormat, &tmTime);

[code]....

My problem is this. Lets think that the value I get as epoch time for the 2010-01-05:000000 is 1262649600. (lTime value) Then I use the same value (1262649600) as a input to the GetTimeStamp method, I didnt get the dateString as 2010-01-05:000000. The date is changed by one day.

View 2 Replies View Related

Programming :: Why Does Strptime (c++) Seem To Not Correctly Parse Date/time String

Feb 8, 2010

here is the problem code using strptime() function.

==================
#include <stdio.h>
#include <string.h>
#include <time.h>

[code]....

Why are the Month and Year so messed up? I am using strptime() according to the man page.

View 2 Replies View Related

Programming :: Converting Epoch In A File Name To Human Readable Date/time?

May 5, 2011

I have log files that everyday are downloaded from my webserver in the format: Code: samplesite.com.xxxxxxxxxxx.gz xxxxxxxxxx is a 10 digit epoch time. I am trying to figure out a way in batch to:

1. find all of exisiting files containing the pattern (after the first run it will only be one a day)
2. Isolate the epoch string
3. convert the epoch string to human readable date/time
4. rename the original file as samplesite.com.mmddYYYY.gz

View 2 Replies View Related

Programming :: Awk Multiple Column Into Single Column?

Jul 15, 2010

I have a multicolumn datas, like

a1 b1 ... f1
a2 b2 ... f2
. . ... .

[code]...

I would like to make a file with all these data in one column, like

a1
a2
.
.

[code]....

Can it be done with awk or some other command? Also, is it possible then do add another column in front of this one with numbers of the lines (for every previous column), like

1 a1
2 a2
. .
. .

[code].....

View 14 Replies View Related

Programming :: Sort Files In Directories Based On Files Date

Sep 8, 2009

I need a script that will take all the files in a given directory and create new monthly sub-directories and sort all the files based on the creation date into the appropriate directory.For example, all files created between 01/01/09 and 01/31/09 will be placed in 'JAN-2009'

View 5 Replies View Related

Software :: Open Office Year-to-date Column

Apr 13, 2010

I don't use office apps often and I'm using Open Office to put donations entries into a yearly statement for a non profit organization, and I can't figure out how to do a year-to-date column that will sum each line to the lines before it.How would I accomplish the year-to-date column using a formula, to add the previous year to date and the amount.

View 1 Replies View Related

Server :: Mysql 'Table 'mysql.user' Doesn't Exist'?

Aug 2, 2010

I'm trying to setup wordpress on my server, which of course I need mysql for. I setup a database the other day, which worked perfectly, but I had to start again as I put some information in wrong. Now, I can create a database fine, but when I run

Code:
GRANT ALL ON wordpress.* TO wordpress@localhost IDENTIFIED BY "password";
I get the output:

[code]...

View 13 Replies View Related

General :: How Do I Sort Output Of Du By Its First Column

Mar 30, 2010

How do I sort the output of du by its first column. I issue the command this way:$ du.Is there a way?

View 5 Replies View Related

General :: Sort .txt File By The Numerical Order Of Column?

Mar 22, 2010

I have this .txt file

3183630 R
3574216 W
5264994 M
2656889 A

I want to sort it by the numerical order of column. After sort, I wish to get output like

2656889 A
3183630 R
3574216 W
5264994 M

anyone knows how to use sort to do that? or any other command?

View 6 Replies View Related

Software :: Completely Emptying Column In MySQL

Mar 25, 2010

I have a database with the following table (see below). What I need to do is to empty the itype column completely, so that if I do a Select itype from items; it will return empty set. I have tried dropping and recreating the itype column, but it just adds the data I want to insert to the end, and even when I recreate it, it is not empty.. I need to overwrite it, or better, start with an empty column.

mysql> desc items;
+----------------------+--------------+------+-----+-------------------+----------------+
| Field | Type | Null | Key | Default | Extra |
+----------------------+--------------+------+-----+-------------------+----------------+
| itemnumber | int(11) | NO | PRI | NULL | auto_increment |
| biblionumber | int(11) | NO | MUL | 0 | |
| biblioitemnumber | int(11) | NO | MUL | 0 | |
| barcode | varchar(20) | YES | UNI | NULL | |
| dateaccessioned | date | YES | | NULL | |
| booksellerid | mediumtext | YES | | NULL | |
| homebranch | varchar(10) | YES | MUL | NULL | |
| price | decimal(8,2) | YES | | NULL | |
| replacementprice | decimal(8,2) | YES | | NULL | |
| replacementpricedate | date | YES | | NULL | |
| datelastborrowed | date | YES | | NULL | |
| datelastseen | date | YES | | NULL | |
| stack | tinyint(1) | YES | | NULL | |
| notforloan | tinyint(1) | NO | | 0 | |
| damaged | tinyint(1) | NO | | 0 | |
| itemlost | tinyint(1) | NO | | 0 | |
| wthdrawn | tinyint(1) | NO | | 0 | |
| itemcallnumber | varchar(30) | YES | | NULL | |
| issues | smallint(6) | YES | | NULL | |
| renewals | smallint(6) | YES | | NULL | |
| reserves | smallint(6) | YES | | NULL | |
| restricted | tinyint(1) | YES | | NULL | |
| itemnotes | mediumtext | YES | | NULL | |
| holdingbranch | varchar(10) | YES | MUL | NULL | |
| paidfor | mediumtext | YES | | NULL | |
| timestamp | timestamp | NO | | CURRENT_TIMESTAMP | |
| location | varchar(80) | YES | | NULL | |
| onloan | date | YES | | NULL | |
| cn_source | varchar(10) | YES | | NULL | |
| cn_sort | varchar(30) | YES | | NULL | |
| ccode | varchar(10) | YES | | NULL | |
| materials | varchar(10) | YES | | NULL | |
| uri | varchar(255) | YES | | NULL | |
| itype | varchar(10) | YES | | NULL | |
| more_subfields_xml | longtext | YES | | NULL | |
| enumchron | varchar(80) | YES | | NULL | |
| copynumber | varchar(32) | YES | | NULL | |
+----------------------+--------------+------+-----+-------------------+----------------+
37 rows in set (0.05 sec)

View 4 Replies View Related

Fedora :: Network Time Protocol Part Of Date / Time Settings

Oct 3, 2009

I've got fedora 11 set up to use network time protocol to sync my laptop's date & time when I'm on-line. The question is simple really, I've added a local universality's time server (what is public) and it's live. but it's added to the end of the default time servers what come with fedora. How do I get fedora to just use the local time server, is it a case of removing the default time servers for fedora, but there is a box what says advanced options which are. sync system clock before starting service ???? & use Local time source (( is that the same as the local ntp server that I've got set up ))Hope some body can help me with the network time protocol part of Date/Time settings.

View 9 Replies View Related

Ubuntu :: Set Time To Singapore Server With Time And Date?

Oct 28, 2010

I want to synchronize my time to a time server in Singapore. How can i do so with the Time and Date in System - Administration - Time and Date?

View 4 Replies View Related

Red Hat / Fedora :: Date And Time Changing All Time / Solution For It?

Jan 11, 2010

I have a problem..
the Date and time are changing all the time...

Meanwhile, I'm set the clock every day, But I must find a solution ... Do you have a solution?

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved