Welcome Guest, Not a member yet? Register   Sign In
Scaffolding and Foreign Key , please
#1

[eluser]Unknown[/eluser]
Hi men.

The first thing , I love Code Igniter Smile
In an application that I am doing, I'm using foreign keys (MySQL innoDB)

This possible library Scaffolding work a with Foreign keys ?
Why not work for me at the time of insertion and edit.

PD: C.I 1.6
PD: Sorry if something similar already been posted.

a "sample" db

Code:
CREATE TABLE `cliente` (
  `id_cliente` int(11) NOT NULL default '0',
  `nombre` varchar(30) default NULL,
  PRIMARY KEY  (`id_cliente`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

INSERT INTO `cliente` VALUES (1, 'pepe');

CREATE TABLE `venta` (
  `id_factura` int(11) NOT NULL default '0',
  `id_cliente` int(11) NOT NULL default '0',
  `cantidad` int(11) default NULL,
  PRIMARY KEY  (`id_factura`),
  KEY `id_cliente` (`id_cliente`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

ALTER TABLE `venta`
  ADD CONSTRAINT `venta_ibfk_1` FOREIGN KEY (`id_cliente`) REFERENCES `cliente` (`id_cliente`);

INSERT INTO `venta` VALUES (1, 1, 200);

Bye


Messages In This Thread
Scaffolding and Foreign Key , please - by El Forum - 09-03-2008, 11:54 PM
Scaffolding and Foreign Key , please - by El Forum - 09-06-2008, 05:58 PM



Theme © iAndrew 2016 - Forum software by © MyBB