CodeIgniter Forums
Scaffolding and Foreign Key , please - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Scaffolding and Foreign Key , please (/showthread.php?tid=11322)



Scaffolding and Foreign Key , please - El Forum - 09-03-2008

[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


Scaffolding and Foreign Key , please - El Forum - 09-06-2008

[eluser]Unknown[/eluser]
Please Helpme.

Let me know if I set the scalafolding for linking fields with tables
[Image: dudaci.png]