Jump to content

Search the Community

Showing results for tags 'primary key'.



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

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

Found 2 results

  1. I am constructing a table where it holds a many to many relationship with other 2 tables. This many-to-many table has 2 columns, both of which are foreign keys to 2 other tables. The many-to-many table is called favorites(it is self-explanatory what it does) and the parent tables are called business users and credentials.Here is an image: https://skydrive.live.com/redir?resid=BE27434B2AAC8130!259&authkey=!ADptTU72dh1KYBc&v=3 As I understand, and tell me if I am wrong, none of these 2 columns must be primary key. The reason being that a primary key must be unique in every row, but in a many -to-many table many times values are repeated throughout rows. For example, many orders placed by the same customer(not related with my app). So, am I right saying that none of the columns must be a primary key? In addition, now that I am reconsidering things, maybe a many to many table is not needed, just one-to-many, from credentials to favorites. Since the credentials table holds all the id's of the users of the site.
  2. I am working on a blog for a friend's website. Upon testing the database which holds her blog posts (for security issues and whatnot), and dropping random rows from it, I have noticed that the id field does not re-organize itself. The way I will be displaying her posts (5 per page, with previous and next buttons) depends on the id being in order and with no gaps. Is there any way I can put in a script using PHP or MySQL to organize these in case of a row being removed once the blog goes live? Also, I have noticed that I can put in one entry, drop it, and then when I test another one the id starts back at 2. The only way to get it to start at 1 again that I have seen is going into PHPmyAdmin and emptying the table. Thanks,Mark
×
×
  • Create New...