php - Should I use AI on these fields in MySQL? -


I have this DB below. I wonder how I should use the ID to identify each record. Everything is linked to classified_table ! Two questions:

Should I use AI on every PK in this case?

Can someone give me complete code to choose the whole classified only from a ad_id (for example "bmw_330ci_8939483")?

I'm new to normalized DB and working on a good database, so detailed instructions are highly appreciated ... Besides, if you have any 'incorrect' please tell me in this DB. Table: value_id (PK) option_id (FK) value classified table: classified_id (pk) ) Ad_id (VARCHAR) will be displayed in some "BMW 330C_28238239832" such as URL Poster_ID (FK) Cat_ID headline details of price_ID (FK) etc. Poster table: Poster_ID (PK) Name Email Telephone Password field table Regional area (pk) q Thir Community

Thanks

I have auto-input on those fields (AI), which I want to make the majority of search by Uld makes it easy to return the result, but there are performance issues where it can slow down the database.

Regardless of the query, I do not know at all what you want to return, but this query returns returned from the ad_id

  classified_id Select an ad from classified ad_id = "bmw_330ci_8939483"  

your classified table and the column advertising ID classified_change_dynamic To insert Audi A4 :

  INSERT classifieds_table ad_id values ​​"audi_a4"  

or by using the same table One time Insertion, multiple fields, and multiple values:

  classified_table in INSERT (Ad_id, poster_id) VALUES ("audi_a4", 10)  

Code> classified_id because if you select auto-increment then it will automatically specify the value without specifying it explicitly.

Look for more tutorials / P>


Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -