473,385 Members | 1,320 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

mysql: Get foreign keys

Dear reader,
there is a function to get the foreign keys of a table??

i have this function to get all table infos:
$fields = mysql_list_fields($V['db']['name'],$table) or die
(mysql_error());
$columnsCount= mysql_num_fields($fields) or die (mysql_error());
for ($i = 0; $i < $columnsCount; $i++) {

$columns[$i]['name']=mysql_field_name($fields, $i) ;
$columns[$i]['length']=mysql_field_len($fields, $i) ;
$columns[$i]['type']=mysql_field_type($fields, $i) ;
$columns[$i]['flags']=mysql_field_flags($fields, $i);
}

but i need alo to know info about foreign keys.
is it possible?
thanks,
simone giacco

Apr 19 '06 #1
1 1781
AFAIK - No, there isn't.

Apr 20 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Andrew Kuebler | last post by:
When I type: Show keys from ; I do not see foreign keys listed there and I cannot seem to find any command that will list foreign keys. Can anyone help? Also, I notice Innodb tables only...
0
by: Kevin Holmes | last post by:
Sorry about the level of knowledge in this post but I'm not understanding how MySQL handles Foreign Keys. The CREATE DATABASE statement has allocation of a Foreign Key through the FOREIGN KEY ...
2
by: Jeff Silverman | last post by:
I am working on my first database and I think I want to build a table with a foreign key in it. The O'Reilly book on MySQL says that MySQL does not support foreign keys, but it still talks about...
1
by: Vinodh Kumar P | last post by:
I understand the number of foreign keys allowed is restricted by the DBMS I use. In a general relational schema design perspective how many foreign keys a table shall have? If I have large number...
5
by: clops | last post by:
Dear Collegues, can anyone explain me WHY the following set of instructions does not spit any errors (MySQL 5.017) -- the second insert should not have worked as it references a non-existing...
1
by: Giulio Simeone | last post by:
Hello, when I try to insert a new record in a certain table I get the error Cannot add or update a child row: a foreign key constraint fails The table has three foreign keys and six other...
3
by: pplers | last post by:
As the tittle says, i would like to know if MySQL supports foreign keys in MyISAM tables. If so, how can it be done ???
0
by: nustapha | last post by:
Hi, I can see foreign keys in the information schema db in mysql but there is no information about 'on delete cascade' or 'on update...'. How can I get all information about foreign keys?
2
JnrJnr
by: JnrJnr | last post by:
I have two SQL database tables. One contains various products(with unique primary keys) and the other contains information related to the products aswel as the product's foreign keys. What I want...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.