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

    INSERT INTO ed errore MySql

    Codice PHP:
                $time time();
                
                
    $query mysql_query("INSERT INTO 4images_images ('image_id', 'cat_id', 'user_id', 'image_name', 'image_date', 'image_active', 'image_media_file', 'image_thumb_file', 'image_allow_comments', 'image_downloads', 'image_votes', 'image_rating', 'image_hits') VALUES ('', '$_GET[dir]', '1', 'Foto', '$time', '1', '$file', '$file', '1', '0', '0', '0', '0.00', '0')") or die(mysql_error()); 
    Mi restituisce solo:
    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 ''image_id', 'cat_id', 'user_id', 'image_name', 'image_date', 'i
    senza completare la frase.

    Dov'è l'errore?

  2. #2
    Moderatore di Server Apache L'avatar di marketto
    Registrato dal
    Sep 2001
    Messaggi
    5,858
    nn devi usare gli apici nei campi della tabella durante l'insert.
    codice:
    $query = mysql_query("INSERT INTO 4images_images (image_id,...


    think simple think ringo

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.