Page 1 of 1
how can i create foreign key using qry?
Posted: Tue Aug 02, 2005 1:52 am
by itsmani1
Code: Select all
mysql_query("
create table jobs (
jobid int(11) not null default '0',
jobtitle varchar(255) not null,
sdate date,
edate date not null default '0000-00-00',
experience varchar(255),
salary int(11),
`status` varchar(10) not null,
primary key (jobid))
type=MyISAM comment="";") or die(mysql_error());
in this way i wanted to create a foreign key in a table which will handel and manage thing ...
can i do so?
SQL alter table.
Posted: Tue Aug 02, 2005 2:07 am
by AnarKy
Hi,
Use the ALTER TABLE SQL statement to add a foreign key.
Code: Select all
ALTER TABLE tbl_name ADD [CONSTRAINT symbol] FOREIGN KEY [index_name] (index_col_name,...)
Re: SQL alter table.
Posted: Tue Aug 02, 2005 7:01 am
by itsmani1
AnarKy wrote:Hi,
Use the ALTER TABLE SQL statement to add a foreign key.
Code: Select all
ALTER TABLE tbl_name ADD [CONSTRAINT symbol] FOREIGN KEY [index_name] (index_col_name,...)
can u plz. tell me what is [index_name] and [index_col_name]
i have one more question.
i never used @ sign in php and today i say this code which is using @ sign
can any one explain this to me.
Code: Select all
<?php
/* Intentional file error */
$my_file = @file('non_existent_file') or
die ("Failed opening file: error was '$php_errormsg'");
// this works for any expression, not just functions:
$value = @$cache[$key];
// will not issue a notice if the index $key doesn't exist.
?>
Thanx