auriaks
11-25-2009, 04:08 PM
hi,
I use this script to insert my info onto mysql:
mysql_query("INSERT INTO inbox (To, msg, from, look, date, time, tema)
VALUES('$to', '$msg', '$from', '$look', '$date', '$time', '$tema')") or die(mysql_error());
My table rows are:
CREATE TABLE IF NOT EXISTS `inbox` (
`id` int(50) NOT NULL,
`To` varchar(40) character set utf8 collate utf8_lithuanian_ci NOT NULL,
`msg` varchar(1000) character set utf8 collate utf8_lithuanian_ci NOT NULL,
`from` varchar(30) character set utf8 collate utf8_lithuanian_ci NOT NULL,
`look` varchar(30) character set utf8 collate utf8_lithuanian_ci NOT NULL,
`date` date NOT NULL,
`time` time NOT NULL,
`tema` varchar(200) character set utf8 collate utf8_lithuanian_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
but i got error:
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 'To, msg, from, look, date, time, tema) VALUES('mantelis', 'kitas', 'admin', '' at line 1
Whats wrong??
I use this script to insert my info onto mysql:
mysql_query("INSERT INTO inbox (To, msg, from, look, date, time, tema)
VALUES('$to', '$msg', '$from', '$look', '$date', '$time', '$tema')") or die(mysql_error());
My table rows are:
CREATE TABLE IF NOT EXISTS `inbox` (
`id` int(50) NOT NULL,
`To` varchar(40) character set utf8 collate utf8_lithuanian_ci NOT NULL,
`msg` varchar(1000) character set utf8 collate utf8_lithuanian_ci NOT NULL,
`from` varchar(30) character set utf8 collate utf8_lithuanian_ci NOT NULL,
`look` varchar(30) character set utf8 collate utf8_lithuanian_ci NOT NULL,
`date` date NOT NULL,
`time` time NOT NULL,
`tema` varchar(200) character set utf8 collate utf8_lithuanian_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
but i got error:
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 'To, msg, from, look, date, time, tema) VALUES('mantelis', 'kitas', 'admin', '' at line 1
Whats wrong??