Tak wyglada tabela:
CREATE TABLE `wpm` (
`id` int(6) NOT NULL default '0',
`nazwa` varchar(30) NOT NULL default '',
`telefon` varchar(20) default NULL,
`adres` varchar(80) NOT NULL default '',
`mail` varchar(30) default NULL,
`branza` varchar(20) NOT NULL default '',
UNIQUE KEY `id` (`id`)
) TYPE=MyISAM;
Przy zapytaniu:
<?php
$query=\"INSERT INTO `wpm` VALUES($wynik_id, '$nazwa', '$telefon', '$adres', '$mail', '$branza')\";
?>
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 11
Przy zapytaniu:
<?php
$query=\"INSERT INTO `wpm` VALUES('$wynik_id', '$nazwa', '$telefon', '$adres', '$mail', '$branza')\";
?>
Laduje do bazy tylko id
Tak wyglada caly kodzik:
<?php
}
$pobranie_id=\"SELECT MAX(id) FROM `wpm`\";
print(\"wynik id: $wynik_id\"); $query=\"INSERT INTO `wpm` VALUES('$wynik_id', '$nazwa', '$telefon', '$adres', '$mail', '$branza')\";
if($wynik==-1){
echo(\"Error: $phperrmsgn\"); }
?>