473,387 Members | 1,569 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,387 software developers and data experts.

Problem setting foreign key using phpmyadmin

I currently have two tables: tblCustomer and tblOrders.
In tblCustomer I have a field CustomerID that was set with the SERIAL datatype and set as PRIMARY. In tblOrders I have the fields OrderID that was set with the SERIAL datatype and set as PRIMARY. I also have a field called CustomerID with the BIGINT(20) datatype. I am trying to create a foreign key on tblOrders.CustomerID to relate back to tblCustomer.CustomerID. All the data is InnoDB.
Expand|Select|Wrap|Line Numbers
  1. ALTER TABLE  `tblOrders` ADD FOREIGN KEY (  `CustomerID` ) REFERENCES  `Sample`.`tblCustomer` (
  2. `CustomerID`
  3. ) ON DELETE CASCADE ON UPDATE CASCADE ;
I get an error of check datatypes. I'm not sure what I am doing wrong. Any Ideas?
Jan 13 '12 #1
1 3747
SOLVED

tblOrders.CustomerID was not set with the unsigned attribute as tblCustomer.CustomerID was.
Jan 13 '12 #2

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

Similar topics

2
by: Kamlesh | last post by:
Hi, I am using SQL Server 7.0 TABLE1 ====== Fld1 Fld2 Fld3
2
by: jaks | last post by:
How can I export a MySQL table with a different name using phpmyadmin? I want to export nuke_bbsearch_wordmatch and all it contents to phpbb_search_wordmatch This table in a different db. ...
0
by: Martin Bischoff | last post by:
Hi, I have a problem setting the style of a calendar control using style sheets. Example: I have set the calendar control's property TodayDayStyle-CssClass to "today". In my .css I have: ...
2
by: Greg | last post by:
Please note: I have cross posted this from Newsgroup: microsoft.public.dotnet.framework.aspnet.webservices with a few minor changes... I am having a simple problem setting up the security on my...
0
by: cty | last post by:
Title: Problem in session using php5 Good day, I use php5+mySQL4+IIS5.x Previuosly i use php4 and no error occur,
1
by: Astlik | last post by:
Hi, I was using phpmyadmin when, by mistake I deleted some rows from a table I didn't wanted to. I would like to know if anyone could help me recovering those records I deleted. I don't have any...
4
by: booker | last post by:
Hello, I have a problem with foreign key. What I want to do is , have one foreign key referencing in two different tables! I have created three tables: create table University( ...
6
by: AshleyB | last post by:
2 phpbb boards I run have been hacked. One I've restored but the other one has had some damage to the MySQL db. A table is missing. As it's a styles table I thought I could could copy a table,...
3
MusoFreak200
by: MusoFreak200 | last post by:
hi again everyone i need help in setting up (using html) a username/password for a webpage if anyone could help me please i would be greatful. thanks cya MusoFreak200
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.