Welcome Guest, Not a member yet? Register   Sign In
it's a foreign key?
#6

[eluser]gtech[/eluser]
try
Code:
$query="SELECT column_key FROM information_schema.columns
WHERE table_schema='custandusers' AND table_name='users' AND column_name='customerid'";

$foreign=$this->db->query($query);
// add this line below to your code.
print_r($foreign->result_array());

I get
Code:
Array ( [0] => Array ( [column_key] => MUL ) )


or

Code:
...
$foreign=$this->db->query($query);
$foreign=$foreign->row_array();
$type=$foreign['column_key'];
echo $type;


Messages In This Thread
it's a foreign key? - by El Forum - 04-18-2008, 09:08 AM
it's a foreign key? - by El Forum - 04-18-2008, 09:16 AM
it's a foreign key? - by El Forum - 04-18-2008, 09:36 AM
it's a foreign key? - by El Forum - 04-20-2008, 06:30 AM
it's a foreign key? - by El Forum - 04-20-2008, 03:51 PM
it's a foreign key? - by El Forum - 04-20-2008, 03:52 PM
it's a foreign key? - by El Forum - 04-21-2008, 06:53 AM



Theme © iAndrew 2016 - Forum software by © MyBB