Welcome Guest, Not a member yet? Register   Sign In
Question about Database
#11

[eluser]mTuran[/eluser]
I will code basic algortihm for "CSS" & "Cascading Style Sheets". Maybe i will handle and add "CSS" search term to "Cascading Style Sheets" and i will search for both of keywords, i have to write little big keyword database for this and i am planning to use categories + tag system together. Do you have another any suggestion for my logic ? Thank you
#12

[eluser]jedd[/eluser]
Yes, I have some suggestions.

a) tag not tags - second table name (above)
b) name not tag - column within that table (")
c) _id only ever used to point to FK's
d) dump your current database schema
#13

[eluser]slowgary[/eluser]
Yes,

Don't spend your time writing code to find similarities between keywords, if possible. If your keywords will be those used in the IT industry, just put a list of them in your database and be done with it. Go to Dice.com or something and look at what they have as an example. If you hardcode something to search for "Cascading Style Sheets" when a user selects "CSS", you'll need to hardcode some logic for every other skill that goes by multiple names, like "Copy Editing", "Writing", "Content Creation".
#14

[eluser]mTuran[/eluser]
[quote author="jedd" date="1245683438"]Yes, I have some suggestions.

a) tag not tags - second table name (above)
b) name not tag - column within that table (")
c) _id only ever used to point to FK's
d) dump your current database schema[/quote]

a) what is purpose of using "tag" instead of "tags" ?
b) i didn't understand ?
c) What is FK ? (if you mean foreign key, i have already point to user_id)
d) database schema not ready now, i will done it in soon and dump.

Thanks.

@slowgary
I have a look to dice.com but they haven't any system for "CSS" and "Cascading Style Sheets". When you typing Cascading Style Sheets, you can found CSS jobs because employers write both of keywords to description.
#15

[eluser]Daniel Moore[/eluser]
[quote author="mTuran" date="1245573632"]I have 2 table for my users. One of "experts" another of "employer", each table have unique ids. in this point i want to give unique id experts and employers same time. For example if last created expert id is 5 then next created employer will be 6 that is which i want. I am waitting your solutions thanks.[/quote]

Ok, if you really want to do it in this manner, there is actually a very simple solution to your problem here.

1. Create a 3rd table, call it "unique_id".
2. Have one field in this table, and have that field be autoincrement.
3. When you create either a new "employer" or "expert", first add an entry to the "unique_id" table, read the last entry, and use that as your "unique_id" for the "employer" or "expert".

It's not that complicated. Really.

Alternatively, if you don't want 50,000 entries or more eventually in your "unique_id" table, then only keep one entry in the table, that of the last used ID. Have your program increment it, and save it back to the table, and use it for your "employer" or "expert".

It's really no different from a site counter, if you think about it, and is just as easy to implement.
#16

[eluser]jedd[/eluser]
Quote:a) what is purpose of using "tag" instead of "tags" ?

Singular makes more sense to me, but consistency is probably sufficient. Your other table, and your FK in that table to the tag(s) table, are all singular. So - retain your consistency by renaming tags to tag.

Quote:b) i didn't understand ?

We have so many words to choose from, all of them laden with meaning, and beautifully designed to remove ambiguity.

And yet you're about to have a column called tag.tag. I am suggesting that you do not do this.




Theme © iAndrew 2016 - Forum software by © MyBB