Pagina 1 di 2 1 2 ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 16

Discussione: Errore Sintassi MySql

  1. #1

    Errore Sintassi MySql

    Provando a modificare un messaggio nel mio forum asp ho il seguente errore:

    Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

    [MySQL][ODBC 3.51 Driver][mysqld-5.0.45-community-log]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 '' at line 1

    /forum/post.asp, line 319
    alla linea 319 del file post.asp c'è


    Codice PHP:
        strSql "SELECT M.M_NAME, R.R_AUTHOR, R.R_SIG, R.R_MESSAGE "
    317        strSql strSql " FROM " strMemberTablePrefix "MEMBERS M, " strActivePrefix "REPLY R "
    318        strSql strSql " WHERE M.MEMBER_ID = R.R_AUTHOR AND R.REPLY_ID = " strRqReplyID
    319        set 
    my_Conn.Execute (strSql)
        
    strAuthor rs("R_AUTHOR"
    Qualcuno sa da cosa possa dipendere il problema?
    Grazie in anticipo...
    "Non ho sogni nel cassetto, preferisco tenerci la biancheria"
    www.sciax2.it
    Sciax2 Blog | Sciax2 Forum | Cuore Matto, il film

  2. #2

  3. #3
    Utente di HTML.it L'avatar di luca200
    Registrato dal
    Apr 2002
    Messaggi
    4,120
    Be' sarebbe il forum php-mysql...

    @sciax2: stampa la variabile che contiene la query

  4. #4
    il forum è asp...

    come faccio a stampare la variabile?
    "Non ho sogni nel cassetto, preferisco tenerci la biancheria"
    www.sciax2.it
    Sciax2 Blog | Sciax2 Forum | Cuore Matto, il film

  5. #5
    Utente di HTML.it L'avatar di wallrider
    Registrato dal
    Apr 2003
    Messaggi
    2,755

    response.write strSql
    RIP Cicciobenzina 9/11/2010

    "Riseminaciceli, i ceci nell'orto"

  6. #6
    scusate l'ignoranza, ma non ho capito dove devo scriverlo...
    devo eseguire una query sullo sql?
    "Non ho sogni nel cassetto, preferisco tenerci la biancheria"
    www.sciax2.it
    Sciax2 Blog | Sciax2 Forum | Cuore Matto, il film

  7. #7
    Moderatore di ASP e MS Server L'avatar di Roby_72
    Registrato dal
    Aug 2001
    Messaggi
    19,559
    codice:
    strSql = "SELECT M.M_NAME, R.R_AUTHOR, R.R_SIG, R.R_MESSAGE " 
    strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS M, " & strActivePrefix & "REPLY R " 
    strSql = strSql & " WHERE M.MEMBER_ID = R.R_AUTHOR AND R.REPLY_ID = " & strRqReplyID 
    Response.write strSql 
    response.end 
    set = my_Conn.Execute (strSql)
    E posta quello che vedi a video.

    Roby

  8. #8
    ok grazie, non avevo chiuso il response...
    ecco quello che vedo:
    Codice PHP:
    SELECT M.M_NAMER.R_AUTHORR.R_SIGR.R_MESSAGE FROM FORUM_MEMBERS MFORUM_REPLY R WHERE M.MEMBER_ID R.R_AUTHOR AND R.REPLY_ID 
    "Non ho sogni nel cassetto, preferisco tenerci la biancheria"
    www.sciax2.it
    Sciax2 Blog | Sciax2 Forum | Cuore Matto, il film

  9. #9
    come vedi, pare che la variabile "strRqReplyID" non sia valorizzata correttamente... controlla

  10. #10
    probabilmente c'è qualche errore con la versione di mysql, forse è cambiata
    mi da errore anche col vbulletin in php, ecco cosa mi dice:

    ImpEx Database errormysql error: Invalid SQL: SELECT * FROM FORUM_REPLY ORDER BY REPLY_ID LIMIT 0,

    mysql 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 '' at line 1

    mysql error number: 1064

    Date: Friday 10th of August 2007 11:19:46 PM
    Database: Sql85750_2
    MySQL 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 '' at line 1
    ma non so proprio cosa modificare, dovrei cercare dentro il database mysql oppure modificare i file asp/php? avevo letto che poteva dipendere da un aggiornamento della versione e mentre sulla versione precedente si poteva digitare Totale = RS("Totale"),
    adesso la sintassi deve essere del tipo Totale = CInt(RS("Totale"))
    ma nel caso della mia riga che mi da errore
    set = my_Conn.Execute (strSql)
    come devo modificarla?

    oppure potrebbe dipendere dal tipo diverso di codifica, infatti ora che ci penso forse io ho importato un backup utf-8 quando la codifica della tabella era latin1... come faccio allora, cambio la codifica alla tabella... ma poi mi si vedono male le parole accentate
    guardate qui:
    http://www.modwest.com/help/kb6-265.html
    "Non ho sogni nel cassetto, preferisco tenerci la biancheria"
    www.sciax2.it
    Sciax2 Blog | Sciax2 Forum | Cuore Matto, il film

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 © 2026 vBulletin Solutions, Inc. All rights reserved.