MySQL Forums
Forum List  »  Italian

whitespaces -- spazi bianchi
Posted by: Marco Bonoli
Date: March 30, 2015 02:48AM

Ciao a tutti,
scusate se posto una cosa forse per molti di voi banale, ma sto creando un db da dei file di testo e cerco di passare una stringa con degli spazi ad un campo char del db e mi continua a dare errore su errore.

es.
nome campo db 'desc' (char di lunghezza 29)
valore campo db '$desc1'

dove estrapolo prima da un file txt il valore
$desc1=substr($riga,8,29);

la riga estrapolata è per es.
'CIAO COME STAI'

mi da errore
errore nella query INSERT INTO messaggi (des1) VALUES ('CIAO' COME STAI'): 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 'COME STAI')' at line 1

mi fate capire perché??

Options: ReplyQuote


Subject
Views
Written By
Posted
whitespaces -- spazi bianchi
2254
March 30, 2015 02:48AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.