[MYSQL] Error 1064

Pagina: 1
Acties:

  • HyperDevil
  • Registratie: Oktober 2003
  • Laatst online: 19-11 19:15
Hallo,

Ik ben al 2 dagen bezig om met de commandline dingen in de database te voeren.
Gaat perfect op 2 scripts, maar de derde doet het niet.
Dit is mijn syntax:

code:
1
2
3
4
dbconnect="/usr/bin/mysql -ublaat -pblaat -Dblaat -hblaat"
echo "INSERT INTO ups (linev, load, battlev, temp, outputv, linefreq, battv) 
VALUES ('$upslinev', '$upsload', '$upsbattlev', '$upstemp', '$upsoutputv', '$upslinefreq', '$upsbattv')"
|$dbconnect


Foutmelding:

code:
1
2
3
ERROR 1064 at line 1: 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 'load, battlev, temp, outputv, linefreq, battv) VALUES ('221.0',


Table:
code:
1
2
3
4
5
6
7
8
timestamp   datetime     0000-00-00 00:00:00         
linev                float       NULL       
load                float        NULL       
battlev         float        NULL       
temp               float        NULL        
outputv        float        NULL        
linefreq        float       NULL        
battv               float       NULL


De variables zijn gevuld en gechecked, en de velden in mysql zijn allemaal float (NULL).
Server versie: 4.0.24_Debian-10sarge2-log
Heb op het forum en op internet gezocht, quotes weg gehaald, variables verandert en het wil maar niet lukken. :'(

[ Voor 16% gewijzigd door HyperDevil op 12-02-2007 13:18 ]


  • sky-
  • Registratie: November 2005
  • Niet online

sky-

qn nna 👌

tip : variabelen buiten quotes.

don't be afraid of machines, be afraid of the people who build and train them.


  • NMe
  • Registratie: Februari 2004
  • Laatst online: 20-11 11:59

NMe

Quia Ego Sic Dico.

"LOAD" is een keyword in MySQL. Zet daar eens backticks ( ` ) omheen. :)

'E's fighting in there!' he stuttered, grabbing the captain's arm.
'All by himself?' said the captain.
'No, with everyone!' shouted Nobby, hopping from one foot to the other.


  • HyperDevil
  • Registratie: Oktober 2003
  • Laatst online: 19-11 19:15
-NMe- schreef op maandag 12 februari 2007 @ 13:20:
"LOAD" is een keyword in MySQL. Zet daar eens backticks ( ` ) omheen. :)
( ` ) zal niet werken, dan probeert bash het te executen:
line 1: load: command not found

  • NMe
  • Registratie: Februari 2004
  • Laatst online: 20-11 11:59

NMe

Quia Ego Sic Dico.

Je hebt vast wel een manier om te escapen in strings binnen bash. ;)

'E's fighting in there!' he stuttered, grabbing the captain's arm.
'All by himself?' said the captain.
'No, with everyone!' shouted Nobby, hopping from one foot to the other.


  • HyperDevil
  • Registratie: Oktober 2003
  • Laatst online: 19-11 19:15
Nou ik heb net veld: load naar uload verandert, en het werkt!!

Danku Danku Danku _/-\o_ _/-\o_ _/-\o_
Pagina: 1