Visualizzazione dei risultati da 1 a 4 su 4
  1. #1

    [PHP-MySQL] Non posso inserire gli apici..

    Io ho un guestbook.

    Il problema è che se inserisco all'interno di un campo il carattere ' mi da
    codice:
    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 'valore_precedente')' at line 1
    Cosa può essere, ci sarà un modo di fargli prendere gli apici.. (fargli backslashare tutte le volte che li trova? ma è un po'lunghetto..)
    Main: Asus P5KR | Intel Q6600 G0 @ 3.6GHz | Kingston 2x1GB DDR-II @ 800MHz | POV GeForce 8800GT 512MB | Seagate Barracuda 7200.11 32MB 2x500GB RAID0 | Enermax Chakra 3052BS | Enermax Liberty 500W | Zerotherm Nirvana NV120 Premium || eee PC || Net: Atlantis Land WebShare 340 | Alice 19M/1M || Gentoo Linux | gtk-gnutella rulezz.

  2. #2

  3. #3
    Oh, grazie!

    Ho messo
    $comment2 = addslashes($comment);

    poi all'echo ho scritto:
    stripslashes($comment2)

    se metto solo addslashes, vanno al database, mapoi mi stampa anche le /

    quindi ho aggiunto la stripslashes, ma di da l'errore di sintassi :master:
    codice:
    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 'è', '1141688851')' at line 1
    Lo "'è" sarebbe stato un c'è..

    edit: i messaggi vecchi sono influenzati: con solo addslashes ci mette le / , con entrambi tornano a posto.
    (ho provto a fare dei post con apici direttamente scrivendoli nel db).

    Il problema sono i nuovi post.
    Main: Asus P5KR | Intel Q6600 G0 @ 3.6GHz | Kingston 2x1GB DDR-II @ 800MHz | POV GeForce 8800GT 512MB | Seagate Barracuda 7200.11 32MB 2x500GB RAID0 | Enermax Chakra 3052BS | Enermax Liberty 500W | Zerotherm Nirvana NV120 Premium || eee PC || Net: Atlantis Land WebShare 340 | Alice 19M/1M || Gentoo Linux | gtk-gnutella rulezz.

  4. #4
    Ce l'ho fatta!!
    Io andavo a mettere e togliere gli slash sempre sull output! :rollo:

    Ho dato alla funzione un bellissimo:
    codice:
    $comment_for_sql = addslashes($comment);
    Poi dopo averlo ripescato da sql, ho dato un:
    codice:
    $comment = stripslashes($comment_for_sql);
    E' UNA FIGATA!!!!!

    Main: Asus P5KR | Intel Q6600 G0 @ 3.6GHz | Kingston 2x1GB DDR-II @ 800MHz | POV GeForce 8800GT 512MB | Seagate Barracuda 7200.11 32MB 2x500GB RAID0 | Enermax Chakra 3052BS | Enermax Liberty 500W | Zerotherm Nirvana NV120 Premium || eee PC || Net: Atlantis Land WebShare 340 | Alice 19M/1M || Gentoo Linux | gtk-gnutella rulezz.

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.