hello
i cant insert Data in a Table if the Foreign Key is set to "not null"
the Database structure:
CREATE TABLE `orte` (
`id_orte` int(11) NOT NULL AUTO_INCREMENT,
`ortsname` varchar(50) NOT NULL,
`plz` int(5) DEFAULT '0',
`info` varchar(100) DEFAULT NULL,
PRIMARY KEY (`id_orte`)
CREATE TABLE `personen` (
`id_personen` int(11) NOT NULL AUTO_INCREMENT,
`vorname` varchar(50) DEFAULT NULL,
`nachname` varchar(50) NOT NULL,
`info` varchar(100) DEFAULT NULL,
PRIMARY KEY (`id_personen`)
CREATE TABLE `buchungen` (
`id_buchungen` int(11) NOT NULL AUTO_INCREMENT,
`fk_orte` int(11) NOT NULL,
`fk_personen` int(11) NOT NULL,
`info` varchar(100) DEFAULT NULL,
PRIMARY KEY (`id_buchungen`),
KEY `fk_buchungen_1` (`fk_orte`),
KEY `fk_buchungen_2` (`fk_personen`),
CONSTRAINT `fk_buchungen_1` FOREIGN KEY (`fk_orte`) REFERENCES `orte` (`id_orte`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `fk_buchungen_2` FOREIGN KEY (`fk_personen`) REFERENCES `personen` (`id_personen`) ON DELETE CASCADE ON UPDATE CASCADE
)
Is it set to "DEFAULT NULL" then i can insert Data
CREATE TABLE `buchungen` (
`id_buchungen` int(11) NOT NULL AUTO_INCREMENT,
`fk_orte` int(11) ,
`fk_personen` int(11) ,
`info` varchar(100) DEFAULT NULL,
PRIMARY KEY (`id_buchungen`),
KEY `fk_buchungen_1` (`fk_orte`),
KEY `fk_buchungen_2` (`fk_personen`),
CONSTRAINT `fk_buchungen_1` FOREIGN KEY (`fk_orte`) REFERENCES `orte` (`id_orte`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `fk_buchungen_2` FOREIGN KEY (`fk_personen`) REFERENCES `personen` (`id_personen`) ON DELETE CASCADE ON UPDATE CASCADE
)
i see in the NuBuilder the field "Stop Blanks" but i need the check in the MySQL Database
is there a way ?
thanks
Biertrinker
Welcome to the nuBuilder Forums!
Register and log in to access exclusive forums and content available only to registered users.
Register and log in to access exclusive forums and content available only to registered users.
Requested JSON parse failed on Table with Foreign Key "not n
-
- Posts: 6
- Joined: Wed Jun 29, 2016 8:53 am
Re: Requested JSON parse failed on Table with Foreign Key "n
Biertrinker,
nuBuilder can do all the checking you like using PHP before saving anything..
eg.
Steven
nuBuilder can do all the checking you like using PHP before saving anything..
eg.
Code: Select all
if('#sre_zzzsys_sql#' == '' and '#sre_zzzsys_php_id#' == ''){
$MESS = "SQL or PHP is required to create a Report..";
nuDisplayError($MESS);
}
Steven
You do not have the required permissions to view the files attached to this post.