Jump to content

Search the Community

Showing results for tags 'insert primary key foregin key normal database'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • HTML/XHTML
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • XSLT/XSL-FO
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Calendars

  • Community Calendar

Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

Found 1 result

  1. Well..this cant be right

    Hi. im almost sure im doing something terribly wrong... here goes: i have 2 tables, one for Customer (ID(primary)address,phone...etc..) and one for Order (OrderNumber(primary), order info, date of the order....etc) (both primary auto inc) both have foreign keys which point to the other tables primary key.. Now, when a new order is being made, i insert data to the Order table.... after that i need to insert data to the customer table... So... when i insert data to the order table, i cannot insert data to the foreign key column since i do not know what will be the data inside the primary key column of the customer table. so, now the primary key data in a variable, and go to the customer table and insert the data of the customer and in the foreign key i spit out what was in the variable i saved earlier, after i run the sql command line i can see the id key that have been issued so i save that in a variable. so i have to go back to the order table and insert the data in the foreign key there and NOW i have data in the 2 tables which is connected thru the foreign keys. this MUST be wrong there's no way im doing it right... right?
×