473,668 Members | 2,373 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Setting up foreign key constraints in phpMyAdmin.

1 New Member
Where is Foreign key in phpmyadmin
Sep 22 '07 #1
4 16322
r035198x
13,262 MVP
Where is Foreign key in phpmyadmin
The question doesn't make much sense like that? If you are getting an error then post the error message you are getting. If you are unclear about some concept then try rephrasing your question.
Sep 22 '07 #2
pbmods
5,821 Recognized Expert Expert
Heya, Surinder.

Changed thread title to better describe the problem (did you know that threads whose titles do not follow the Posting Guidelines actually get FEWER responses?).

phpMyAdmin does not handle foreign keys. To set up foreign key constraints on your InnoDB tables, you need to issue the SQL directly.
Sep 22 '07 #3
samuel123
7 New Member
Dear All ,
This is my first post on this forum and seeking the solution of a problem. Hope, I would certainly get from the forum.


Say, I have got Two tables. Those are..

1. users
Field in users: user_id(pk)

2. commitment
Field in commitment: user_id(fk for commitment table)

A. My question is: How should I set the relation between users and commitment tables in Phpmyadmin?

But I did the relation in commitment table this way but I am not sure of it.
Expand|Select|Wrap|Line Numbers
  1. commitment
  2. ---------------
  3. foreign key(user_id) references users(user_id); 
  4. Is this way that can I show relation between users and commitment ?
Your help would be greately.. praised.


Thank you very much for the help in advance
Samuel
Nov 21 '07 #4
f1codz
1 New Member
I have posted in details the steps required to enable setting foreign keys in phpmyadmin here : http://imdad.wordpress .com/2008/07/24/foreign-key-in-phpmyadmin-xampp/
Jul 24 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

0
2215
by: Rajesh Kapur | last post by:
We use InnoDB tables and foreign key constraints extensively. The mysqldump backs up the database tables in alphabetical order with foreign key constraints defined in the create statement of each table. These foreign key constraints are violated at the time of restore. We have tried the following two solutions... (1) We have tried to backup the database tables in the order of their dependencies. This works but the backup scripts need to...
1
5266
by: Jason Madison | last post by:
We sometimes get very large databases that we want to cut down to use for testing. The information is all related to a central accounts table. The way I thought of doing this is to grab all the foreign constraints and turn them into cascade delete constraints, then delete as many accounts as I want. After this I will restore the constraints back to their original state.
13
3690
by: Bob Stearns | last post by:
Why is the following constraint invalid? I want to make sure that every row in IS3.ANIMALS_PRIV_INDEXES matches one of those in IS3.table_var_defn with part of the primary key fixed. Since this is illegal with the following message, how do I achieve this result? The last thing below is a working constraint from another table. ALTER TABLE IS3.ANIMALS_PRIV_INDEXES ADD CONSTRAINT FOREIGN KEY(3, variable_id) REFERENCES...
0
800
by: Ratman | last post by:
I have this... Public Property MetalID() As Long Get Return lMetalID End Get Set(ByVal Value As Long) lMetalID = Value End Set End Property
1
3300
by: Jim Heavey | last post by:
Hello, I was setting the primary key on a table which was a collection of 3 columns. I mispelled the name of the second column when I built the array of collumns when I created the array of collumns for the primary key. When I used the "dt.primarykey(myArrayOfKeys)" no exception was thrown, and rather then the primary key being a set of 3 columns, it was only a single column. When you make this type of mistake when setting foreign keys,...
8
3522
by: wespvp | last post by:
I am using PostgreSQL 7.4.1 on RedHat 7.2. The query I am executing is something like (I replaced all the return values with 'count'): db=> explain select count(*) from messages m join (select * from message_recipients r join addresses a on a.Address_Key=r.Recipient where a.Address='lra.edi@edi.cma-cgm.com') as foo on (m.Message_Key=foo.Message_Key AND (m.Message_Date >= '29-MAR-04') AND (m.Message_Date <= '31-MAR-04...
11
10139
by: FreeToGolfAndSki | last post by:
Hi, I have an Orders Table that has Employee1 and Employee2 (one is the sales rep the other is the telemarketing rep) Both of these fields need to cascade update against the Employees table. I can't seem to create the desired relationship in a Diagram and I'm not sure how best to set this up. Any ideas? Thanks in advance...
0
2688
by: mrhodes02 | last post by:
I have two simple tables Employees (primary key table) Empid, empname,title MgrXrf (foreign key table) MgrId,Empid MgrID & Empid in MgrXrf have a foreign contstrant to EmpID in Employees. That works fine. I don' want to add a record to MgrXRF unless both field values exist in Employees. Problem is I also want to set the delete rule to cascade on both fields, so that if I delete an employee their record is deleted from MgrXRF no...
1
12058
by: Wes Groleau | last post by:
INSERT INTO X ...... ( A, B, C ) INSERT INTO Y ...... ( J, K, L ) If Y has a foreign key M which is the primary key D of X, is there an easy and/or efficient way to have SQL Server assign D, and tell us what it is so we can add M to the list for Y ? I know I can select D where A, B, C but I wondered about other tricks.
0
8459
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8374
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8890
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8575
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8653
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7398
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5677
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
2018
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1783
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.