mysql wstawianie wartosci
: wt lip 19, 2005 8:17 pm
Siedze juz 2 h nad tym, wszystko wydaje sie byc dobrze ale nie chce dzialac i nie za bardzo rozumiem komunikat o bledzie
wywala mi komunikat:
[sql]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 'VALUE ( NULL, '', ' sssss', '', '')' at line 1 [/sql]
Tabele sa zdefiniowane w ten sposob:
PROSZE O POMOC
Kod: Zaznacz cały
mysql_query("INSERT INTO news VALUE ( NULL, '$tytul', '$tresc', '$fotka', '$user')");[sql]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 'VALUE ( NULL, '', ' sssss', '', '')' at line 1 [/sql]
Tabele sa zdefiniowane w ten sposob:
Kod: Zaznacz cały
$nazwa_tabeli = 'news';
$def_tabeli = "data TIMESTAMP(14)";
$def_tabeli .= "tytul TEXT";
$def_tabeli .= "tresc TEXT ";
$def_tabeli .= "fotka TINYTEXT";
$def_tabeli .= "user TINYTEXT";
$def_tabeli .= "PRIMARY KEY(data)";
mysql_select_db ($nazwabazy);
mysql_query(" Create TABLE $nazwa_tabeli ($def_tabeli)");