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

    inserimento di "=" in un mysql

    ciao a tutti!

    provando ad inserire il simbolo "=" in una varibile che viene inserita in mysql mi dà errore di sintassi.
    Come si può ovviare?

  2. #2
    posta la query che stai usando

  3. #3
    Codice PHP:
      $name $_POST['name'];
      
    $pass_get mysql_real_escape_string($_POST['pass']);
      
    $pass_temp base64_encode($pass_get);
      
      
    $insert "INSERT INTO user
                     (user_name)    
                     VALUES
                     ('
    $name')";
      
    $result mysql_query($insert) or die (mysql_error());
      
      
    $id mysql_insert_id(); // E' AUTO_INCREMENT
      
    $temp gettimeofday(); 
      
    $msec = (int) $temp["usec"]; 
      
    $last md5(time() . $msec);
     
    $password $last $pass_temp $id;
     
    $insert_pass "UPDATE user SET" .
                     
    "user_pass = '$password' " .
                      
    "WHERE user_id = '$id' "
    mi dà questi errore:
    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 '= 'bc50a1267deca1b0ca4008666f86195dY2lhbyBiZWxv4' WHERE user_id = '4'' at line 1

  4. #4
    Utente di HTML.it
    Registrato dal
    Sep 2002
    Messaggi
    460
    Manca uno spazio dopo SET
    There are 10 types of people in the world - those who understand binary and those who don't.

  5. #5
    ho risolto:
    Codice PHP:
    $password mysql_real_escape_string($last $pass_temp $id);
    $insert_pass "UPDATE user SET user_pass = '$password' WHERE user_id = '$id' "

  6. #6
    grazie

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.