You are here: Re: Learning php Sql « PHP SQL « IT news, forums, messages
Re: Learning php Sql

Posted by J.O. Aho on 06/19/06 18:30

Frankly wrote:
> the databases i post to on the internet usually have these fields.
> Fee disclosure.
> posted by
> rent
> bedrooms.
> Posting Title.
> Area
> Comments - i would like to include a map of the intersection.
> posted by email
> dogs.
> cats.
>
> I post different ads to different places. I would like to keep track of
> what I post to where.
> so I am thinking I can ad feilds like this to my apartments table.

*nods*

> i will need to add 10 feilds.

If you think you never will post it at more places than 10, then okey, but you
can also create a new table where you save the apartmentid and the website
where you posted the ad to, this way you can have more places to advertise at
than ten (I hope I didn't misunderstand you here).


> Website, to save space i think i will just make this a Varchar ( 40) there
> is no need for this to be a link.

If you have some frequent places where you post, then the site name may be
enough and 40 would be okey for that (works for short URLs too).


> Posted to - Varchar (20)i sometimes post the same add to more than 1 place
> or sometimes only 1. this one is confusing to me.

Look at what I wrote a bit higher up in this post, if you choose to use the
method I suggested, then you can skip this one. You can of course add more
fields to the table I was thinking about, like date when posted on the site.


> Edit link. Varchar (255)

Not sure what this is, so I can't comment this.


> Date posted. date 0000-00-00

When you do the INSERT of the apartment to the table, instead of writing the
current date as '2006-10-20', you can use the SQL function CURDATE() which
will return the date.

INSERT INTO table(date) VALUES(CURDATE());


> Fee Disclosure. Varchar (70)will need 4 choices. but can put them in by
> hand.
> Posted by - will need choice of 2 of about (30) needs to be Name of agent
> and name of firm.
> Subject - Varchar (70) usually includes a brief discription of apartment
> Comments. Varchar (255) about apartment -
> MyContactinfo - Varchar (255) 2 choices this usually displays in the same
> field as comments. i usually include a bit of html.
> Email-
>
> Email, Posted by, MyContactInfo, I think INT can be used. 0 for me and of
> course my wife can be number 1 :).
> the realy tricky one for me is how can i disply where i posted to.
> can i have something like 4 check boxes each box representing a different
> website?

Yes, you can do that and this can be done in quite many ways, the usual 4
fields where you store 0 (not posted here) or 1 (posted on the website).
You can also use one filed and use a binary way of thinking, one website is 1,
next one is 2, third is 4 and the last is 8, 0 is the same as it's not posted
at any of the websites, if the value is 5, then the site has been posted at
website 1 and 3, but not at 2 and 4. This has the drawback that you need more
PHP code to check up which sites has been posted at.


> if i had no one to ask i would use enum for the FeeDisclosure. lol i would
> have also used that for most of the fields :).
> i guess i could also use INT for fee discloser but i think that is a little
> tricky.
> my choices for fee discloser are - the only thing i can think of is enum or
> INT and have 5 choices.
> No Broker fee.
> Low Broker Fee.
> Broker Fee Negotiable.
> 15% broker fee. < hardly ever used but sometimes her boss wont except less.
> 1 Month Broker Fee.
> all of them include a $40 credit check fee.

Okey, INT(1) could be used here, where each of the options has one value. As I
have said before, I'm not good at ENUM, so I won't say no or yes, but I know
the INT(1) would work fine.


> If i had my own place i would make them all 1 month fee. i think that is
> very reasonable.

Bosses can make a load of troubles :)



//Aho

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация