Visualizzazione dei risultati da 1 a 3 su 3
  1. #1
    Utente di HTML.it
    Registrato dal
    Jan 2006
    Messaggi
    2

    Inviare 2 Query in un colpo solo

    Ciao, qualcuno di voi conosce una qualsiasi forma sintattica in sql ke mi permetta di inviare su mysql 5 2 query ??
    io ho provato col separare le 2 con ; ma nell'applicazione che sto usando x inviarle non lo accetta..

    Esiste qualcosa ke possa essere al mio caso?

    GRazie

  2. #2
    Utente di HTML.it L'avatar di nicola75ss
    Registrato dal
    Nov 2004
    Messaggi
    12,923
    Confesso di essere ancora alla versione 4.1 quindi magari sbaglio ma hai provato a fare separatamente le due query con mysql_query?
    $query1 = mysql_query(tua query);
    $query2 = mysql_query(tua query2);

  3. #3
    Utente di HTML.it
    Registrato dal
    Jan 2006
    Messaggi
    2
    Ciao...veramente quelle query le devo usare su freeradius e la vuole nella seguente forma:

    1° query:
    postauth_query = "INSERT into ${postauth_table} (id, user, pass, reply, date) values ('', '%{User-Name}', '%{User-Password:-Chap-Password}', '%{reply:Packet-Type}', NOW())"

    Query ke voglio eseguire pure insieme a quella:


    INSERT into ${authcheck_table} (UserName, Attribute, op, Value) VALUES ('%{SQL-User-Name}'', 'Calling-Station-Id', ':=', '%{Calling-Station-Id}')

    provando così mi da un errore il mysql:

    postauth_query = "INSERT into ${postauth_table} (id, user, pass, reply, date) values ('', '%{User-Name}', '%{User-Password:-Chap-Password}', '%{reply:Packet-Type}', NOW());INSERT into ${authcheck_table} (UserName, Attribute, op, Value) VALUES ('%{SQL-User-Name}'', 'Calling-Station-Id', ':=', '%{Calling-Station-Id}')"

    e mi kiedevo se esisteva una funzione nativa che mi permettesse di inviarle entrambe su una riga

    errore:
    rlm_sql (sql) in sql_postauth: Database query 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 '; INSERT into radcheck (UserName, Attribute, op, Value) VALUES ('test'', 'Calli' at line 1

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.