I need a pattern for an expression:
"on"apostroph"n umber" fg:on'1
/ (on)\'([0-9]) / what is wrong in the reg expr.?thanks
User Profile
Collapse
-
I used myadmin:) and it works..less difficult... -
-
Hi,
I have deleted the apostrophs from code, but the error still is.
[code=sql]
mysql> CREATE TABLE smoke (
-> smoke varchar(5) NOT NULL default '0',
-> time datetime NOT NULL default '0000-00-00 00:00:00',
-> node_nr int(10) unsigned NOT NULL default '0',
-> KEY time (time),
-> KEY node (node_nr);
[/code]
ERROR 1064 (42000):...Leave a comment:
-
sorry, here is the code I have:
[code=sql]
CREATE TABLE table1 (
value int(11) NOT NULL DEFAULT '0',
time datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
nr int(10) UNSIGNED NOT NULL DEFAULT '0',
KEY `time` (`time`),
KEY `node` (`nr`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 |
[/code]
it does not work ...mayby any...Leave a comment:
-
how to create MUL keys in mysql
Helo,
I have problem in finding right tutorial how to create multi key in DB.
I have 4 tables. in each I have
TIME datatime
Nr int
I want them as a MUL key, could You help me in creating the right code to create such a tables.The code has a bug in sql syntax, can You see
[code=sql]
CREATE TABLE table1 (
value int(11) NOT NULL default '0',
time datetime NOT NULL default... -
Yes, I was saying about re-writing.
Nobody answerd on Mysql , so I have to change my way of work...now for perl..
I have a file temp1.txt and I open it and write it's content into temp1b1.txt - it would be my backup. the whole script is relading each 10s becouse file temp1.txt will be getting new values constantly..
now I need to delete or truncate data from file tem1.txt which are written to temp1b.txt , I have...Leave a comment:
-
I did as You told me,
so I have a different question, I hope You could help me out with that...the same problem but different way...how about using perl ..
1. open file read the data
2. insert it into mysql table
3. after inserting data into mysql table delete data form file which are sended
than new data ocurrs in the file and I would avoid inserting the same, but how know which data has been inserted?...Leave a comment:
-
Megi replied to mysql perl - load data local infile...re-writes whole file when I need only updats;/in MySQLwhat more...the code:
[code=mysql]
LOAD DATA INFILE '$temp1'
IGNORE INTO TABLE .......;
[/code]
dosen't work... to ignor repeating values...
what can I do ...please help...
thanks!Leave a comment:
-
Megi started a topic mysql perl - load data local infile...re-writes whole file when I need only updats;/in MySQLmysql perl - load data local infile...re-writes whole file when I need only updats;/
welcome,
I input data form file to mysql with command: load data local infile..
The efect is that the data are duplicated or trippled..etc with every re-loading the script, but I need to load there only new values from file.
here is the code:
[code=perl]
#!/usr/bin/perl -w
use CGI qw(:standard);
use CGI::Carp qw(warningsToBr owser fatalsToBrowser );
use... -
Thanks anyway, I will follow Your tips about the code tags.
By the way how can I contact with the experts:)...Leave a comment:
-
Helo Jeff,
You are completly right! I have corrected the errors and it works like almost like I wanted to..
here is the script:
[code=perl]
#!/usr/bin/perl -w
use CGI qw(:standard);
use CGI::Carp qw(warningsToBr owser fatalsToBrowser );
use DBI;
$foo = new CGI;
my @row;
print $foo->header;
$temp1 = 'temp1.txt';
# BD connection----------------------------------------...Leave a comment:
-
aaaaaaaa what more:
I put the script in /usr/lib/cgi-bin/ as all my perl and cgi scripts...so where to put a file temp1.txt ???I have put it in the same directory as script...
my errors form command line:
Code:madzia@madzia-laptop:/usr/lib/cgi-bin$ perl loader.pl [Tue Dec 4 14:51:15 2007] loader.pl: Name "main::temp1" used only once: possible typo at loader.pl line 13. [Tue Dec 4
Leave a comment:
-
putting data from file to mysql...
Helo,
I found at forum somebodys post:
I'm trying to parse an input file and then take data from that file and enter it into a MySQL database. I'm separating the fields with tabs '\t' and ending the records with a newline '\n'. I'm using the LOAD DATA function (see the code snippet below).
[CODE=perl]# Load the data into the history table
my $sql_statmnt2 = "LOAD DATA LOCAL INFILE \'$history_file \'...
No activity results to display
Show More
Leave a comment: