Learning php Sql
am 21.04.2006 17:38:10 von Frankly
Sorry if this is the wrong place to ask this question.
I am trying to build a mysql database using phpmyadmin for my wife.
the database is going to hold information on real estate with pictures.
I would like people to come to the web site and beable to do searches via
drop down menu's and have the results show show on the page. do i need a
product like ColdFusion MX 7?
I am running windows xp home.
1 gig ram
DreamWeaver 8
phpmyadmin.
I am not very good with computers but have taught myself to create simple
databases in Access and have used front page and DreamWeaver. I would realy
like to do this for her. i think it will make her job much easier.
thank you
Re: Learning php Sql
am 21.04.2006 17:58:53 von Shion
Frankly wrote:
> Sorry if this is the wrong place to ask this question.
>
>
> I am trying to build a mysql database using phpmyadmin for my wife.
>
> the database is going to hold information on real estate with pictures.
>
> I would like people to come to the web site and beable to do searches via
> drop down menu's and have the results show show on the page. do i need a
> product like ColdFusion MX 7?
No, you don't need that, if you want an IDE, then you can make a search at
freshmeat.net for projects working on such, most of them are opensource.
> DreamWeaver 8
If you want your HTML/CSS to wotk on most browsers, do validate your pages
against the w3c validators.
validator.w3.org
jigsaw.w3.org/css-validator
//Aho
Re: Learning php Sql
am 21.04.2006 21:12:31 von zac.carey
Also take a look at xampp. As long as you follow the installation
instructions very carefully, it should get you started. It also
includes phpmyadmin - an invaluable tool IMO.
Re: Learning php Sql
am 21.04.2006 22:36:14 von Frankly
"strawberry" wrote in message
news:1145646751.883922.193210@z34g2000cwc.googlegroups.com.. .
> Also take a look at xampp. As long as you follow the installation
> instructions very carefully, it should get you started. It also
> includes phpmyadmin - an invaluable tool IMO.
>
Thank you both for your replies.
I just looked at xampp. my hosting package includes.. phpmyadmin and mysql.
is xampp something that i will also need? and need to learn? why did i ever
leave front page :).
Re: Learning php Sql
am 22.04.2006 01:49:26 von zac.carey
Probably not - if, as you say, your hosting package does it all. For
myself, I like to develop and host some pages locally. This means
setting up my PC as though it were a web server, and that's where xampp
comes in.
I'd give you a more technical explanation of the respective roles of
the apache server, mysql engine, and php scripting if I could but all I
really know is that if I chuck it all on my machine and give it a good
stir it all seems to work.
I think all you need for your purposes is the ability to create and
interrogate databases (so mysql, as provided by your service provider),
and the ability to display (and interactively modify) the results (PHP,
again as provided). And you also need to be able to construct the PHP
pages themselves. You could probably splash out on something like
ColdFusion but I doubt it's necessary. I just use a good text editor -
better than notepad (and not Word) - and massive recourse to a well
known search engine.
Phpmyadmin provides a friendly way to view, manage and manipulate
databases - including some assistance in the construction of queries,
and (most importantly) the ability to test your queries. Programmes
like Navicat also provide friendly interfaces for the direct
manipulation of the raw data. Navicat's very clever, but I don't
actually find much use for it. So, IMO textpad (or similar), coupled
with your ISP's phpmyadmin-integrated set-up, and regular trawling of
newsgroups and tutorials should suffice. Oh, and a couple of books
doesn't hurt!
Most importantly, don't lose sight of why you went down this road in
the first place - to make life easier for everyone. These are great
tools but if the solution starts looking more arduous than the problem
itself... well, you have been warned!!!
Good luck!
Re: Learning php Sql
am 22.04.2006 04:29:35 von Frankly
"strawberry" wrote in message
news:1145663366.202380.164450@z34g2000cwc.googlegroups.com.. .
> Good luck!
>
Thank you for the great post strawberry. right now the biggest problem i am
having is not knowing what to do next.
do I learn mysql?
do i stick with access? even tho all i ever did was build simple tables.
learn php and html?
most importantly can i do this.
I have been reading lots on the subject but have lacked the ability to
actually ask questions.
the busy season is here and i really wanted to start building the database
and beable to show the changes on my web site. I have gotten very good at
finding properties and I have updates everyday.
i walked over to barnes and noble today to see these books in person.
Mastering phpmyadmin for effective MySQL Management was 1 book I wanted to
buy.. not in stock :(.
another was PHP and MySQL for Dynamic Web Sites: Visual Quickpro Guide.
dreamweaver 8 the bible.
Macromedia Dreamweaver 8 with ASP, ColdFusion, and PHP: training from the
Source.
what worries me most is not knowing if these books expect me to know any
kind of programming.
i think the first thing i should learn is MySQL with phpMyadmin. seems
pretty easy to create a simple table but i get worried that i wont know how
to create a relational database. for example if create a table for
buildings and another for apartments how do i relate them togethe? i guess
this is the wrong group for those questions. i have attempted to do that in
access with out luck and wonder just how hard it can be in something like
MySQL.
i have worked on databases like i want to create. start off by adding a new
building into a table and then in another table or form ( or what ever ) i
would start adding in information about a new apartment and pick the
building from a drop down menu and once i picked that it would also bring in
other fields from the buildings table, zip code, sub area, build info. also
yes know feilds or check box fields for pets, elevator, out door space,
doorman and so on. to top it all off today was my birthday and all i did
was rack my brains out. thank you so much for your help. even just talking
about it or knowing there is someone i can ask as i learn.
Thank you again.
Frank
Re: Learning php Sql
am 22.04.2006 07:06:59 von Shion
Frankly wrote:
> "strawberry" wrote in message
> news:1145663366.202380.164450@z34g2000cwc.googlegroups.com.. .
>> Good luck!
>>
>
> Thank you for the great post strawberry. right now the biggest problem i am
> having is not knowing what to do next.
>
> do I learn mysql?
SQL can be quite good to know, you have the online manual that can be a useful
tool
http://www.mysql.com/search/?q=&x=5&y=2&doc=1&m=0
> do i stick with access? even tho all i ever did was build simple tables.
It's not as good and fast as a real SQL server and MS-Access forces you to use
a MS-win based server and you never know if this will be the case, better use
something that works on as many platforms as possible.
> learn php and html?
IMHO PHP is simpler than html and you have the great online documentation too
http://www.php.net/manual-lookup.php?lang=en&function=&x=11& y=7
http://www.php.net/manual/en/reserved.variables.php
> most importantly can i do this.
Hey, I have, so why wouldn't you?
> I have been reading lots on the subject but have lacked the ability to
> actually ask questions.
> the busy season is here and i really wanted to start building the database
> and beable to show the changes on my web site. I have gotten very good at
> finding properties and I have updates everyday.
> i walked over to barnes and noble today to see these books in person.
> Mastering phpmyadmin for effective MySQL Management was 1 book I wanted to
> buy.. not in stock :(.
Check Amazon.com, has quite a lot of books and you have the option to buy used
ones too, in case the book in question aren't anymore sold at Amazon.
> what worries me most is not knowing if these books expect me to know any
> kind of programming.
That you need to check on the forewords from the author or the text on the
backside.
> i think the first thing i should learn is MySQL with phpMyadmin. seems
> pretty easy to create a simple table but i get worried that i wont know how
> to create a relational database. for example if create a table for
> buildings and another for apartments how do i relate them togethe?
There is a SQL function called JOIN that you can join tables with each other,
and you can always make more than one query to get what you need.
I do think the best can be to start with pen and paper and draw your tables
and what they will have common and what they will relate to.
It's a lot easier to build the database after you have figured it all out.
i guess
> this is the wrong group for those questions. i have attempted to do that in
> access with out luck and wonder just how hard it can be in something like
> MySQL.
>
> i have worked on databases like i want to create. start off by adding a new
> building into a table and then in another table or form ( or what ever ) i
> would start adding in information about a new apartment and pick the
> building from a drop down menu and once i picked that it would also bring in
> other fields from the buildings table, zip code, sub area, build info. also
> yes know feilds or check box fields for pets, elevator, out door space,
> doorman and so on.
It's somewhat simple, you could make all this with just 3 pages/scripts,
putting in some security you will increase the number up to maybe 5.
> to top it all off today was my birthday and all i did
> was rack my brains out.
Happy Birthday.
//Aho
Re: Learning php Sql
am 22.04.2006 18:22:46 von Frankly
"J.O. Aho" wrote in message
news:4atrvkFu871aU1@individual.net...
>
> Happy Birthday.
>
>
>
> //Aho
thank you J.O.
I think maybe I just better make a very simple web site. Maybe on my
apartments page I should just show the apartments in price order.
dont get me wrong I love trying to figure this stuff out. I love a
challenge I just dont know if i have enough hours in the day to be updating
all these properties and learn what i need to.
I will work on the data base today and perhaps just use a Yes/No system.
i know there are places that would create this site for me. i just dont
have the money right now.
thank you everyone. it is nice to know there is a place where i can ask
questions about what i read.
Frank
Re: Learning php Sql
am 22.04.2006 19:23:13 von Shion
Frankly wrote:
> I think maybe I just better make a very simple web site. Maybe on my
> apartments page I should just show the apartments in price order.
If you manage to get the database to spit out the houses/apartments in price
order, then you can easily sort them by other criteria too.
SELECT * FROM house_table WHERE house_type='apartment' ORDER BY house_price
SELECT * FROM house_table WHERE house_price<300000 ORDER BY house_area
All you need to do is some if-statements in php that detects what the user
wants to know and you make the SQL query after that. It's not that difficult
if you know how to use if-statements (they work quite the same in most of
programming languages).
> dont get me wrong I love trying to figure this stuff out. I love a
> challenge I just dont know if i have enough hours in the day to be updating
> all these properties and learn what i need to.
If you make a "input" page where your wife can insert a new object and another
"edit" page where she can change data for each object with the option to
delete them (don't think she needs them after the house got sold) and lastly a
"search" and "display" page, so that people can search for objects they may
want to buy, you will have managed to make yourself unneeded. In hours I think
this would take maybe 8h if you feel somewhat sure on your skills (no need to
be an expert).
> thank you everyone. it is nice to know there is a place where i can ask
> questions about what i read.
Good luck Frank and if there is something, just write a post here.
//Aho
Re: Learning php Sql
am 22.04.2006 19:53:01 von Frankly
"J.O. Aho" wrote in message
news:4av742Fu2a18U1@individual.net...
> Frankly wrote:
>
>> I think maybe I just better make a very simple web site. Maybe on my
>> apartments page I should just show the apartments in price order.
>
> If you manage to get the database to spit out the houses/apartments in
> price order, then you can easily sort them by other criteria too.
>
> SELECT * FROM house_table WHERE house_type='apartment' ORDER BY
> house_price
>
> SELECT * FROM house_table WHERE house_price<300000 ORDER BY house_area
>
> All you need to do is some if-statements in php that detects what the user
> wants to know and you make the SQL query after that. It's not that
> difficult if you know how to use if-statements (they work quite the same
> in most of programming languages).
>
>
>> dont get me wrong I love trying to figure this stuff out. I love a
>> challenge I just dont know if i have enough hours in the day to be
>> updating all these properties and learn what i need to.
>
> If you make a "input" page where your wife can insert a new object and
> another "edit" page where she can change data for each object with the
> option to delete them (don't think she needs them after the house got
> sold) and lastly a "search" and "display" page, so that people can search
> for objects they may want to buy, you will have managed to make yourself
> unneeded. In hours I think this would take maybe 8h if you feel somewhat
> sure on your skills (no need to be an expert).
>
>
>> thank you everyone. it is nice to know there is a place where i can ask
>> questions about what i read.
>
> Good luck Frank and if there is something, just write a post here.
>
>
> //Aho
ok. I am going to do this. I know it is not going to be easy, it is
something that needs to be done.
I can not tell you how nice it feels to be able to talk to you people about
this.
We live in a big city and deal mostly with multi family homes. some
buildings are taller than 20 stories.
as soon as 1 apartment is no longer available another just like it will pop
up. i am not worried about not being needed. infact it would be like
leaving my wife some life insurance if i can do that for her.
however I am still alive and my wife is out there in the rain right now
showing apartments.
i create and put up ads all day long and on the side trying to learn this
much needed stuff.
I am going to create my 2 tables today and i hope you here wont mind letting
me post what I am doing.
thank you all again.
Frank
Re: Learning php Sql
am 22.04.2006 20:44:00 von zac.carey
Frank,
Sure, go ahead and create the tables - see how easy it really is! But
before you go entering ALL the data into this database, get out a pen
and several large sheets of paper and try to make a diagram of the
database. Think about the relationships that the tables have to each
other and the ways in which users will want to look at the information,
and read up a bit on normalisation. I suspect that you're going to find
it more useful to create slightly more than two tables!
FWIW, I started out with Mannish Sharma's tutorial over at
http://www.webdevelopersnotes.com. It's covered in google ads now
(which slightly impede legibility), but it was a good introduction. I
also used Janet Valade's PHP & MySQL for Dummies. I think she could
have covered security in more detail but otherwise it was, also, a very
useful starting point.
Oh, and happy birthday (belated)
Re: Learning php Sql
am 22.04.2006 21:14:31 von Frankly
"strawberry" wrote in message
news:1145731440.418447.215070@e56g2000cwe.googlegroups.com.. .
> Frank,
>
> Sure, go ahead and create the tables - see how easy it really is! But
> before you go entering ALL the data into this database, get out a pen
> and several large sheets of paper and try to make a diagram of the
> database. Think about the relationships that the tables have to each
> other and the ways in which users will want to look at the information,
> and read up a bit on normalisation. I suspect that you're going to find
> it more useful to create slightly more than two tables!
>
> FWIW, I started out with Mannish Sharma's tutorial over at
> http://www.webdevelopersnotes.com. It's covered in google ads now
> (which slightly impede legibility), but it was a good introduction. I
> also used Janet Valade's PHP & MySQL for Dummies. I think she could
> have covered security in more detail but otherwise it was, also, a very
> useful starting point.
>
> Oh, and happy birthday (belated)
thank you Stawberry:
i am still reading and looking and actually just attempted to create my
first script.
Well it was in a tutorial i was reading and wanted to badly to get the " can
i do this " behind me.
I wrote it myself and it did not work - i even copied and pasted it into
dreamweaver 8 and it sill did not work. i was wondering if you can find
anything wrong with it. and thank you for making me feel. like i can
actually learn this. i was just afraid and am still that what i am trying
to do might be a bit like trying to do algebra and not knowing how to count.
$myvar = "Hello World";
echo $myvar;
?>
thank you
Re: Learning php Sql
am 22.04.2006 21:14:31 von Frankly
"strawberry" wrote in message
news:1145731440.418447.215070@e56g2000cwe.googlegroups.com.. .
> Frank,
>
> Sure, go ahead and create the tables - see how easy it really is! But
> before you go entering ALL the data into this database, get out a pen
> and several large sheets of paper and try to make a diagram of the
> database. Think about the relationships that the tables have to each
> other and the ways in which users will want to look at the information,
> and read up a bit on normalisation. I suspect that you're going to find
> it more useful to create slightly more than two tables!
>
> FWIW, I started out with Mannish Sharma's tutorial over at
> http://www.webdevelopersnotes.com. It's covered in google ads now
> (which slightly impede legibility), but it was a good introduction. I
> also used Janet Valade's PHP & MySQL for Dummies. I think she could
> have covered security in more detail but otherwise it was, also, a very
> useful starting point.
>
> Oh, and happy birthday (belated)
thank you Stawberry:
i am still reading and looking and actually just attempted to create my
first script.
Well it was in a tutorial i was reading and wanted to badly to get the " can
i do this " behind me.
I wrote it myself and it did not work - i even copied and pasted it into
dreamweaver 8 and it sill did not work. i was wondering if you can find
anything wrong with it. and thank you for making me feel. like i can
actually learn this. i was just afraid and am still that what i am trying
to do might be a bit like trying to do algebra and not knowing how to count.
$myvar = "Hello World";
echo $myvar;
?>
thank you
Re: Learning php Sql
am 22.04.2006 21:20:11 von zac.carey
This file is called something like "hello.php" right? In that case it
should work!
Re: Learning php Sql
am 22.04.2006 21:37:36 von Frankly
"strawberry" wrote in message
news:1145733611.425300.56640@e56g2000cwe.googlegroups.com...
> This file is called something like "hello.php" right? In that case it
> should work!
>
I did rename it to what you wrote above.. still nothing. just a blank page.
Re: Learning php Sql
am 22.04.2006 22:10:24 von Alan Cole
In article <4Cv2g.234$_e.146@trndny08>, "Frankly"
wrote:
> "strawberry" wrote in message
> news:1145733611.425300.56640@e56g2000cwe.googlegroups.com...
> > This file is called something like "hello.php" right? In that case it
> > should work!
> >
>
> I did rename it to what you wrote above.. still nothing. just a blank page.
And you are trying to access it from a server that has PHP running on it?
Al.
--
Alan Cole. E-mail: justal at lineone dot net
http://www.forces-of-nature.co.uk [Coastal Sports]
http://www.pixelwave.co.uk [Website Design, hosting and promotion]
Re: Learning php Sql
am 22.04.2006 23:29:33 von Frankly
"Alan Cole" wrote in message
news:justal-24E25C.21102422042006@nntp-readers.plus.net...
> In article <4Cv2g.234$_e.146@trndny08>, "Frankly"
> wrote:
>
>> "strawberry" wrote in message
>> news:1145733611.425300.56640@e56g2000cwe.googlegroups.com...
>> > This file is called something like "hello.php" right? In that case it
>> > should work!
>> >
>>
>> I did rename it to what you wrote above.. still nothing. just a blank
>> page.
>
> And you are trying to access it from a server that has PHP running on it?
>
> Al.
i figured it was. i have been working with phpmyadmin... I guess that does
not mean php is actually running on my site.. hmmm. i am going to try the
live chat thing they have.
Re: Learning php Sql
am 22.04.2006 23:50:55 von Frankly
"Alan Cole" wrote in message
news:justal-24E25C.21102422042006@nntp-readers.plus.net...
> In article <4Cv2g.234$_e.146@trndny08>, "Frankly"
> wrote:
>
>> "strawberry" wrote in message
>> news:1145733611.425300.56640@e56g2000cwe.googlegroups.com...
>> > This file is called something like "hello.php" right? In that case it
>> > should work!
>> >
>>
>> I did rename it to what you wrote above.. still nothing. just a blank
>> page.
>
> And you are trying to access it from a server that has PHP running on it?
>
> Al.
it is working now.. the tech support chat guy told me that i used the code
wrong.
I used html and php code together I need to use only php and not html.
Re: Learning php Sql
am 23.04.2006 00:53:14 von Mick White
Frankly wrote:
>
>
> it is working now.. the tech support chat guy told me that i used the code
> wrong.
> I used html and php code together I need to use only php and not html.
>
>
Nonsense.
Mick
Re: Learning php Sql
am 23.04.2006 01:04:07 von Shion
Frankly wrote:
> it is working now.. the tech support chat guy told me that i used the code
> wrong.
> I used html and php code together I need to use only php and not html.
As "mike white" wrote, thats pure nonsense, you get a lot cleaner code to read
if you use both HTML and PHP in you php scripts
--- test1.php: only php ---
echo "\n
\nTest1\n\n\n";
$myvar = "Hello World";
echo $myvar;
echo "";
?>
--- eof ---
--- test2.php: both html and php ---
Test2
$myvar = "Hello World";
echo $myvar;
?>
--- eof ---
It's not that much code/html, but already here you can see that the test2.php
is a lot easier to read than test1.php. Just keep your HTML code as proper as
possible, even on your test pages.
//Aho
Re: Learning php Sql
am 23.04.2006 01:43:28 von Frankly
"J.O. Aho" wrote in message
news:4avr38Fv88f3U1@individual.net...
> Frankly wrote:
>
>> it is working now.. the tech support chat guy told me that i used the
>> code wrong.
>> I used html and php code together I need to use only php and not html.
>
> As "mike white" wrote, thats pure nonsense, you get a lot cleaner code to
> read if you use both HTML and PHP in you php scripts
>
>
> --- test1.php: only php ---
>
> echo "\n\nTest1\n\n
> text=\"green\">\n";
> $myvar = "Hello World";
> echo $myvar;
> echo "";
> ?>
> --- eof ---
>
>
> --- test2.php: both html and php ---
>
>
> Test2
>
>
>
> $myvar = "Hello World";
> echo $myvar;
> ?>
>
>
> --- eof ---
>
> It's not that much code/html, but already here you can see that the
> test2.php is a lot easier to read than test1.php. Just keep your HTML code
> as proper as possible, even on your test pages.
>
>
> //Aho
Than it appears I am back to step one and not knowing why the code did not
work.
I think i would like to get 3rd party software for dreamweaver 8 so i can
compare the local file to the remote file ( hey im talkin the talk :) ) and
see what that guy did.
frank
Re: Learning php Sql
am 23.04.2006 06:30:58 von Shion
Frankly wrote:
> "J.O. Aho" wrote in message
> news:4avr38Fv88f3U1@individual.net...
>> Frankly wrote:
>>
>>> it is working now.. the tech support chat guy told me that i used the
>>> code wrong.
>>> I used html and php code together I need to use only php and not html.
>> As "mike white" wrote, thats pure nonsense, you get a lot cleaner code to
>> read if you use both HTML and PHP in you php scripts
>>
>>
>> --- test1.php: only php ---
>>
>> echo "\n\nTest1\n\n
>> text=\"green\">\n";
>> $myvar = "Hello World";
>> echo $myvar;
>> echo "";
>> ?>
>> --- eof ---
>>
>>
>> --- test2.php: both html and php ---
>>
>>
>> Test2
>>
>>
>>
>> $myvar = "Hello World";
>> echo $myvar;
>> ?>
>>
>>
>> --- eof ---
>>
>> It's not that much code/html, but already here you can see that the
>> test2.php is a lot easier to read than test1.php. Just keep your HTML code
>> as proper as possible, even on your test pages.
>>
>>
>> //Aho
>
> Than it appears I am back to step one and not knowing why the code did not
> work.
> I think i would like to get 3rd party software for dreamweaver 8 so i can
> compare the local file to the remote file ( hey im talkin the talk :) ) and
> see what that guy did.
You can just download the remote file and rename it and then open both it and
your original file and compare the two files manually side by side.
You have the diffutils, not sure how well it works in a microsoft environment,
but that one can show the difference between two files, works like a charm in
unix like OS:s.
http://gnuwin32.sourceforge.net/packages/diffutils.htm
And one which does have a graphical frontend:
http://www.componentsoftware.com/Products/CSDiff
//Aho
Re: Learning php Sql
am 23.04.2006 15:53:26 von zac.carey
FWIW, when I copied the script that you posted into my system, it
worked fine.
Re: Learning php Sql
am 23.04.2006 17:08:11 von Shion
strawberry wrote:
> FWIW, when I copied the script that you posted into my system, it
> worked fine.
>
Okey, could be that the browser didn't like your HTML, there was the head
section missing in what you did write, while I did have a head section, that
could be the whole difference.
//Aho
Re: Learning php Sql
am 23.04.2006 18:25:55 von zac.carey
Sorry. I should have been clearer:
When I copied Frank's script into my system, it
worked fine.
Apologies for confusing the NG
Re: Learning php Sql
am 23.04.2006 18:56:55 von Frankly
"J.O. Aho" wrote in message
news:4avr38Fv88f3U1@individual.net...
> Frankly wrote:
>
>> it is working now.. the tech support chat guy told me that i used the
>> code wrong.
>> I used html and php code together I need to use only php and not html.
>
> As "mike white" wrote, thats pure nonsense, you get a lot cleaner code to
> read if you use both HTML and PHP in you php scripts
>
>
> --- test1.php: only php ---
>
> echo "\n\nTest1\n\n
> text=\"green\">\n";
> $myvar = "Hello World";
> echo $myvar;
> echo "";
> ?>
> --- eof ---
>
>
> --- test2.php: both html and php ---
>
>
> Test2
>
>
>
> $myvar = "Hello World";
> echo $myvar;
> ?>
>
>
> --- eof ---
>
> It's not that much code/html, but already here you can see that the
> test2.php is a lot easier to read than test1.php. Just keep your HTML code
> as proper as possible, even on your test pages.
>
>
> //Aho
Yes it does. I am going to read through a couple of tutorials to get a
better understanding of HTML and PHP.
after i do my work today I will spend what ever time is left learning.
first off i am going to do that code again.
I feel i can not move on until i can post that 1 simple code and have it
work. first i am going to see what that tech person did.. it wouldnt
suprise me to find it is only HTML.
thank you
Re: Learning php Sql
am 23.04.2006 19:05:34 von Frankly
"J.O. Aho" wrote in message
news:4av742Fu2a18U1@individual.net...
> Frankly wrote:
>
>> I think maybe I just better make a very simple web site. Maybe on my
>> apartments page I should just show the apartments in price order.
>
> If you manage to get the database to spit out the houses/apartments in
> price order, then you can easily sort them by other criteria too.
Sorry if i made it sound like i can easily do it. it is what i would like
to do and the biggest thing that gets me down about all this is not knowing
if I will.
>
> SELECT * FROM house_table WHERE house_type='apartment' ORDER BY
> house_price
>
> SELECT * FROM house_table WHERE house_price<300000 ORDER BY house_area
>
> All you need to do is some if-statements in php that detects what the user
> wants to know and you make the SQL query after that. It's not that
> difficult if you know how to use if-statements (they work quite the same
> in most of programming languages).
I know i dont know the lingo very well but when i say i would like the
database to show up on the web page it wont be for updating the database.
only to let those see what i have. i am going to do a few tutorials, read
over this thread and come back when i have a full understanding what what
this group has already introduced me to. wish me luck on my code and il be
back.
Frank
>
>
>> dont get me wrong I love trying to figure this stuff out. I love a
>> challenge I just dont know if i have enough hours in the day to be
>> updating all these properties and learn what i need to.
>
> If you make a "input" page where your wife can insert a new object and
> another "edit" page where she can change data for each object with the
> option to delete them (don't think she needs them after the house got
> sold) and lastly a "search" and "display" page, so that people can search
> for objects they may want to buy, you will have managed to make yourself
> unneeded. In hours I think this would take maybe 8h if you feel somewhat
> sure on your skills (no need to be an expert).
>
>
>> thank you everyone. it is nice to know there is a place where i can ask
>> questions about what i read.
>
> Good luck Frank and if there is something, just write a post here.
>
>
> //Aho
Re: Learning php Sql
am 26.04.2006 17:38:19 von Frankly
my next step will detemine what way i go.
i believe in having the best tools and to be honest i think
the PHP MySQL is the way to go. however i find other ways to be
easier to my abilities. after reading a few tutorials and having so many
questions
about the explanations. i have decided that for the time being i should go
with access, dreamweaver 8 and ColdFusion MX. i already have Dreamweaver 8
and Access xp.
I would rather learn PHP MySQL and would be willing to pay someone to teach
me.
basically all i need is someone to answer my questions about the
explanations i read.
or even better someone to just help me build my wifes site.
thank you
Re: Learning php Sql
am 27.04.2006 05:26:14 von Shion
Frankly wrote:
> my next step will detemine what way i go.
> i believe in having the best tools and to be honest i think
> the PHP MySQL is the way to go. however i find other ways to be
> easier to my abilities. after reading a few tutorials and having so many
> questions
> about the explanations. i have decided that for the time being i should go
> with access, dreamweaver 8 and ColdFusion MX. i already have Dreamweaver 8
> and Access xp.
> I would rather learn PHP MySQL and would be willing to pay someone to teach
> me.
> basically all i need is someone to answer my questions about the
> explanations i read.
> or even better someone to just help me build my wifes site.
You know, the newsgroups are free and there a loads of people who will answer
and explain.
//Aho
Re: Learning php Sql
am 29.04.2006 18:57:31 von Frankly
"J.O. Aho" wrote in message
news:4barumF10siusU2@individual.net...
> Frankly wrote:
>> my next step will detemine what way i go.
>> i believe in having the best tools and to be honest i think
>> the PHP MySQL is the way to go. however i find other ways to be
>> easier to my abilities. after reading a few tutorials and having so many
>> questions
>> about the explanations. i have decided that for the time being i should
>> go with access, dreamweaver 8 and ColdFusion MX. i already have
>> Dreamweaver 8 and Access xp.
>> I would rather learn PHP MySQL and would be willing to pay someone to
>> teach me.
>> basically all i need is someone to answer my questions about the
>> explanations i read.
>> or even better someone to just help me build my wifes site.
>
> You know, the newsgroups are free and there a loads of people who will
> answer and explain.
>
>
> //Aho
I am using Access right now till i get a better understanding of relational
databases.
I know I will be working with PHP later on or coldfusion at this point i am
not sure.
I am no longer in a rush simply because i know - this can not be rushed.
Frank
Re: Learning php Sql
am 30.04.2006 02:27:03 von Rik
rankly wrote:
> I am using Access right now till i get a better understanding of
> relational databases.
> I know I will be working with PHP later on or coldfusion at this
> point i am not sure.
> I am no longer in a rush simply because i know - this can not be
> rushed. Frank
Better understanding from Access...
I suppose loooking at the SQL view of your different queries might explain
some thing to you...
Learning proper SQL syntax will yield you a lot more.
Grtz,
--
Rik Wasmus
Re: Learning php Sql
am 02.05.2006 18:06:23 von Frankly
"Rik" wrote in message
news:e3107q$snp$1@netlx020.civ.utwente.nl...
> rankly wrote:
>> I am using Access right now till i get a better understanding of
>> relational databases.
>> I know I will be working with PHP later on or coldfusion at this
>> point i am not sure.
>> I am no longer in a rush simply because i know - this can not be
>> rushed. Frank
>
> Better understanding from Access...
>
> I suppose loooking at the SQL view of your different queries might explain
> some thing to you...
> Learning proper SQL syntax will yield you a lot more.
>
> Grtz,
> --
> Rik Wasmus
I am still having a lot of trouble creating forms for inputting data.
i tried to create tables for Areas and ZipCodes so that when i am inputting
a new
building I can select from a combo box. I can get the zipcodes combo box to
work but for the life
of me i was unable to get the Area combo box to work. when the combo box
for area showed the drop down menu - it was empty and very long. I compared
it to the zipcode box and it should have worked.
I feel like pulling my hair out.
Re: Learning php Sql
am 02.05.2006 18:17:40 von Shion
Frankly wrote:
> I am still having a lot of trouble creating forms for inputting data.
> i tried to create tables for Areas and ZipCodes so that when i am inputting
> a new
> building I can select from a combo box. I can get the zipcodes combo box to
> work but for the life
> of me i was unable to get the Area combo box to work. when the combo box
> for area showed the drop down menu - it was empty and very long. I compared
> it to the zipcode box and it should have worked.
> I feel like pulling my hair out.
Without part of the code it's difficult to tell what's wrong with it, could
just be that you have a column called 'xXxxx' in the table while you do your
while loop (or what you use to populate the drop down menu) you may referring
to 'xYxxx', which leads to a null-string (nothing) instead of the string it
should have echoed.
//Aho
Re: Learning php Sql
am 02.05.2006 18:43:15 von unknown
Post removed (X-No-Archive: yes)
Re: Learning php Sql
am 02.05.2006 20:42:23 von Frankly
"Martie" wrote in message
news:e3827302shs@drn.newsguy.com...
> On Tue, 02 May 2006 16:06:23 GMT, Frankly wrote...
>>
>>
>>"Rik" wrote in message
>>news:e3107q$snp$1@netlx020.civ.utwente.nl...
>>> rankly wrote:
>>>> I am using Access right now till i get a better understanding of
>>>> relational databases.
>>>> I know I will be working with PHP later on or coldfusion at this
>>>> point i am not sure.
>>>> I am no longer in a rush simply because i know - this can not be
>>>> rushed. Frank
>>>
>>> Better understanding from Access...
>>>
>>> I suppose loooking at the SQL view of your different queries might
>>> explain
>>> some thing to you...
>>> Learning proper SQL syntax will yield you a lot more.
>>>
>>> Grtz,
>>> --
>>> Rik Wasmus
>>
>>I am still having a lot of trouble creating forms for inputting data.
>>i tried to create tables for Areas and ZipCodes so that when i am
>>inputting
>>a new
>>building I can select from a combo box. I can get the zipcodes combo box
>>to
>>work but for the life
>>of me i was unable to get the Area combo box to work. when the combo box
>>for area showed the drop down menu - it was empty and very long. I
>>compared
>>it to the zipcode box and it should have worked.
>>I feel like pulling my hair out.
>>
>>
>
> Could be a simple syntax error but since there's no code to look at, our
> guess
> is as good as yours.
Now you know how i feel :).
I am thinking about getting another tuturial.
is there a way I could post the code here? could i post the tables and
feilds to get a little feed back?
I would like that but what is most important is to have 3 tables that work
good together.
1- Management table with contact info and include a BuildingID field to
create a relationship
to the buildings table.
2 - the buildings table will have a relationship with the apartments table
via the BuildingID feild.
in my forms i have combo boxes to pick Management when adding a new
building.
and a combo box for picking a building when adding a new apartment.
they work great in the form except i forgot where i read to lock that info
once inputed.
and i also noticed that while the forms have the word choices from the drop
down menu
the table is holding the primary key infomation.
after i get that in a way that i know i wont end up having to delete all my
info because of bad design, i would like is to have the Area's and Zip
codes together so that when i attach an area to a building it brings the zip
codes with it ( each area has 2 or 3 zip codes ).
in the combo boxes i noticed that I almost changed.
the only way i can get the combo boxes in the fields to work show the data I
want is to open the form in design view - delete the fields and then re
enter a combo box via the tool box.
once the Database is complete i will need to be able to do searches via.
Area, Bedrooms, Rent, MoveIn Date, Pets, OutDoorSpace. just to name a few.
thank you again.
Re: Learning php Sql
am 03.05.2006 05:56:03 von Shion
Frankly wrote:
> I am thinking about getting another tuturial.
> is there a way I could post the code here? could i post the tables and
> feilds to get a little feed back?
cut'n'paste the code here and describe how your tables look like (column names
and datatype).
//Aho
Re: Learning php Sql
am 03.05.2006 18:12:43 von Frankly
"J.O. Aho" wrote in message
news:4bqnujF12n3psU2@individual.net...
> Frankly wrote:
>
>> I am thinking about getting another tuturial.
>> is there a way I could post the code here? could i post the tables and
>> feilds to get a little feed back?
>
> cut'n'paste the code here and describe how your tables look like (column
> names and datatype).
>
>
> //Aho
wow that is great thank you.
As far as the code goes, I am thinking you mean (row Source type and Row
Source)
once I know I have the table structure right, I will know if problems are
in what I am trying to.
Management table
ManagementID Auto #- Primary key for relation to foreign key in
BuildingsTable
BuildingID - # - Foreign Key for relation to Buildings Table
Contact - text
Phone - text
Address - text
Notes - memo
Buildings Table
BuildingID - Auto # - P-Key
ManagementID - # - FK
ApartmentID - # - FK for relation to Apartments Table
Building# - text
Street - Text
CrossStreetA - text
CrossStreetB - Text
CommonOutdoorSpace - yes/No
BuildingContact - text
ContactPhone - text
BuildingNote - Memo
Area - text or combo
ZipCode - text or combo - not sure if i should use a combo box for Area and
ZipCode or just text boxes.
Apartments Table
ApartmentID - Auto# - PK - relation to Buildings Table
BuildingID - FK - related to buildings Table
Apartment - Text
Rent - Currency
MoveInDate - Date
StillAvailable - Yes/No
Pets - combo field for these choices - yes, No, cats only, Under 12lbs
TenantContact - Text
TenantPhone - text
Elevator - yes/no
Laundry - Yes/No
PrivateOutdoorSpace - Yes/No
DoorMan - Yes/No
ApartmentComments1 - Memo
ApartmentComments2 - Memo
I would also like to be able to add a Area Table and ZipCode Table or
separate tables.
Not yet but once I start to look into queries I would like to
put the Area to a building that it also brings the zipcode.
My main concern is to have a good foundation that I can start using and as I
learn more apply what I learn.
I have looking into converting Inventory Control database, changing the
tables around a bit.
but feel being this is the first step in many. I must learn this if I am
going to move on to SQL, PHP and or ColdFusion, learn more about HTML. I
know it doesn't look like I am trying as hard as I am but for the past 2
months. I have learned allot about what I will need to learn to create a
dynamic web site for my wife. The only feed back I have ever gotten was from
these groups. Thank you
Re: Learning php Sql
am 04.05.2006 18:01:14 von Frankly
Even tho my wife has begged me to step back a few days. I find I cant I
feel like the Blues Brothers and I am on a mission from God. J
I love a challenge and the worst part of this is not knowing if this is
something I can teach myself.
Well my wife is right I have become obsessed with this. It is very
important to me.
Yesterday I couldn't stay away and played around with the tables a bit.
The way I have it now.
The Managements table has a 1 to many relations with the buildings table
using ManagementID. It is the primary key in the Managements table and
Foreign key in the buildings table.
The buildings table has a 1 to many relation with the apartments table.
Using BuildingID
As primary in the buildings table.
I think this is right because when I look at the tables the Management table
has the buildings table as a sub table; the buildings table has the
apartments table as the sub table.
If this is right. then perhaps the buildings table should have a 1 to many
with the zip code table and also with the area table. or should the area and
zip code have a relation or should they be in 1 table. My wife is right I
am spent; I know I should step back a few days but I always feel like I am
one step away and that I should keep going.
I am happy with the new relations I have created and I hope it is right.
Could someone tell me about how to post the code?
Thank you again.
Re: Learning php Sql
am 04.05.2006 18:12:09 von Frankly
Something Still seems to be wrong.
While the buildings table will show the apartments for that building.
the Managements table does not show the buildings in the sub table.
Re: Learning php Sql
am 04.05.2006 19:50:21 von Shion
Frankly wrote:
> "J.O. Aho" wrote in message
> news:4bqnujF12n3psU2@individual.net...
>> Frankly wrote:
>>
>>> I am thinking about getting another tuturial.
>>> is there a way I could post the code here? could i post the tables and
>>> feilds to get a little feed back?
>> cut'n'paste the code here and describe how your tables look like (column
>> names and datatype).
> wow that is great thank you.
Thats how things can be done here and it has worked well before.
sorry that I missed your posts, been busy on my end.
> As far as the code goes, I am thinking you mean (row Source type and Row
> Source)
Raw code, your php script.
> once I know I have the table structure right, I will know if problems are
> in what I am trying to.
You can make relations in the following way
Management table:
ManagementID
Contact
Phone
Address
Notes
Buildings table:
BuildingID
Building
Street
CrossStreetA
CrossStreetB
CommonOutdoorSpace
BuildingContact
ContactPhone
BuildingNote
Area
ZipCode
RelationManagementBuilding table:
ManagementID
BuildingID
It's IMHO easier to join with this method and you can have multiple relations.
You can have one row in Management table to be linked to more than one
Building, which in it's case can be linked to many Apartments. Your setup
limits a one to one relation all the time.
> I would also like to be able to add a Area Table and ZipCode Table or
> separate tables.
> Not yet but once I start to look into queries I would like to
> put the Area to a building that it also brings the zipcode.
One way is to create a ZipTable were you have
ZipTable:
ZipCode
Area
you can then in theory drop the area column in the buildings table and use
JOIN http://dev.mysql.com/doc/refman/5.0/en/join.html to put together the
Building table with the ZipTable and you would get the correct area (as long
as the right zip code has been entered).
But I think you will always want to see the which area the building is in,
then you still want to make that Area column, as it will speed up searches
(join takes time, more the more rows you have inb the both tables).
> Even tho my wife has begged me to step back a few days. I find I cant I
> feel like the Blues Brothers and I am on a mission from God. J
> I love a challenge and the worst part of this is not knowing if this is
> something I can teach myself.
> Well my wife is right I have become obsessed with this. It is very
> important to me.
I do recognize myself there, been times when I spent up most of the night
working on some project. But keep in mind, spend time with your wife or in the
worst case you may not have one and then there wouldn't be any point with this
project.
//Aho
Re: Learning php Sql
am 05.05.2006 14:24:16 von zac.carey
Re the ziptable
Maybe it's more info than you need but a helpful chap over at
http://www.cfdynamics.com/cfdynamics/zipbase/index.cfm has made
available a text file of US zip codes for download.
You'd still need to add area names to the table. I guess these are
always changing (In NY I seem to remember 'Hell's Kitchen' became
'Clinton' a while back) so maybe there's no official zipcode/area name
relationship.
I'm writing from a UK perspective so don't flame me if I'm a bit wide
of the mark! :-)
Re: Learning php Sql
am 05.05.2006 16:31:42 von Shion
strawberry wrote:
> Re the ziptable
>
> Maybe it's more info than you need but a helpful chap over at
> http://www.cfdynamics.com/cfdynamics/zipbase/index.cfm has made
> available a text file of US zip codes for download.
>
> You'd still need to add area names to the table. I guess these are
> always changing (In NY I seem to remember 'Hell's Kitchen' became
> 'Clinton' a while back) so maybe there's no official zipcode/area name
> relationship.
I don't know how it's with USPS, but at least the swedish post does offer the
current lists for free.
//Aho
Re: Learning php Sql
am 05.05.2006 19:47:55 von Frankly
"J.O. Aho" wrote in message
news:4but6tF13ulrrU1@individual.net...
>> wow that is great thank you.
>
> Thats how things can be done here and it has worked well before.
> sorry that I missed your posts, been busy on my end.
( Before you reply to any questions I have asked in in this reply, let me
first apply what you did say in
PHPmyAdmin and MySQL) I dont want to abuse your help or get to ahead of
myself.
No need to say you are sorry. Push me and it will mean nothing.
Push my wife, I wont be able to control myself.
Help me and I will be thankful, Help my wife I wont be able to thank you
enough.
I am sorry that I made 3 very big posts the other day, i think it only
confused things. for now on i will take notes during the day of the things I
am not sure of and just edit as needed..
>
>
>> As far as the code goes, I am thinking you mean (row Source type and Row
>> Source)
>
> Raw code, your php script.
oo that code.
I first came here when I first relized that using PHP myadmin as the GUI :)
for mySQL was the most reliable of my choices. I gave it a very hard shot
and thought it would be better to first learn more about relations using MS
Access. At one point I was thinking and still not sure if MS would be a
better choice for someone with my limited knowledge in computers. I still
have a lot to learn no matter what way i choose.
I know just enough about the open source products to repect them but never
knew enough to concider formyself. I am going to try MySQL once again with
the table structure you have recommended.
no matter what way i go i feel that PHP is in my future. I am also
wondering about ColdFusion and even ASP.net
however at this point I wonder if these are things I can actually learn in
order to do what I want.
in the end it has to be user friendly enough so that even my wife can use it
on her own. she knows much less than I do. I think she has only checked
email not even 100 times. reliability is also important, a curropt database
wont do her any good. I first came here on topic but still asked questions
even when i went ( puts hand over mouth and mubbles ) Access Xp. I figured
i would try and still post questions here. sooo to make a long story
short... PHP.. I didnt use it yet. 99.9% was done via the wizards in
Access.
>
>
>> once I know I have the table structure right, I will know if problems
>> are in what I am trying to.
>
> You can make relations in the following way
>
> Management table:
> ManagementID
> Contact
> Phone
> Address
> Notes
>
> Buildings table:
> BuildingID
> Building
> Street
> CrossStreetA
> CrossStreetB
> CommonOutdoorSpace
> BuildingContact
> ContactPhone
> BuildingNote
> Area
> ZipCode
>
> RelationManagementBuilding table:
> ManagementID
> BuildingID
>
> It's IMHO easier to join with this method and you can have multiple
> relations. You can have one row in Management table to be linked to more
> than one Building, which in it's case can be linked to many Apartments.
> Your setup limits a one to one relation all the time.
I am wondering if i should create the relation to the apartments table via
the RelationManagementBuilding Table
or to the Buildings table.
>
> > I would also like to be able to add a Area Table and ZipCode Table or
> > separate tables.
>> Not yet but once I start to look into queries I would like to
>> put the Area to a building that it also brings the zipcode.
>
> One way is to create a ZipTable were you have
>
> ZipTable:
> ZipCode
> Area
>
> you can then in theory drop the area column in the buildings table and use
> JOIN http://dev.mysql.com/doc/refman/5.0/en/join.html to put together the
> Building table with the ZipTable and you would get the correct area (as
> long as the right zip code has been entered).
>
> But I think you will always want to see the which area the building is in,
> then you still want to make that Area column, as it will speed up searches
> (join takes time, more the more rows you have inb the both tables).
thank you.
I will let you know how this turns out in mysql which i will be starting
again
later today.
>
>
> > Even tho my wife has begged me to step back a few days. I find I cant I
> > feel like the Blues Brothers and I am on a mission from God. J
> > I love a challenge and the worst part of this is not knowing if this is
> > something I can teach myself.
> > Well my wife is right I have become obsessed with this. It is very
> > important to me.
>
> I do recognize myself there, been times when I spent up most of the night
> working on some project. But keep in mind, spend time with your wife or in
> the worst case you may not have one and then there wouldn't be any point
> with this project.
> //Aho
Not likely my wife will leave me :). however I was treating her very
badly.
when ever she would try to talk I would snap at her because she broke my
concentration.
even when i walked away from the computer i was thinking in a way that would
not allow conversation and for a few nights it was all i dreamed about.
my biggest worry is - is this actually something I can do in a timely
manner. I respect it enough to know
this is going to be the hardest thing I have ever learned. I may even stay
away from it today because I am still recovering. I guess the weakness I
felt was because I was working myself into a nervous breakdown.
thank you again.. I may stay away from it again today but I am also very
curious about how the little I learned will help me in MySQL.
TTYS
Frank
Re: Learning php Sql
am 05.05.2006 20:00:26 von Frankly
"strawberry" wrote in message
news:1146831856.521349.36500@i39g2000cwa.googlegroups.com...
> Re the ziptable
>
> Maybe it's more info than you need but a helpful chap over at
> http://www.cfdynamics.com/cfdynamics/zipbase/index.cfm has made
> available a text file of US zip codes for download.
>
> You'd still need to add area names to the table. I guess these are
> always changing (In NY I seem to remember 'Hell's Kitchen' became
> 'Clinton' a while back) so maybe there's no official zipcode/area name
> relationship.
>
> I'm writing from a UK perspective so don't flame me if I'm a bit wide
> of the mark! :-)
I was unable to open the Access version but was able to open the Text
version.
I did to a tutorial on converting text files to tables in Access XP.
I still have my Tutorial for PHPmyAdmin i think im going to do go over it
again before I start.
Talk to you soon I let you know at what point i start pulling my hair out
again. unless of course you guys think it would be better for someone with
my limited knowledge to use something else.
Re: Learning php Sql
am 05.05.2006 20:13:53 von Frankly
"J.O. Aho" wrote in message
news:4c15ueF13fubpU1@individual.net...
> strawberry wrote:
>> Re the ziptable
>>
>> Maybe it's more info than you need but a helpful chap over at
>> http://www.cfdynamics.com/cfdynamics/zipbase/index.cfm has made
>> available a text file of US zip codes for download.
>>
>> You'd still need to add area names to the table. I guess these are
>> always changing (In NY I seem to remember 'Hell's Kitchen' became
>> 'Clinton' a while back) so maybe there's no official zipcode/area name
>> relationship.
They probably changed the name for this very subject. Many students require
a gaurantor and I can see them reading a listing for an apartment in
Manhattans, Hells Kitchen.
Hells Kitchen is a cool name but not a wise choice for the realestate
market. I did a search for Kitchen as well as Clinton. There is nothing
for kitchen, I did find Clinton, NY but it didnt have a ZipCode next to it.
Re: Learning php Sql
am 05.05.2006 21:01:44 von Shion
Frankly wrote:
> no matter what way i go i feel that PHP is in my future. I am also
> wondering about ColdFusion and even ASP.net
I'm quite much against VisualBasic (ASP), as it limits you to more or less to
microsoft servers, would make it more difficult to switch webhotel. ColdFusion
is limited in quite the same manner. No matter what you choose, you still need
to "code" to be able to do something.
> however at this point I wonder if these are things I can actually learn in
> order to do what I want.
> in the end it has to be user friendly enough so that even my wife can use it
> on her own.
In this case you need to ask your wife how she would like the application to
work, how she wants to work, no real point in making something and modify it
afterwards to please your wife. She don't have to know anything at all about
programming, all she has to know is what she want to enter and how the design
should look like (in which order the input boxes should be and so on).
> my biggest worry is - is this actually something I can do in a timely
> manner. I respect it enough to know this is going to be the hardest thing
> I have ever learned.
Much depends what you think is timely, of course a first project, no matter
what you do will take longer than what your second project will. IMHO it's
planing that is the most important thing to do, the more you have planed
before you sit down and try to write the code, the less time you will need to
spend in front of the computer and code and usually the end result is a lot
better too.
> thank you again.. I may stay away from it again today but I am also very
> curious about how the little I learned will help me in MySQL.
Maybe a SQL tutorial could be of use, found this (not sure if it's a good one
or not): http://www.sqlcourse.com/
The basics in SQL is quite the same, regardless if it's MySQL, Oracle, Sybase
or any other sql server you are working with, just keep in mind that all of
them have something that is different from other sql products.
//Aho
Re: Learning php Sql
am 05.05.2006 23:14:07 von Frankly
"J.O. Aho" wrote in message
news:4c1looF13n152U1@individual.net...
> Frankly wrote:
>
>> no matter what way i go i feel that PHP is in my future. I am also
>> wondering about ColdFusion and even ASP.net
>
> I'm quite much against VisualBasic (ASP), as it limits you to more or less
> to microsoft servers, would make it more difficult to switch webhotel.
> ColdFusion is limited in quite the same manner. No matter what you choose,
> you still need to "code" to be able to do something.
I can understand your feelings with those products.
>
> In this case you need to ask your wife how she would like the application
> to work, how she wants to work, no real point in making something and
> modify it afterwards to please your wife. She don't have to know anything
> at all about programming, all she has to know is what she want to enter
> and how the design should look like (in which order the input boxes should
> be and so on).
These are things I will have to figure out. At the same time I really have
no idea what
options are available to me. It needs to be as simple as possible.
Query by form is the term I think used for the way she will search.
as far as data entry. i dont think she will be doing much of that. She
cant type at
all. i tried to get her to learn but how do you push someone that is
already pushing as hard as they can.
She will do fine with the database where all she will have to do is mark
Available and NotAvailable via
a yes no feild. any new properties she can handle on hard copy. with even
some kind of scheduling field for making calls.
Some landlords are so big i call them every 2 weeks. All this in time.
right now i have yet to
do the table layout in PHP MyAdmin.
> Much depends what you think is timely, of course a first project, no
> matter what you do will take longer than what your second project will.
> IMHO it's planing that is the most important thing to do, the more you
> have planed before you sit down and try to write the code, the less time
> you will need to spend in front of the computer and code and usually the
> end result is a lot better too.
I have this stuff on the brain now. no matter what I am doing, this is what
I am thinking about.
not only the database but everything that needs to be done in order to
create a database driven web site.
idealy i would like to learn enough to put a property or 2 and then move on
to trying to get those things to show on the web site. then i will be able
to relax and fine tune my skills.
>
>
>> thank you again.. I may stay away from it again today but I am also very
>> curious about how the little I learned will help me in MySQL.
>
> Maybe a SQL tutorial could be of use, found this (not sure if it's a good
> one or not): http://www.sqlcourse.com/
I went through a few pages already. I also have a tutorial for PHPmy Admin
ebook.
tomorrow i will start again.
>
> The basics in SQL is quite the same, regardless if it's MySQL, Oracle,
> Sybase or any other sql server you are working with, just keep in mind
> that all of them have something that is different from other sql products.
>
>
> //Aho
being my web host already has it ready. I will be using PHP myAdmin for
MySQL.
I am actually looking foward to trying it again. i thank those helping for
that.
Frank
Re: Learning php Sql
am 24.05.2006 18:33:39 von Frankly
"J.O. Aho" wrote in message
news:4but6tF13ulrrU1@individual.net...
>
> You can make relations in the following way
>
> Management table:
> ManagementID
> Contact
> Phone
> Address
> Notes
>
> Buildings table:
> BuildingID
> Building
> Street
> CrossStreetA
> CrossStreetB
> CommonOutdoorSpace
> BuildingContact
> ContactPhone
> BuildingNote
> Area
> ZipCode
>
> RelationManagementBuilding table:
> ManagementID
> BuildingID
>
> It's IMHO easier to join with this method and you can have multiple
> relations. You can have one row in Management table to be linked to more
> than one Building, which in it's case can be linked to many Apartments.
> Your setup limits a one to one relation all the time.
> One way is to create a ZipTable were you have
I know I am not the fasted index in a database but are you using the
relationManagementBuilding table as a linking table to create a Many to Many
relation?
I have been using Access while i wait for my host to upgrade MySQL to the
current version.
I am begining to wonder if i should or if i can do that upgrade myself.
>
> ZipTable:
> ZipCode
> Area
>
> you can then in theory drop the area column in the buildings table and use
> JOIN http://dev.mysql.com/doc/refman/5.0/en/join.html to put together the
> Building table with the ZipTable and you would get the correct area (as
> long as the right zip code has been entered).
I tried this in Access with out any luck. i was able to create a combo box
in a form with fields for Area and Zipcode.. however when i selected the
Area it wouldnt automatically bring the zip code. in other forms i was able
to include fields from other talbes that would get filled according to a
selection i made in a combo box.
>
> But I think you will always want to see the which area the building is in,
> then you still want to make that Area column, as it will speed up searches
> (join takes time, more the more rows you have inb the both tables).
>
>
> > Even tho my wife has begged me to step back a few days. I find I cant I
> > feel like the Blues Brothers and I am on a mission from God. J
> > I love a challenge and the worst part of this is not knowing if this is
> > something I can teach myself.
> > Well my wife is right I have become obsessed with this. It is very
> > important to me.
>
> I do recognize myself there, been times when I spent up most of the night
> working on some project. But keep in mind, spend time with your wife or in
> the worst case you may not have one and then there wouldn't be any point
> with this project.
>
>
>
> //Aho
I am not as bad any more. I do get addicted mostly because I always feel
like I am just seconds away from learning something new. I feel more
confident with Access but I dont feel right not using something I feel is
better.
If I am able to do the MySQL install on my own I wonder how long it would
take.
Because of all the different flavors of SQL like MySQL and how directions
are version specific i think i would rather just learn SQL. i tried to
bypass PHPmyAdmin a few times by going straight to the SQL window with
tutorials nothing seemed to work. I wasnt sure how my current version
would differ from the latest version so i didnt get into it like i should
have.
Re: Learning php Sql
am 24.05.2006 18:37:54 von Frankly
I think I may have fixed the problem. I simply went to delete all my forms
and start over again.
After deleting the last form I looked up and noticed I was in the tables
area :(.
lol o well.
another day another something.
Re: Learning php Sql
am 24.05.2006 18:53:08 von Shion
Frankly wrote:
> "J.O. Aho" wrote in message
> news:4but6tF13ulrrU1@individual.net...
>> You can make relations in the following way
>>
>> Management table:
>> ManagementID
>> Contact
>> Phone
>> Address
>> Notes
>>
>> Buildings table:
>> BuildingID
>> Building
>> Street
>> CrossStreetA
>> CrossStreetB
>> CommonOutdoorSpace
>> BuildingContact
>> ContactPhone
>> BuildingNote
>> Area
>> ZipCode
>>
>> RelationManagementBuilding table:
>> ManagementID
>> BuildingID
>>
>> It's IMHO easier to join with this method and you can have multiple
>> relations. You can have one row in Management table to be linked to more
>> than one Building, which in it's case can be linked to many Apartments.
>> Your setup limits a one to one relation all the time.
>> One way is to create a ZipTable were you have
>
>
>
> I know I am not the fasted index in a database but are you using the
> relationManagementBuilding table as a linking table to create a Many to Many
> relation?
Yes, thats right, a good idea is to make the ManagementID and BuildingID to be
the primary key, this way you won't get doublets.
> I have been using Access while i wait for my host to upgrade MySQL to the
> current version.
> I am begining to wonder if i should or if i can do that upgrade myself.
If you aren't the admin of the host where you have the web page, then you are
out of luck of updating the mysql.
> I tried this in Access with out any luck. i was able to create a combo box
> in a form with fields for Area and Zipcode.. however when i selected the
> Area it wouldnt automatically bring the zip code. in other forms i was able
> to include fields from other talbes that would get filled according to a
> selection i made in a combo box.
This requires some javascript coding too, if you want the zip code box to be
automatically filled when you entered the area. Otherwise if you allow people
to leave the box empty, you can let the receiving php page to fetch the zip
code (keep in mind that an area may have more than one zip code, so it's
really better to do it the other way around, fill the zip code and let the php
script fetch the area name from the database and then save it into the row).
> If I am able to do the MySQL install on my own I wonder how long it would
> take.
To install things on your own computer won't take long, there are packages for
microsoft that includes apache (web server), php and mysql. For doing
installation on web hotels, you will need to have admin access on them, which
are only for employees on the company hosting the web hotel.
> Because of all the different flavors of SQL like MySQL and how directions
> are version specific i think i would rather just learn SQL.
The base in SQL is the same for most flavors, but they do have things that are
special for them too, but if you learn how to use SQL in MySQL will make it
quite easy for you to work with Oracle too.
> i tried to
> bypass PHPmyAdmin a few times by going straight to the SQL window with
> tutorials nothing seemed to work. I wasnt sure how my current version
> would differ from the latest version so i didnt get into it like i should
> have.
If you are directly in the mysql client, then you get error messages that
tells you where you done something wrong, a major difference with using a
frontend as phpmyadmin is that you need to add ; in the end of your SQL-query
SELECT * FROM Management;
All basic SQL things works fine in all versions of MySQL that you encounter
today (3.x, 4.x and 5.x), while some more advanced things like SUBSELECTION
works only in newer versions.
//Aho
Re: Learning php Sql
am 24.05.2006 19:47:04 von Frankly
"J.O. Aho" wrote in message
news:4djhbkF1ah9mqU1@individual.net...
>> I know I am not the fasted index in a database but are you using the
>> relationManagementBuilding table as a linking table to create a Many to
>> Many relation?
>
> Yes, thats right, a good idea is to make the ManagementID and BuildingID
> to be the primary key, this way you won't get doublets.
I am thinking that ManID and BuildingID are the primary keys in their tables
and that the linking table does
not get a primary key.
>
>
>> I have been using Access while i wait for my host to upgrade MySQL to the
>> current version.
>> I am begining to wonder if i should or if i can do that upgrade myself.
>
> If you aren't the admin of the host where you have the web page, then you
> are out of luck of updating the mysql.
I am the Admin and I have already downloaded MySQL to my computer. I had
made this site for her a while ago using front page :).
Later I wanted to learn CSS and started to use Dreamweaver. that is when I
learned
about dynamic web sites. its a real pain in the butt to make updates all
over the place.
at least now the database will show the changes on the website. and
returning customers can see my daily upgrades even if they dont clear their
browsers cache. I like using the forms in Access
they make it very easy to copy and paste data on web sites where I post her
ads.
>
>
>> I tried this in Access with out any luck. i was able to create a combo
>> box in a form with fields for Area and Zipcode.. however when i selected
>> the Area it wouldnt automatically bring the zip code. in other forms i
>> was able to include fields from other talbes that would get filled
>> according to a selection i made in a combo box.
>
> This requires some javascript coding too, if you want the zip code box to
> be automatically filled when you entered the area. Otherwise if you allow
> people to leave the box empty, you can let the receiving php page to fetch
> the zip code (keep in mind that an area may have more than one zip code,
> so it's really better to do it the other way around, fill the zip code and
> let the php script fetch the area name from the database and then save it
> into the row).
I know you are right and no need to jump ahead right now. but this
confuses me because.
I was able to include fields from the management table and buildings table
to a form.
when I selected the building from a combo box the management fields became
populated.
>
>
>> If I am able to do the MySQL install on my own I wonder how long it
>> would take.
>
> To install things on your own computer won't take long, there are packages
> for microsoft that includes apache (web server), php and mysql. For doing
> installation on web hotels, you will need to have admin access on them,
> which are only for employees on the company hosting the web hotel.
I work out of my apartment and I do have 3 computers. I wouldnt want to
create a web server
on the newer computers for fear of hackers. I dont even have them networked
together.
I guess I could install it on my lap top. Its originally had windows 98 and
is now suffering with windows XP.
If i am going to learn all this i bet putting a cleaner open source OS on it
would help and wouldnt be that much work.
>
>
>> Because of all the different flavors of SQL like MySQL and how directions
>> are version specific i think i would rather just learn SQL.
>
> The base in SQL is the same for most flavors, but they do have things that
> are special for them too, but if you learn how to use SQL in MySQL will
> make it quite easy for you to work with Oracle too.
>
>
>> i tried to bypass PHPmyAdmin a few times by going straight to the SQL
>> window with tutorials nothing seemed to work. I wasnt sure how my
>> current version would differ from the latest version so i didnt get into
>> it like i should have.
>
> If you are directly in the mysql client, then you get error messages that
> tells you where you done something wrong, a major difference with using a
> frontend as phpmyadmin is that you need to add ; in the end of your
> SQL-query
>
> SELECT * FROM Management;
>
> All basic SQL things works fine in all versions of MySQL that you
> encounter today (3.x, 4.x and 5.x), while some more advanced things like
> SUBSELECTION works only in newer versions.
>
>
>
> //Aho
I am going to read the set up instructions again for the new version of
MySQL and PHPmyAdmin.
thank you again.
Re: Learning php Sql
am 24.05.2006 20:03:59 von Shion
Frankly wrote:
> "J.O. Aho" wrote in message
> news:4djhbkF1ah9mqU1@individual.net...
>>> I know I am not the fasted index in a database but are you using the
>>> relationManagementBuilding table as a linking table to create a Many to
>>> Many relation?
>> Yes, thats right, a good idea is to make the ManagementID and BuildingID
>> to be the primary key, this way you won't get doublets.
>
>
> I am thinking that ManID and BuildingID are the primary keys in their tables
Yes, that is right and a good way to do.
> and that the linking table does not get a primary key.
It should still have "a" primary key that is the two ID's together, other wise
you can have doublets in the link table, which you don't want.
> at least now the database will show the changes on the website. and
> returning customers can see my daily upgrades even if they dont clear their
> browsers cache. I like using the forms in Access
> they make it very easy to copy and paste data on web sites where I post her
> ads.
You can export and import in mysql (and other full sql servers), which makes
it easy to move data from one database to another.
>>> If I am able to do the MySQL install on my own I wonder how long it
>>> would take.
>> To install things on your own computer won't take long, there are packages
>> for microsoft that includes apache (web server), php and mysql. For doing
>> installation on web hotels, you will need to have admin access on them,
>> which are only for employees on the company hosting the web hotel.
>
> I work out of my apartment and I do have 3 computers. I wouldnt want to
> create a web server
> on the newer computers for fear of hackers. I dont even have them networked
> together.
> I guess I could install it on my lap top. Its originally had windows 98 and
> is now suffering with windows XP.
If you dare, you could take the step over to the unix world and install
GNU/Linux or BSD of some kind, you will most often get a package manager that
will help you keep your machine up to date and have quite recent versions of
apache, mysql and php installed. IMHO an unix like OS is a lot better fit for
server work than microsoft is (even microsoft uses BSD and Linux for servers).
I know many microsoft users who sets up a home server using Linux, installs a
desktop version with the server applications they want to use, this is vast of
CPU power, as the X Window system will use up many CPU cycles and memory too,
which better could be used on the server applications. For decent server
distros, take a look at SoL www.sol-linux.com, Trustix www.trustix.net or
Gentoo www.gentoo.org. I think SoL and Trustix are best options, Gentoo does
offer more packages, but requires more from the user and in some cases forces
you to do some serious hacking as the maintainers don't make good choices.
//Aho
Re: Learning php Sql
am 25.05.2006 01:28:06 von Frankly
"Frankly" wrote in message news:...
I have now created 4 almost 5 tables.
the ManagementBuildings table shows as 2 tables - I think that is because
of
2 primary keys?
I am now on the apartments table and for some reason I can not complete it.
I know the structure of the this and the other tables still needs to be
tuned - but why
this.. it didnt happen on any of my other tables :(
SQL query:
CREATE TABLE `Apartments` (
`ApartmentID` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`Rent` INT NOT NULL ,
`Bedrooms` INT NOT NULL ,
`ApartmentNumber` VARCHAR( 10 ) NOT NULL ,
`MoveInDate` DATE NOT NULL ,
`StillAvailable` ENUM NOT NULL ,
`ApartmentContact` CHAR( 20 ) NOT NULL ,<----- this is where the problem
is?.
`ApartmentPhone` VARCHAR( 12 ) NOT NULL ,
`Picture1` VARCHAR( 50 ) NOT NULL ,
`Picture2` VARCHAR( 50 ) NOT NULL ,
`Picture3` VARCHAR( 50 ) NOT NULL ,
INDEX ( `Rent` )
) TYPE = MYISAM
MySQL said:
#1064 - You have an error in your SQL syntax. Check the manual that
corresponds to your MySQL server version for the right syntax to use near
'NOT NULL, `ApartmentContact` CHAR(20) NOT NULL, `ApartmentPhone
I have went to the web site and went over my tuturials. I have created and
recreated this table a few times and can not find out what is wrong.
Re: Learning php Sql
am 25.05.2006 07:34:30 von Shion
Frankly wrote:
> "Frankly" wrote in message news:...
> I have now created 4 almost 5 tables.
>
> the ManagementBuildings table shows as 2 tables - I think that is because
> of
> 2 primary keys?
>
> I am now on the apartments table and for some reason I can not complete it.
> I know the structure of the this and the other tables still needs to be
> tuned - but why
> this.. it didnt happen on any of my other tables :(
>
> SQL query:
>
> CREATE TABLE `Apartments` (
>
> `ApartmentID` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
> `Rent` INT NOT NULL ,
> `Bedrooms` INT NOT NULL ,
> `ApartmentNumber` VARCHAR( 10 ) NOT NULL ,
> `MoveInDate` DATE NOT NULL ,
> `StillAvailable` ENUM NOT NULL ,
> `ApartmentContact` CHAR( 20 ) NOT NULL ,<----- this is where the problem
> is?.
> `ApartmentPhone` VARCHAR( 12 ) NOT NULL ,
> `Picture1` VARCHAR( 50 ) NOT NULL ,
> `Picture2` VARCHAR( 50 ) NOT NULL ,
> `Picture3` VARCHAR( 50 ) NOT NULL ,
> INDEX ( `Rent` )
> ) TYPE = MYISAM
>
> MySQL said:
>
> #1064 - You have an error in your SQL syntax. Check the manual that
> corresponds to your MySQL server version for the right syntax to use near
> 'NOT NULL, `ApartmentContact` CHAR(20) NOT NULL, `ApartmentPhone
The problem lies before the 'NOT NULL, `ApartmentContact` CHAR(20) NOT NULL,
`ApartmentPhone', with other words the ENUM after `StillAvailable`, I would
choose to use INT(1) where default is 1 and if not available then set it to 0.
as IF(1) results in a true and IF(0) results in false.
If you still want to struggle with ENUM, then take a look here
http://dev.mysql.com/doc/refman/5.0/en/enum.html
You may run into problems with the type CHAR later on too, I would choose to
use VARCHAR instead.
//Aho
Re: Learning php Sql
am 25.05.2006 10:42:31 von Frankly
"J.O. Aho" wrote in message
news:4dktv7F19ti0cU1@individual.net...
> Frankly wrote:
>> "Frankly" wrote in message news:...
>> I have now created 4 almost 5 tables.
>>
>> the ManagementBuildings table shows as 2 tables - I think that is
>> because of
>> 2 primary keys?
>>
>> I am now on the apartments table and for some reason I can not complete
>> it.
>> I know the structure of the this and the other tables still needs to be
>> tuned - but why
>> this.. it didnt happen on any of my other tables :(
>>
>> SQL query:
>>
>> CREATE TABLE `Apartments` (
>>
>> `ApartmentID` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
>> `Rent` INT NOT NULL ,
>> `Bedrooms` INT NOT NULL ,
>> `ApartmentNumber` VARCHAR( 10 ) NOT NULL ,
>> `MoveInDate` DATE NOT NULL ,
>> `StillAvailable` ENUM NOT NULL ,
>> `ApartmentContact` CHAR( 20 ) NOT NULL ,<----- this is where the problem
>> is?.
>> `ApartmentPhone` VARCHAR( 12 ) NOT NULL ,
>> `Picture1` VARCHAR( 50 ) NOT NULL ,
>> `Picture2` VARCHAR( 50 ) NOT NULL ,
>> `Picture3` VARCHAR( 50 ) NOT NULL ,
>> INDEX ( `Rent` )
>> ) TYPE = MYISAM
>>
>> MySQL said:
>>
>> #1064 - You have an error in your SQL syntax. Check the manual that
>> corresponds to your MySQL server version for the right syntax to use
>> near
>> 'NOT NULL, `ApartmentContact` CHAR(20) NOT NULL, `ApartmentPhone
>
> The problem lies before the 'NOT NULL, `ApartmentContact` CHAR(20) NOT
> NULL, `ApartmentPhone', with other words the ENUM after `StillAvailable`,
> I would choose to use INT(1) where default is 1 and if not available then
> set it to 0.
>
> as IF(1) results in a true and IF(0) results in false.
>
> If you still want to struggle with ENUM, then take a look here
> http://dev.mysql.com/doc/refman/5.0/en/enum.html
>
> You may run into problems with the type CHAR later on too, I would choose
> to use VARCHAR instead.
>
>
> //Aho
Hello.
I just dowloaded and did a few tutorials on ms visual web developer 2005
express.
seems like a great tool. but i am like the whole PHP thing. I dont really
know why and i am to tired to think.
thank you for helping me under stand that error message. I should have
picked up on the before "NULL" thing.
I wanted to ask this group about the whole varchar vs char thing. faster
searching vs smaller file size.
I have also done enum in tutorials. imto tired right now to try i am going
to bed and will try when i wake up.
i also found out today that the current version of MySQL isnt free. so i am
just a point or 2 away from the current free version. lol its 4:42 am.
--
Thank you
Frank
PHPmySQL1(remove)@yahoo.com
Re: Learning php Sql
am 25.05.2006 11:42:43 von Shion
Frankly wrote:
> I just dowloaded and did a few tutorials on ms visual web developer 2005
> express. seems like a great tool. but i am like the whole PHP thing.
> I dont really know why and i am to tired to think.
I'm not much for microsoft products when it comes to develop for the internet,
as they tend to generate a broken HTML/javascript that is more or less only
working on MSIE.
There are similar tools that are open source and which more closely follows
standards, which makes that the developed material works on most browsers.
For checking up open source projects, I do suggest you visit freshmeat.net,
where they have a quite large database over projects (not all open source).
> I wanted to ask this group about the whole varchar vs char thing. faster
> searching vs smaller file size.
This ain't anything I'm good at, but I have better experience to get varchar
to work than char, there is a mysql page about varcahr and char with some user
comments too. http://dev.mysql.com/doc/refman/5.0/en/char.html
> I have also done enum in tutorials. imto tired right now to try i am going
> to bed and will try when i wake up.
If the tutorial is written for a specific sql server, then it may use special
features for that sql server, which would make it to fail in mysql or any
other sql server. I do suggest you read the enum page I gave a link in my
previous page to see how enum works in mysql.
> i also found out today that the current version of MySQL isnt free. so i am
> just a point or 2 away from the current free version. lol its 4:42 am.
MySQL don't charge anything for the community version, and the latest version
supplied by my distro is 5.1.7, while you can download for free the 5.1.9 from
dev.mysql.com/downloads/mysql/5.1.html
Keep in mind that the 5.1 line is still a beta version and may not be that
good to use when stability is needed.
Hope you get a good sleep.
With best regards,
Aho
Re: Learning php Sql
am 25.05.2006 21:53:37 von Frankly
"J.O. Aho" wrote in message
news:4dlcglF1aln4kU1@individual.net...
> I'm not much for microsoft products when it comes to develop for the
> internet, as they tend to generate a broken HTML/javascript that is more
> or less only working on MSIE.
> There are similar tools that are open source and which more closely
> follows standards, which makes that the developed material works on most
> browsers.
>
> For checking up open source projects, I do suggest you visit
> freshmeat.net, where they have a quite large database over projects (not
> all open source).
in my deamweaver tutorial was the first time i heard about the generated
code that MS word will inport into a html document. i think that is what
you are talking about?
1 thing i did read about sql express is that it does not generate a code and
i believed they were talking about what i mentioned above. and again i am
not sure if this is what you meant.
i stopped working on the tutorial after creating a few tables but watched as
the data was entered
and then displayed on a web page. It felt good to see for the first time
the full path.
after what i seen yesterday you and this group is the only thing standing
between me and using that program. I feel more comfortable with in a
microsoft envirment but the help i am getting from here
gives me a much better feeling that I will actually do this. I am not
looking for something perfect, i think that would show an ignorance of what
is actually needed. All I can really hope for is something that is
functional. i am also concerned with how my wife will use it. she really
needs something like the forms in Access.
>
>
>
>> I wanted to ask this group about the whole varchar vs char thing. faster
>> searching vs smaller file size.
>
> This ain't anything I'm good at, but I have better experience to get
> varchar to work than char, there is a mysql page about varcahr and char
> with some user comments too.
> http://dev.mysql.com/doc/refman/5.0/en/char.html
that was 1 of many such conversations i have read. one of these days i will
google this group on the subject as I am sure it has come up.
>
>
>> I have also done enum in tutorials. imto tired right now to try i am
>> going to bed and will try when i wake up.
>
> If the tutorial is written for a specific sql server, then it may use
> special features for that sql server, which would make it to fail in mysql
> or any other sql server. I do suggest you read the enum page I gave a link
> in my previous page to see how enum works in mysql.
it was in the ebook Phpmyadmin mysql. I was thinking i would use the enum
for some feilds or perhaps
i should just - type yes or no for those types of fields.
DoorMan = Yes/No
Elevator = yes/no and so on
>
>
>> i also found out today that the current version of MySQL isnt free. so i
>> am just a point or 2 away from the current free version. lol its 4:42
>> am.
>
> MySQL don't charge anything for the community version, and the latest
> version supplied by my distro is 5.1.7, while you can download for free
> the 5.1.9 from dev.mysql.com/downloads/mysql/5.1.html
>
> Keep in mind that the 5.1 line is still a beta version and may not be that
> good to use when stability is needed.
>
>
> Hope you get a good sleep.
i think i did get about 3 1/2 hours. I had to wake up and do some work but
now I have to take another nap.
when i wake up I will correct that mistake, tune the tables, put some data
and start creating relations.
talk to you soon
>
>
> With best regards,
>
> Aho
thank you again.
Frank
Re: Learning php Sql
am 28.05.2006 09:01:05 von Shion
Frankly wrote:
> "J.O. Aho" wrote in message
> news:4dlcglF1aln4kU1@individual.net...
>> I'm not much for microsoft products when it comes to develop for the
>> internet, as they tend to generate a broken HTML/javascript that is more
>> or less only working on MSIE.
>> There are similar tools that are open source and which more closely
>> follows standards, which makes that the developed material works on most
>> browsers.
>>
>> For checking up open source projects, I do suggest you visit
>> freshmeat.net, where they have a quite large database over projects (not
>> all open source).
>
> in my deamweaver tutorial was the first time i heard about the generated
> code that MS word will inport into a html document. i think that is what
> you are talking about?
No, programs that are made in mind for only microsoft tend only support the
broken html/javascript that microsoft uses as "standard" to break
compatibility toward browsers that follows the more official standard from w3c.
Open source projects tends to follow the w3c standard, which makes it works to
work in most browsers, even msie.
> after what i seen yesterday you and this group is the only thing standing
> between me and using that program. I feel more comfortable with in a
> microsoft envirment but the help i am getting from here
> gives me a much better feeling that I will actually do this. I am not
> looking for something perfect, i think that would show an ignorance of what
> is actually needed. All I can really hope for is something that is
> functional. i am also concerned with how my wife will use it. she really
> needs something like the forms in Access.
If you use PHP and make your own set of scripts, you can make it exactly as
you wife want it to be, which would be easier than for her to use access (you
can still link things toward what ever database or even text files in the
background).
If you want help with linux, there are many newsgroups and all I have been
subscribing to have been helpful and friendly. I do suggest you first look for
a newsgroup that is linked to your distro of choice, this gives you usually
better help. If you don't fuind any good newsgroup you have alt.linux, do
avoid comp.os.linux.x as long as you don't have questions about X Windows
System and things related to it (there are all to many who tries to ask help
for miscellaneous questions, but seldom get any help).
>>> I have also done enum in tutorials. imto tired right now to try i am
>>> going to bed and will try when i wake up.
>> If the tutorial is written for a specific sql server, then it may use
>> special features for that sql server, which would make it to fail in mysql
>> or any other sql server. I do suggest you read the enum page I gave a link
>> in my previous page to see how enum works in mysql.
>
> it was in the ebook Phpmyadmin mysql. I was thinking i would use the enum
> for some feilds or perhaps
> i should just - type yes or no for those types of fields.
> DoorMan = Yes/No
> Elevator = yes/no and so on
I think you need to define the values for yes and no, but I still think it's
easier to use 0/1 as they are easy to use in a if-statment (both within SQL
and in PHP).
I hope your SQL work has gone well, I guess it has as you haven't posted
anything else as far as I can see.
//Aho
Re: Learning php Sql
am 28.05.2006 22:52:38 von Frankly
"J.O. Aho" wrote in message
news:4dt05hF1c7eeoU1@individual.net...
> No, programs that are made in mind for only microsoft tend only support
> the broken html/javascript that microsoft uses as "standard" to break
> compatibility toward browsers that follows the more official standard from
> w3c.
>
> Open source projects tends to follow the w3c standard, which makes it
> works to work in most browsers, even msie.
I babbled in this post and most of my questions that i asked are just my
thoughts i think you can tell
what is important for me to actually know now. the one area i would love to
hear your oppinions are is
to sever or not to server.
as you have probably guessed i have spent the last couple of days checking
out
studio express. I got all the way up to finding a web host and that is when
i felt
i didnt want to be stuck with ms at the same time i dont like being at the
mercy of hosting companies.
>
> If you use PHP and make your own set of scripts, you can make it exactly
> as you wife want it to be, which would be easier than for her to use
> access (you can still link things toward what ever database or even text
> files in the background).
>
> If you want help with linux, there are many newsgroups and all I have been
> subscribing to have been helpful and friendly.
I do suggest you first look for
> a newsgroup that is linked to your distro of choice, this gives you
> usually better help. If you don't fuind any good newsgroup you have
> alt.linux, do avoid comp.os.linux.x as long as you don't have questions
> about X Windows System and things related to it (there are all to many who
> tries to ask help for miscellaneous questions, but seldom get any help).
i was looking into Redhat although someone with your knowledge might use
something more like
slackware which is not so dumbed down.
I have talked to my wife and think that if it makes it easier and better for
us that perhaps i should get a server. I would like 1 day to open an office
and have a few computers (about 5) connected to a server.
the 2 computers we have now we both need. I really wonder what it would
take to have my own server, run current editions of mysql and what ever gui
i choose. i can not see spending more than a dsl line ( right now ) and
wonder if that would be enough for about 5 visitors at a time. the DSL line
is the fastest verizon offers and for the most part the speed is good. is
it worth it to have full control - this i do not know.
could i buy a good server and install a cheap version of linux? the most I
could put together is $1000.
and also security is an issue. perhaps it is better to wait.
please tell me what you think about this idea and if you think it sounds
good.
what is the cheapest version someone with my knowledge can get?
i will however still have access to the internet while working so that is
good- incase i need help
i guess the bottom line is can you help me configure a good server for about
$1000 that will also
be an investment for later on?
do you think a dsl line will be powerful enough or should i just stick to
what web hosts offer.
security is also an issue.
>> it was in the ebook Phpmyadmin mysql. I was thinking i would use the
>> enum for some feilds or perhaps
>> i should just - type yes or no for those types of fields.
>> DoorMan = Yes/No
>> Elevator = yes/no and so on
>
> I think you need to define the values for yes and no, but I still think
> it's easier to use 0/1 as they are easy to use in a if-statment (both
> within SQL and in PHP).
Say No More :) - you had me with "I would choose" from your last reply.
I was actually thinking about this last night. i do remember reading
something about 0/1 I am just not sure where i read it - does access have
something like a(-1/0 for if statments)? i think i remember something about
that to.
thank you for not only helping me but for also sharing what you know.
>
>
>
> I hope your SQL work has gone well, I guess it has as you haven't posted
> anything else as far as I can see.
>
>
> //Aho
Trust me my friend, I am very grateful to you already and would not leave
with out saying a thank you.
and will probably always atleast lurk here.
there are other things happening in my life that are getting in the way as
well.
there have been so many posts I deleted and have saved on my desk top - i
dont want to bore you to death.
the last choice i have to make is - to have my own server and total control
or settle with old versions of mysql and what ever gui they offer.
another reason is i feel funny that i have not completed the database yet
and it probably looks like i am not trying my best. while my writting does
not let me express myself very well. in the last couple of months I have
learned alot about my choices.
well in the past i would have deleted this.... see what you been missing :).
if you feel i would be better off just using what my host offers i will go
that way.
i look foward to the day that I can return this favor and i do believe I
can.
you have a friend in New York.
--
Thank you
Frank
PHPmySQL1(remove)@yahoo.com
Re: Learning php Sql
am 29.05.2006 06:18:03 von Shion
Frankly wrote:
> "J.O. Aho" wrote in message
> as you have probably guessed i have spent the last couple of days checking
> out
> studio express. I got all the way up to finding a web host and that is when
> i felt
> i didnt want to be stuck with ms at the same time i dont like being at the
> mercy of hosting companies.
>
There are a number of web hotels which do provide php/mysql for their
subscribers, you find them easily with a google search or hang in alt.php for
a while, sooner or later some spammer will make a post.
>> If you want help with linux, there are many newsgroups and all I have been
>> subscribing to have been helpful and friendly.
>> I do suggest you first look for
>> a newsgroup that is linked to your distro of choice, this gives you
>> usually better help. If you don't fuind any good newsgroup you have
>> alt.linux, do avoid comp.os.linux.x as long as you don't have questions
>> about X Windows System and things related to it (there are all to many who
>> tries to ask help for miscellaneous questions, but seldom get any help).
>
> i was looking into Redhat although someone with your knowledge might use
> something more like slackware which is not so dumbed down.
I did begin with RedHat and I think it was a quite good distro (other won't),
RPM with it's deep dependency checks does see to that you won't easily break
your system and today when named Fedora it has easy to use package installer
that fixes dependencies when you select to install something (from online)
that you don't currently have the full dependency for.
There are two things that I think is a drawback for RedHat/Fedora nowadays and
it's the extensive use of Gnome2 (it's not that user friendly and developers
don't listen to endusers and claims people don't know anything, attacks
against mr Torvalds and Mr Cox I have seen), sadly most distros today are
quite gnomy2fied even distros who claims that the user has the freedom to
choose like Gentoo. The other thing is that you have to hassle quite a lot to
get your kernel-source for the official kernels (this used to be provided as a
already made package, but now you need to rebuild the source-rpm to get the
kernel source).
What matter is that you feel you have the right distro, not what others thinks
is the right one.
> I have talked to my wife and think that if it makes it easier and better for
> us that perhaps i should get a server. I would like 1 day to open an office
> and have a few computers (about 5) connected to a server.
> the 2 computers we have now we both need. I really wonder what it would
> take to have my own server, run current editions of mysql and what ever gui
> i choose.
A server should run without GUI, better performance and better usage of ram.
As long as you don't run any X Windows Server, you can manage with a Pentium
266 with 256MB ram, directly when you add X Windows System you will need IMHO
at least a PII-600 with 512MB. Keep in mind that more ram is always better,
for harddrive 20GB will be okey, depending on how much data you will have and
you can always later on add another harddrive.
> i can not see spending more than a dsl line ( right now ) and
> wonder if that would be enough for about 5 visitors at a time.
You can manage that kind of traffic (if you don't have much images) with a 56k
modem, the more images and the larger they are the more bandwidth you need.
> could i buy a good server and install a cheap version of linux? the most I
> could put together is $1000.
I think you can manage with a machine that is under US$500 and you can always
download the linux directly from the net (it's legal) and then burn it out on
a CD or DVD (depending on the iso). Of course if you buy a copy from a compnay
like RedHat (they sell only expensive versions nowadays) you get a load of
extra programs that aren't covered by GPL and a good support.
For a home user I think the free version and newsgroups are a better option.
> and also security is an issue. perhaps it is better to wait.
Just see to that the up2date (or what the distro will use) is run and keeps
your machine with the latest packages all the time.
> what is the cheapest version someone with my knowledge can get?
US$0, take a look at www.linuxiso.org
> i will however still have access to the internet while working so that is
> good- incase i need help
> i guess the bottom line is can you help me configure a good server for about
> $1000 that will also
> be an investment for later on?
Just any personal computer will work, you can add on things later on. Just
avoid those compact machines from Compaq.
> do you think a dsl line will be powerful enough or should i just stick to
> what web hosts offer. security is also an issue.
I thuink you can manage with dsl and the update programs that comes with the
installation sees to you don't have bugs and of course enable an iptable rule
(you usualy select how hard security at install) to use, which keeps unwanted
people out.
> Say No More :) - you had me with "I would choose" from your last reply.
> I was actually thinking about this last night. i do remember reading
> something about 0/1 I am just not sure where i read it - does access have
> something like a(-1/0 for if statments)? i think i remember something about
> that to.
> thank you for not only helping me but for also sharing what you know.
I'm sorry, don't use access so don't know, but it can be used in any database
that uses sql.
With best regards,
Aho
Re: Learning php Sql Read Me First.
am 29.05.2006 17:47:34 von Frankly
"J.O. Aho" wrote in message
news:4dvavrF1cebhnU1@individual.net...
> Frankly wrote:
>> "J.O. Aho" wrote in message
> I did begin with RedHat and I think it was a quite good distro (other
> won't), RPM with it's deep dependency checks does see to that you won't
> easily break your system and today when named Fedora it has easy to use
> package installer that fixes dependencies when you select to install
> something (from online) that you don't currently have the full dependency
> for.
>
> There are two things that I think is a drawback for RedHat/Fedora nowadays
> and it's the extensive use of Gnome2 (it's not that user friendly and
> developers don't listen to endusers and claims people don't know anything,
> attacks against mr Torvalds and Mr Cox I have seen), sadly most distros
> today are quite gnomy2fied even distros who claims that the user has the
> freedom to choose like Gentoo. The other thing is that you have to hassle
> quite a lot to get your kernel-source for the official kernels (this used
> to be provided as a already made package, but now you need to rebuild the
> source-rpm to get the kernel source).
>
> What matter is that you feel you have the right distro, not what others
> thinks is the right one.
One day I will get there. I love a challenge but never really had anyone to
help me with my computer questions.
i never had to bring any computer into get fixed.. well atleast i can change
parts :).
>
> A server should run without GUI, better performance and better usage of
> ram. As long as you don't run any X Windows Server, you can manage with a
> Pentium 266 with 256MB ram, directly when you add X Windows System you
> will need IMHO at least a PII-600 with 512MB. Keep in mind that more ram
> is always better, for harddrive 20GB will be okey, depending on how much
> data you will have and you can always later on add another harddrive.
i think the best thing to do is wait and first get the web site going. then
after that I can take my time
learn a little more about servers and see if it is really needed.
>
>
>> i can not see spending more than a dsl line ( right now ) and wonder if
>> that would be enough for about 5 visitors at a time.
>
> You can manage that kind of traffic (if you don't have much images) with a
> 56k modem, the more images and the larger they are the more bandwidth you
> need.
I must say that I have done a good job in the past building a static page
( front page ) for her and there were
days that i had about 250 hits. I am happy to say that when i do put my
mind to something I dont stop
until i get it right. however I have reached a point that I cant keep up
with things like this. I need to be able to update
the database and the web site at the same time.
>
>> could i buy a good server and install a cheap version of linux? the most
>> I could put together is $1000.
>
> I think you can manage with a machine that is under US$500 and you can
> always download the linux directly from the net (it's legal) and then burn
> it out on a CD or DVD (depending on the iso). Of course if you buy a copy
> from a compnay like RedHat (they sell only expensive versions nowadays)
> you get a load of extra programs that aren't covered by GPL and a good
> support.
> For a home user I think the free version and newsgroups are a better
> option.
when the site is up and going i will begin to look into this more. I always
wanted to try Linux
I have a feeling once i do, i will also say goobye to M$
>
>
>> and also security is an issue. perhaps it is better to wait.
>
> Just see to that the up2date (or what the distro will use) is run and
> keeps your machine with the latest packages all the time.
that is good news, i thought it was something i had to do.
>
>
>> what is the cheapest version someone with my knowledge can get?
>
> US$0, take a look at www.linuxiso.org
>
>
>> i will however still have access to the internet while working so that is
>> good- incase i need help
>> i guess the bottom line is can you help me configure a good server for
>> about $1000 that will also
>> be an investment for later on?
>
> Just any personal computer will work, you can add on things later on. Just
> avoid those compact machines from Compaq.
HP is also the same company. they do offer good prices :(.
>
>
>> do you think a dsl line will be powerful enough or should i just stick to
>> what web hosts offer. security is also an issue.
>
> I thuink you can manage with dsl and the update programs that comes with
> the installation sees to you don't have bugs and of course enable an
> iptable rule (you usualy select how hard security at install) to use,
> which keeps unwanted people out.
>
>
>> Say No More :) - you had me with "I would choose" from your last reply.
>> I was actually thinking about this last night. i do remember reading
>> something about 0/1 I am just not sure where i read it - does access have
>> something like a(-1/0 for if statments)? i think i remember something
>> about that to.
>> thank you for not only helping me but for also sharing what you know.
>
> I'm sorry, don't use access so don't know, but it can be used in any
> database that uses sql.
>
>
>
> With best regards,
>
> Aho
i could also be mistaken about the -1 thing. I have read so much lately it
will be much better now that I am only going to focus on php and mysql. I
will see you soon with my best ( for now ) shot at database design. I hope
for your monitors sake you were not drinking coffee :).
i wrote this part first and later added the rest..
opps to late :). i was going to tell you not to bother with that post about
the servers.
after the wine wore off I realized this would be the wrong time to do
something like that.
I created the apartments table 5 times yesterday. that damn 18000 seconds
thing got me a few times and dumped my table. I have a couple of more
tables to make, attributes to add and so on.
when i feel i have done my best with the tables I will show them here before
i start messing with relations.
i think i understand now about admin rights as far as being able to upload
the latest mysql however I was exploring my domane admin features and
found.
settings, server info, installed perl modules.
latest release: DBD-mysql-3.0004 -----
Bundle::DBD::mysql - a bundle to install perl drivers to msql or mysql.
anyway below is the web site
http://search.cpan.org/~rudy/DBD-mysql-2.9008/
I have found others web hosts that support php/mysql. I guess the same
thing would happen there.
I have what is there and that is always what I will have. I guess it would
be wise to find one with a stable version the last of the version 4's would
be a god choice.. I think today I might look again.
--
Thank you
Frank
PHPmySQL1(remove)@yahoo.com
Re: Learning php Sql Read Me First.
am 29.05.2006 18:38:49 von Shion
Frankly wrote:
> "J.O. Aho" wrote in message
>> Frankly wrote:
>>> could i buy a good server and install a cheap version of linux? the most
>>> I could put together is $1000.
>> I think you can manage with a machine that is under US$500 and you can
>> always download the linux directly from the net (it's legal) and then burn
>> it out on a CD or DVD (depending on the iso). Of course if you buy a copy
>> from a compnay like RedHat (they sell only expensive versions nowadays)
>> you get a load of extra programs that aren't covered by GPL and a good
>> support.
>> For a home user I think the free version and newsgroups are a better
>> option.
>
> when the site is up and going i will begin to look into this more. I always
> wanted to try Linux I have a feeling once i do, i will also say goobye to M$
Some do like it, others not. There are other options too, BSD is quite similar
from user point of view, but regarded as more secure. A nice one that uses GUI
is QNX, there should be a demo version to download at www.qnx.com, the good
with this one is that you don't have to install it to test it (there are linux
that works the same way and are called LiveCD distros).
HaikuOS is under development, it's based on BeOS, which is a quite user
friendly OS, think you should keep your eyes open for this one.
>>> and also security is an issue. perhaps it is better to wait.
>> Just see to that the up2date (or what the distro will use) is run and
>> keeps your machine with the latest packages all the time.
>
> that is good news, i thought it was something i had to do.
I feel I have more control doing updates manually, but for those who don't
feel as sure about things an update tool is quite useful and the one included
in RedHat/Fedora can be configured quite a lot, so you can tell it to update
some packages but never others, you can tell it just to tell you if there is
an update or not without upgrading and let you to choose what to upgrade and
of course to make everything to be automatic so you don't have to do anything
at all.
>> Just any personal computer will work, you can add on things later on. Just
>> avoid those compact machines from Compaq.
> HP is also the same company. they do offer good prices :(.
I don't have any experience of HP computers, but one branded as HP don't have
to be the same as another branded Compaq, there is at least on the laptop
machines a quite big difference.
> i could also be mistaken about the -1 thing. I have read so much lately it
> will be much better now that I am only going to focus on php and mysql. I
> will see you soon with my best ( for now ) shot at database design. I hope
> for your monitors sake you were not drinking coffee :).
Not sure we are talking about the same thing, but in if-statments you get the
following results
if(0) = false
if(1) = true
if(2) = true
if(-1) = true
> I created the apartments table 5 times yesterday. that damn 18000 seconds
> thing got me a few times and dumped my table. I have a couple of more
> tables to make, attributes to add and so on.
> when i feel i have done my best with the tables I will show them here before
> i start messing with relations.
> i think i understand now about admin rights as far as being able to upload
> the latest mysql however I was exploring my domane admin features and
> found.
> settings, server info, installed perl modules.
> latest release: DBD-mysql-3.0004 -----
> Bundle::DBD::mysql - a bundle to install perl drivers to msql or mysql.
> anyway below is the web site
> http://search.cpan.org/~rudy/DBD-mysql-2.9008/
> I have found others web hosts that support php/mysql. I guess the same
> thing would happen there.
> I have what is there and that is always what I will have. I guess it would
> be wise to find one with a stable version the last of the version 4's would
> be a god choice.. I think today I might look again.
Perl is another language, which been quite popular before PHP and still quite
widely used, the dbd-mysql is a module that allows Perl to communicate with
mysql in the same way as php can communicate with mysql. This isn't needed for
php and the version has nothing to do with the version of mysql.
On my server the 3.0002 is installed and on my workstation I have 2.9007, as
they use different CPUs (server is powerpc and workstation is x86) they will
have different versions of programs installed as one may be marked as stable
on powerpc and be unstable on x86 or the other way around.
A good web hotel who offers mysql should run 4.1.x, and php 5.x, if using
older I think they are out of date. Soon mysql 5.0/5.1 should be stable too,
which gives better features. Avoid a hotel who offers mysql 3.x, they are
really outdated IMHO and see to that the php is at least version 4.1.x.
I hope this clears some "questions", if anything else, php/mysql/linux, just
ask :) Okey, now it's time for me to make some pancakes.
//Aho
Re: Learning php Sql Read Me First.
am 30.05.2006 18:14:28 von Frankly
"J.O. Aho" wrote in message
news:4e0mcpF1cj02jU1@individual.net...
>
>
>> i could also be mistaken about the -1 thing. I have read so much lately
>> it will be much better now that I am only going to focus on php and
>> mysql. I will see you soon with my best ( for now ) shot at database
>> design. I hope for your monitors sake you were not drinking coffee :).
>
> Not sure we are talking about the same thing, but in if-statments you get
> the following results
>
> if(0) = false
> if(1) = true
> if(2) = true
> if(-1) = true
I guess someplace they used the -1 in the example. I cant wait to start
doing statments.
> Perl is another language, which been quite popular before PHP and still
> quite widely used, the dbd-mysql is a module that allows Perl to
> communicate with mysql in the same way as php can communicate with mysql.
> This isn't needed for php and the version has nothing to do with the
> version of mysql.
>
> On my server the 3.0002 is installed and on my workstation I have 2.9007,
> as they use different CPUs (server is powerpc and workstation is x86) they
> will have different versions of programs installed as one may be marked as
> stable on powerpc and be unstable on x86 or the other way around.
>
> A good web hotel who offers mysql should run 4.1.x, and php 5.x, if using
> older I think they are out of date. Soon mysql 5.0/5.1 should be stable
> too, which gives better features. Avoid a hotel who offers mysql 3.x, they
> are really outdated IMHO and see to that the php is at least version
> 4.1.x.
>
>
> I hope this clears some "questions", if anything else, php/mysql/linux,
> just ask :) Okey, now it's time for me to make some pancakes.
>
>
>
> //Aho
yes, many thoughts of questions :) are now clear. We will get back to linux
in the near future.
perhaps i can use my old laptop.
I did try to find these answers but couldnt in a way that I can understand.
I wont be inserting pictures in the database but links or statements to
pictures.. would that data type be varchar?
I also had a hard time with hyper links - I understand there is no hyperlink
data type so would that also be varchar?
if only PHP can be used to remove the calories from pancakes.
--
Thank you
Frank
PHPmySQL1(remove)@yahoo.com
Re: Learning php Sql Read Me First.
am 30.05.2006 19:17:13 von Shion
Frankly wrote:
> "J.O. Aho" wrote in message
> news:4e0mcpF1cj02jU1@individual.net...
>>
>>> i could also be mistaken about the -1 thing. I have read so much lately
>>> it will be much better now that I am only going to focus on php and
>>> mysql. I will see you soon with my best ( for now ) shot at database
>>> design. I hope for your monitors sake you were not drinking coffee :).
>> Not sure we are talking about the same thing, but in if-statments you get
>> the following results
>>
>> if(0) = false
>> if(1) = true
>> if(2) = true
>> if(-1) = true
>
> I guess someplace they used the -1 in the example. I cant wait to start
> doing statments.
>
>
>
>> Perl is another language, which been quite popular before PHP and still
>> quite widely used, the dbd-mysql is a module that allows Perl to
>> communicate with mysql in the same way as php can communicate with mysql.
>> This isn't needed for php and the version has nothing to do with the
>> version of mysql.
>>
>> On my server the 3.0002 is installed and on my workstation I have 2.9007,
>> as they use different CPUs (server is powerpc and workstation is x86) they
>> will have different versions of programs installed as one may be marked as
>> stable on powerpc and be unstable on x86 or the other way around.
>>
>> A good web hotel who offers mysql should run 4.1.x, and php 5.x, if using
>> older I think they are out of date. Soon mysql 5.0/5.1 should be stable
>> too, which gives better features. Avoid a hotel who offers mysql 3.x, they
>> are really outdated IMHO and see to that the php is at least version
>> 4.1.x.
>>
>>
>> I hope this clears some "questions", if anything else, php/mysql/linux,
>> just ask :) Okey, now it's time for me to make some pancakes.
>>
>>
>>
>> //Aho
>
>
> yes, many thoughts of questions :) are now clear. We will get back to linux
> in the near future.
> perhaps i can use my old laptop.
> I did try to find these answers but couldnt in a way that I can understand.
> I wont be inserting pictures in the database but links or statements to
> pictures.. would that data type be varchar?
Short text, up to 255 characters long can be stored in a column that uses
varchar().
There are types for big size text too, think it's text.
If you want to store images in the database, then blob is the type to use.
> I also had a hard time with hyper links - I understand there is no hyperlink
> data type so would that also be varchar?
Yes, as it's really a text, varchar is a good option here too, as long as you
know your links are less than 255 characters (usually is).
> if only PHP can be used to remove the calories from pancakes.
Yeah, just code a load of PHP scripts and you will consume all the calories :P
//Aho
Re: Learning php Sql Read Me First.
am 01.06.2006 18:16:02 von Frankly
>> yes, many thoughts of questions :) are now clear. We will get back to
>> linux in the near future.
>> perhaps i can use my old laptop.
>> I did try to find these answers but couldnt in a way that I can
>> understand.
>> I wont be inserting pictures in the database but links or statements to
>> pictures.. would that data type be varchar?
>
> Short text, up to 255 characters long can be stored in a column that uses
> varchar().
>
> There are types for big size text too, think it's text.
>
> If you want to store images in the database, then blob is the type to use.
isnt it better not to store images in the database. I am thinking about 4
pics per apartment at about 65k. I have found about 200 buildings some of
which are well above 25 flights and about 15 apartments per floor and of
course I have 4 floor walk ups and have talked many into faxing me when
apartments become available for others i was told to call every 2 weeks. <--
DateLastCalled in managements table will be needed.
apartments in the same line can share pictures soooo I should also have
ApartmentNumber indexed.
I have a pretty good print out of all the file types.
Text is 65,535 characters. I will be using about 4 varchars at 255 for
details.
as far as what to do with the pictures I must have read that 100 time. I am
sure i can find it again.
>
>
>> I also had a hard time with hyper links - I understand there is no
>> hyperlink data type so would that also be varchar?
>
> Yes, as it's really a text, varchar is a good option here too, as long as
> you know your links are less than 255 characters (usually is).
as i understand it just typing in the hyper link would make it just text.
dont i have to do some kind of script? when the properties are shown I
would like there to be a
hyper link to that apartments page. I am not going to do that now. I would
like to table structure to be ready for when I am ready.
>
>
>> if only PHP can be used to remove the calories from pancakes.
>
> Yeah, just code a load of PHP scripts and you will consume all the
> calories :P
>
>
>
> //Aho
i have a feelings my hair will suffer the biggest loss.
Frank
Re: Learning php Sql Read Me First.
am 01.06.2006 19:44:22 von zac.carey
> isnt it better not to store images in the database.
I wouldn't store the images in the database, just store the paths to
the images. It's common practice to store things like that outside of
the server path, i.e. not in the htdocs directory, and then create a
php 'include file' that contains information about the
whereabouts of the images folder.
> as i understand it just typing in the hyper link would make it just text.
> dont i have to do some kind of script?
Yes. In php, you use html to create the hyperlink, just like normal
html - except you might write it something like this (untested):
echo "Look inside this
apartment\n";
where $img is the path to the folder (as assigned by the include file)
and $row['img_id'] is the name of the associated image.
Incidentally, the following script purports to reduce the calorie
intake from pancakes (again untested);
Pancake Calorie Content Reducer
echo "EAT FEWER PANCAKES";
?>
Re: Learning php Sql Read Me First.
am 01.06.2006 20:27:49 von Shion
Frankly wrote:
>>> yes, many thoughts of questions :) are now clear. We will get back to
>>> linux in the near future.
>>> perhaps i can use my old laptop.
>>> I did try to find these answers but couldnt in a way that I can
>>> understand.
>>> I wont be inserting pictures in the database but links or statements to
>>> pictures.. would that data type be varchar?
>> Short text, up to 255 characters long can be stored in a column that uses
>> varchar().
>>
>> There are types for big size text too, think it's text.
>>
>> If you want to store images in the database, then blob is the type to use.
>
> isnt it better not to store images in the database.
Yes, you are right, it's better to store them outside the database, but the
option to store the images in the database exist.
> I am thinking about 4
> pics per apartment at about 65k. I have found about 200 buildings some of
> which are well above 25 flights and about 15 apartments per floor and of
> course I have 4 floor walk ups and have talked many into faxing me when
> apartments become available for others i was told to call every 2 weeks. <--
> DateLastCalled in managements table will be needed.
> apartments in the same line can share pictures soooo I should also have
> ApartmentNumber indexed.
> I have a pretty good print out of all the file types.
> Text is 65,535 characters. I will be using about 4 varchars at 255 for
> details.
>
> as far as what to do with the pictures I must have read that 100 time. I am
> sure i can find it again.
>
>
>>
>>> I also had a hard time with hyper links - I understand there is no
>>> hyperlink data type so would that also be varchar?
>> Yes, as it's really a text, varchar is a good option here too, as long as
>> you know your links are less than 255 characters (usually is).
>
> as i understand it just typing in the hyper link would make it just text.
No, or yes... hyperlinks are just a string
regardless if you store it in a standard html page or in a database or use php
to generate the hyperlink, it will work the same way when the user sees it.
of course when you store it in the database, you only store the url and let
the php script add the html-tags.
> dont i have to do some kind of script? when the properties are shown I
> would like there to be a
> hyper link to that apartments page. I am not going to do that now. I would
> like to table structure to be ready for when I am ready.
Yes, of course you will need some kind of script here, specially when you are
generating a lot of dynamic pages that aren't really stored. You link all the
apartments to the same script page, but you have a variable that tells which
apartments data should be displayed.
//Aho
Re: Learning php Sql
am 06.06.2006 05:17:01 von Frankly
"J.O. Aho" wrote in message
news:4djlggF1a9i4hU1@individual.net...
> If you dare, you could take the step over to the unix world and install
> GNU/Linux or BSD of some kind, you will most often get a package manager
> that will help you keep your machine up to date and have quite recent
> versions of apache, mysql and php installed. IMHO an unix like OS is a lot
> better fit for server work than microsoft is (even microsoft uses BSD and
> Linux for servers).
>
> I know many microsoft users who sets up a home server using Linux,
> installs a desktop version with the server applications they want to use,
> this is vast of CPU power, as the X Window system will use up many CPU
> cycles and memory too, which better could be used on the server
> applications. For decent server distros, take a look at SoL
> www.sol-linux.com, Trustix www.trustix.net or Gentoo www.gentoo.org. I
> think SoL and Trustix are best options, Gentoo does offer more packages,
> but requires more from the user and in some cases forces you to do some
> serious hacking as the maintainers don't make good choices.
>
>
>
> //Aho
I dont know if the "if you dare" was a warning that it is beyond me. to
tell you the truth i was just looking at the www.sol-linux.com site. i
really would like to try all this but afraid of 2 things. 1 that I am
imposing on your kindness and 2 that I will be left halfway through. i dont
have much luck in usenet. might be because the way I write or that I become
anal or even that i may sound like i am not trying hard enough. today I
actually took off from work and looked into a few things you have mentioned.
I am trying to figure out that damn linux and just learned that GNU is an
OS.
I am looking into the IBM, eServer X206m and think its a go. I think it
goes for about $700.
I want full control over what PHP and mysql versions I can have and it looks
like that is the only way.
http://www-8.ibm.com/servers/eserver/in/xseries/x206m/
cnet gave it pretty good reviews.
I have 2 tutorials for Unix and have looked at them. but with out a machine
to work on they are pretty useless.
I would love something like what you mentioned in another post. that will
helpe me keep my mysql, php and other things up todate.
Trustix looks like it may be easier - but my guess is as bad as any other
total newbie that has only used windows.
Thank you and the rest of the group for being so patient with me. I think
you have some idea of how little I know. what set up would you recommend.
because i dont know what I need with what and what cancells out something
else. i think you would have no problem with the IBM server i mentioned
above but what do i get with it? i am willing to try this server thing
because I feel that it will only put me back 1 week. that is just a total
guess. but when I am done I will have full control and pic what I want to
use. i notice you posted in alt.linux but for some reason my news server
doesnt show that group.
i would like to try this but what gets me very nervous is that maybe it is
beyond me. with all the help you have already given me i still dont know
what to get.
the wife better get me something good for fathers day.
Thank you
Frank
Re: Learning php Sql Read Me First.
am 06.06.2006 05:21:30 von Frankly
"strawberry" wrote in message
news:1149183862.532915.143440@i39g2000cwa.googlegroups.com.. .
>
>> isnt it better not to store images in the database.
>
> I wouldn't store the images in the database, just store the paths to
> the images. It's common practice to store things like that outside of
> the server path, i.e. not in the htdocs directory, and then create a
> php 'include file' that contains information about the
> whereabouts of the images folder.
>
>> as i understand it just typing in the hyper link would make it just text.
>> dont i have to do some kind of script?
>
> Yes. In php, you use html to create the hyperlink, just like normal
> html - except you might write it something like this (untested):
>
> echo "Look inside this
> apartment\n";
>
> where $img is the path to the folder (as assigned by the include file)
> and $row['img_id'] is the name of the associated image.
>
> Incidentally, the following script purports to reduce the calorie
> intake from pancakes (again untested);
>
> Pancake Calorie Content Reducer
>
>
> echo "EAT FEWER PANCAKES";
> ?>
>
>
please dont think i am ignoring you or take my not replying as anything bad.
I do thank you and i am sure i will have some questions when i get up to
this point. but i do thank you in a way for helping me look into the future
for the things I will need to do.
the only thing I have now that I will probably be using in the end is
dreamweaver 8 - however by the time i am done will i really need it. i did
learn that a great way to make web pages is using tables and have already
made a few.
Frank
Re: Learning php Sql
am 06.06.2006 06:50:23 von Shion
Frankly wrote:
> I dont know if the "if you dare" was a warning that it is beyond me.
No, it's not a warning, but I have noticed that microsoft users are less
willing to try out other things compared with say macos users.
> I want full control over what PHP and mysql versions I can have and it looks
> like that is the only way.
> http://www-8.ibm.com/servers/eserver/in/xseries/x206m/
> cnet gave it pretty good reviews.
Of course buying a server with Linux preinstalled would give you a machine you
can use at once, but I think you can get things cheaper by setting together
your own machine and if you have enough old stuff that you can reassemble into
a computer you will have saved all the $700.
I think there are a couple of companies who sells machines with preinstalled
Linux on them, all over in US, here in Europe they refuse.
> I have 2 tutorials for Unix and have looked at them. but with out a machine
> to work on they are pretty useless.
> I would love something like what you mentioned in another post. that will
> helpe me keep my mysql, php and other things up todate.
up2date is a tool for RedHat/Fedora, but there are similar tools for other
distros too, for Gentoo it's built into it's package manager.
> Trustix looks like it may be easier - but my guess is as bad as any other
> total newbie that has only used windows.
It's based on RedHat, with a good deal of extra like buffer out of range
protection in the compiler, SELinux kernel (NSA made some kernel patches to
make the kernel more secure).
> Thank you and the rest of the group for being so patient with me. I think
> you have some idea of how little I know. what set up would you recommend.
> because i dont know what I need with what and what cancells out something
> else. i think you would have no problem with the IBM server i mentioned
> above but what do i get with it? i am willing to try this server thing
> because I feel that it will only put me back 1 week. that is just a total
> guess. but when I am done I will have full control and pic what I want to
> use.
Almost every distro that you can find at www.distrowatch.com will include
MySQL, PHP and Apache as part of the packages that is included on the CDs/DVD,
one exception I think is Linspear and is far from a distro I would recommend.
I don't know what IBM does offer in their server packages, can be better to
call them and ask.
> i notice you posted in alt.linux but for some reason my news server
> doesnt show that group.
Thats a bit sad, as IMHO it's one of the better newsgroups that isn't tied to
a distro, but you can still use the google for accessing the newsgroup at
http://groups.google.com/group/alt.linux?lnk=gschg
> i would like to try this but what gets me very nervous is that maybe it is
> beyond me. with all the help you have already given me i still dont know
> what to get.
I would suggest you use an old computer and use it to play with Linux until
you either feel you are ready to use it or that you feel that you can't leave
microsoft, this way you won't waste money (or at least not much).
Another option if you just want to try out Linux, is to use a LiveCD, as it
won't need any installation, here is a list of different LiveCD distros (and a
bunch of rescue CDs too) you can pick from: http://www.livecdlist.com/index.php
Which one is the best I don't know, but knoppix is one of the popular ones.
//Aho
Re: Learning php Sql
am 06.06.2006 18:16:51 von Frankly
"J.O. Aho" wrote in message
news:4ekfsfF1el5udU1@individual.net...
> Frankly wrote:
>
>> I dont know if the "if you dare" was a warning that it is beyond me.
>
> No, it's not a warning, but I have noticed that microsoft users are less
> willing to try out other things compared with say macos users.
I must admit that MS does offer the kind of setting I feel comfortable with.
however i have always wished I could get into linux. I just never had
anyone I can talk to.
I am willing to look into tutorials but even the best student needs feed
back.
>
>
>> I want full control over what PHP and mysql versions I can have and it
>> looks like that is the only way.
>> http://www-8.ibm.com/servers/eserver/in/xseries/x206m/
>> cnet gave it pretty good reviews.
>
> Of course buying a server with Linux preinstalled would give you a machine
> you can use at once, but I think you can get things cheaper by setting
> together your own machine and if you have enough old stuff that you can
> reassemble into a computer you will have saved all the $700.
> I think there are a couple of companies who sells machines with
> preinstalled Linux on them, all over in US, here in Europe they refuse.
the 2 desk tops i have i need. my wife uses 1 and this one is new and
pretty beefed up because i wanted to
play Call of Duty II. Funny thing is that i have not played that game or
anyother since starting this whole thing.
i dont think my 1998 lap top can handle being a server.
>
> Almost every distro that you can find at www.distrowatch.com will include
> MySQL, PHP and Apache as part of the packages that is included on the
> CDs/DVD, one exception I think is Linspear and is far from a distro I
> would recommend.
i noticed that the mostly come with version 3 & 4 mysql. i am wondering if
it would be easier to update
mysql then to install it.
>
> I don't know what IBM does offer in their server packages, can be better
> to call them and ask.
i hate the fact that you must talk to a sales person to get a price. I
wouldnt even know what to ask.
the only thing I know is that it must have high and quality ram and of
course storage space.
>
>
>> i notice you posted in alt.linux but for some reason my news server
>> doesnt show that group.
>
> Thats a bit sad, as IMHO it's one of the better newsgroups that isn't tied
> to a distro, but you can still use the google for accessing the newsgroup
> at http://groups.google.com/group/alt.linux?lnk=gschg
that is how i found your post. if i change my isp to get a static IP
perhaps I will then get linux.
I am looking into earthlink butttttt $69 a month. i do know there is
something out there that will let me work with a dynamic IP but never looked
into it in detail. right now between my host and my dsl i am spending 30 a
month.
>
>
>> i would like to try this but what gets me very nervous is that maybe it
>> is beyond me. with all the help you have already given me i still dont
>> know what to get.
>
> I would suggest you use an old computer and use it to play with Linux
> until you either feel you are ready to use it or that you feel that you
> can't leave microsoft, this way you won't waste money (or at least not
> much).
time is money. to tell you the truth with the prices of MS I dont know if i
can afford it.
and I would like to be able to connect to those databases where I place ads.
>
> Another option if you just want to try out Linux, is to use a LiveCD, as
> it won't need any installation, here is a list of different LiveCD distros
> (and a bunch of rescue CDs too) you can pick from:
> http://www.livecdlist.com/index.php
>
> Which one is the best I don't know, but knoppix is one of the popular
> ones.
>
>
> //Aho
right now I am once again feeling this is way over my head. but if one day
my wife hires helpers they will need computers
and i think we will need a server anyway. i feel like I can do this but
this is such a total guess. I am looking to do things you and others have
studied so hard and so long to do and here I am wanting to have toys like
the big boys and do things like the big boys with money to buy little toys.
I wish i knew what would happen if i did get my own server. I wish i knew
how stable the versions of mysql are that web hosts offer. i would feel
safest with the mysql hosting plan as far as having an older and more stable
version. but what happens if later on i want to change hosts how hard will
it be to import the database of another version. I also like the GUI mysql
offers with their plan.
Q. What version of MySQL is supported?
A. MySQL Hosting supports the latest production release of MySQL; 4.0.20.
i feel if i have version 5.0 that my site will have less trouble and be
easier to me to maintain.
another thing is - i think i am afraid to fail at this. or that it will just
take way to long. lol it already has.
Frank
Re: Learning php Sql
am 06.06.2006 19:13:31 von Frankly
i fianally decided to go with mysql hosting because of the admin tool they
use.
they are unable to inport my site :(. time to see what I need to do.
--
Thank you
Frank
PHPmySQL1(remove)@yahoo.com
Re: Learning php Sql
am 06.06.2006 19:35:10 von Frankly
dont a search i found i am supposed to change my DNS or my new hosts DNS.
I have no idea how to do that.
--
Thank you
Frank
PHPmySQL1(remove)@yahoo.com
"Frankly" wrote in message
news:%Iihg.8325$Rv1.2289@trndny02...
>i fianally decided to go with mysql hosting because of the admin tool they
>use.
> they are unable to inport my site :(. time to see what I need to do.
>
> --
> Thank you
> Frank
> PHPmySQL1(remove)@yahoo.com
>
>
Re: Learning php Sql
am 06.06.2006 19:53:57 von Shion
Frankly wrote:
> "J.O. Aho" wrote:
> I must admit that MS does offer the kind of setting I feel comfortable with.
> however i have always wished I could get into linux. I just never had
> anyone I can talk to.
> I am willing to look into tutorials but even the best student needs feed
> back.
If using graphical interface on linux (or any other flavor of unix), you can
always choose to make things more microsoft like, one of the major dekstops,
called KDE, has a setting to mimic microsoft as much as possible, using same
menu names for the linux tools as they would have had in microsoft and you can
use themes that makes the desktop to look almost the same and even install
microsoft like icons. I think you could fool your wife to think she was using
microsoft :)
> i dont think my 1998 lap top can handle being a server.
For testing linux you could most likely use it, there is a website dedicated
to installing linux on laptops, as laptops are a bit special compared with
desktops, it can be a bit difficult to install linux and get everything to
work, but you can take a look at http://www.linux-laptop.net/ and see if
someone has installed a linux distro on a similar laptop as yours.
>> Almost every distro that you can find at www.distrowatch.com will include
>> MySQL, PHP and Apache as part of the packages that is included on the
>> CDs/DVD, one exception I think is Linspear and is far from a distro I
>> would recommend.
>
> i noticed that the mostly come with version 3 & 4 mysql. i am wondering if
> it would be easier to update mysql then to install it.
If a distro uses MySQL3, then it's either an older version or discontinued
distro. MySQL4 is the stable one at the moment, I do recommend 4.1. Myself I
do use 5.0 on my server.
Did use Apache 1.3 quite late, did switch to a PowerPC based server late last
year and switched over to Apache 2.
I do use PHP 5 too on the server, while on the workstations I have only PHP 4.
As long as using quite standard PHP code and not too advanced sql queries, it
don't matter if you switch back and forth between PHP5/MySQL5 and PHP¤/MySQL4.
>> I don't know what IBM does offer in their server packages, can be better
>> to call them and ask.
>
> i hate the fact that you must talk to a sales person to get a price. I
> wouldnt even know what to ask.
> the only thing I know is that it must have high and quality ram and of
> course storage space.
Yeah, you are right and if you don't know what you need you may be ending with
a lot more than you should have, specially if the salesperson get commission
on what they sell.
> if i change my isp to get a static IP perhaps I will then get linux.
> I am looking into earthlink butttttt $69 a month. i do know there is
> something out there that will let me work with a dynamic IP but never looked
> into it in detail. right now between my host and my dsl i am spending 30 a
> month.
Thats quite expensive for a static IP, over here subscriptions with static IP
tend to been cheaper than those with a dynamic one (dynamic: ~US$60, static:
~US$40).
Using a dynamic connection ain't all impossible to run a server on, there are
services who runs DNS services for people with dynamic ip, so that the ip-name
will point to your current ip-number, there is of course a delay before all
DNS servers are updated, so for a while a user may not be able to access to
your site, but within a few hours most DNS servers has your new ip-number.
You can check http://www.dyndns.com/ and there are a load more of such
services, just google for dyndns.
>> Another option if you just want to try out Linux, is to use a LiveCD, as
>> it won't need any installation, here is a list of different LiveCD distros
>> (and a bunch of rescue CDs too) you can pick from:
>> http://www.livecdlist.com/index.php
>>
>> Which one is the best I don't know, but knoppix is one of the popular
>> ones.
>
> right now I am once again feeling this is way over my head. but if one day
> my wife hires helpers they will need computers and i think we will need a
> server anyway.
A LiveCD is a CD on which you have a full installation of linux, you put it
into your CD/DVD player and boot from the CD, it loads the linux, you can test
quite a lot of things, there are versions which can save data to your
microsoft installation, so next time you start the CD on the same machine you
will have the settings you saved last time you used it (think this is stored
in the C:\Temp). You just remove the CD from your computer and reboot and you
get back your microsoft.
> I am looking to do things you and others have
> studied so hard and so long to do and here I am wanting to have toys like
> the big boys and do things like the big boys with money to buy little toys.
Studied and studied, I have learned while using and I still learn a load of
new stuff, which can be quite fun. At the moment I'm looking into qmail,
thinking to run it on my server (qmail is a SMTP server).
> but what happens if later on i want to change hosts how hard will
> it be to import the database of another version.
As long as you switch to a newer version, you are on the safe side, as they
are backward compatible. If you switch to another sql server, say from mysql
to oracle, then you may have to rewrite some of your queries, to make
everything to work.
> A. MySQL Hosting supports the latest production release of MySQL; 4.0.20.
>
> i feel if i have version 5.0 that my site will have less trouble and be
> easier to me to maintain.
Both MySQL 4 and MySQL 5 are as easy to maintain, the major difference is that
MySQL 4.1 and later does have sub-select (a select in a select), which makes
it easier to make some selections, but you can always use php to middle
storage things and do the same thing with two/three queries. Of course MySQL
has more features than 4.0 and 4.1, but at this stage I don't think you need
those, it's first when you get more skilled with sql that you may need them.
> another thing is - i think i am afraid to fail at this. or that it will just
> take way to long. lol it already has.
I think it's better to take time than make everything wrong, things has worked
well this far as you have had it, even if it's a lot of work, so it will work
until you get finished and we all will be here to help you as well as we can.
> i fianally decided to go with mysql hosting because of the admin tool they
> use. they are unable to inport my site :(. time to see what I need to do.
Okey, I hope this will work well for you in the end.
I don't know how their admin tool works, but there should be options for
importing databases, at least I know how to do that when using the mysql
client that you can access on a shell (over ssh or telnet).
//Aho
Re: Learning php Sql
am 06.06.2006 19:58:52 von Shion
Frankly wrote:
> dont a search i found i am supposed to change my DNS or my new hosts DNS.
> I have no idea how to do that.
If you have a domain name that you have bought, then you have to see to that
the domain name is pointing at the right server. If you don't own a domain
name, then you don't need to do any changes, just give out the new URL. For
DNS changes if you do own a domain, are usually done at the company where you
did register your domain.
I don't know what rules mysql.com has, you may need to talk with the support
there to know if you are allowed to point your own domain against their servers.
//Aho
Re: Learning php Sql
am 06.06.2006 20:20:57 von Frankly
--
Thank you
Frank
PHPmySQL1(remove)@yahoo.com
"J.O. Aho" wrote in message
news:4elu2sF1f7rf1U1@individual.net...
> Frankly wrote:
>> dont a search i found i am supposed to change my DNS or my new hosts DNS.
>> I have no idea how to do that.
>
> If you have a domain name that you have bought, then you have to see to
> that the domain name is pointing at the right server. If you don't own a
> domain name, then you don't need to do any changes, just give out the new
> URL. For DNS changes if you do own a domain, are usually done at the
> company where you did register your domain.
i actually have 2 domain names. one is up and running but only shows a
tutorial at the moment.
the other i registered with Godaddy and that is all i did. the one on
godaddy is the one i want to use at mysql. if it is a mistake to go with
mysql it is only a $100 mistake. once i get this database up it will leave
me with more time to learn how to do the linux. i think this is the
smartest way to go. i called mysql and talked to someone.
> I think it's better to take time than make everything wrong, things has
> worked well this far as you have had it, even if it's a lot of work, so it
> will work until you get finished and we all will be here to help you as
> well as we can.
>
> //Aho
stop it you are making my eyes water :). i dont mind a lot of work, i want
what will be best.
thank you for putting up with me and my always changing mind. i have to take
a rest for a while i didnt get to sleep last night till about 7am. i have
to talk to my doc about this insomnia thing.
Frank
Re: Learning php Sql
am 06.06.2006 21:49:32 von Frankly
I called mysql and emailed them as well. no answer as of yet.
I did get in touch with godaddy and was told that my name is parked with
them.
I need to update my name servers to POINT to my new name server.
this POINT thing has me worried. Will Godaddy still be connected to my web
site?
and my sql stated something about no support for a 3rd party.
i tried to cancell my name and was told that if i do that it will become
unavailable to me or anyone else for a while.
--
Thank you
Frank
PHPmySQL1(remove)@yahoo.com
Re: Learning php Sql
am 06.06.2006 22:01:06 von Frankly
this is what i keep getting. it give me no other option. did go daddy screw
me?
Do Not Transfer My Domain Name
This will leave the domain with the current registrar. If you choose not to
transfer the domain name, you will need to update your DNS servers manually.
You will also not be able to administrate your domain through MySQL Hosting
services.
NOTE: MySQL will not be responsible for any issues that may arise from the
Domain Name residing with a third party registrar.
--
Thank you
Frank
PHPmySQL1(remove)@yahoo.com
"Frankly" wrote in message
news:dIjhg.2758$F%3.844@trndny07...
>
>
> --
> Thank you
> Frank
> PHPmySQL1(remove)@yahoo.com
>
>
> "J.O. Aho" wrote in message
> news:4elu2sF1f7rf1U1@individual.net...
>> Frankly wrote:
>>> dont a search i found i am supposed to change my DNS or my new hosts
>>> DNS.
>>> I have no idea how to do that.
>>
>> If you have a domain name that you have bought, then you have to see to
>> that the domain name is pointing at the right server. If you don't own a
>> domain name, then you don't need to do any changes, just give out the new
>> URL. For DNS changes if you do own a domain, are usually done at the
>> company where you did register your domain.
>
> i actually have 2 domain names. one is up and running but only shows a
> tutorial at the moment.
> the other i registered with Godaddy and that is all i did. the one on
> godaddy is the one i want to use at mysql. if it is a mistake to go with
> mysql it is only a $100 mistake. once i get this database up it will
> leave me with more time to learn how to do the linux. i think this is the
> smartest way to go. i called mysql and talked to someone.
>
>
>> I think it's better to take time than make everything wrong, things has
>> worked well this far as you have had it, even if it's a lot of work, so
>> it will work until you get finished and we all will be here to help you
>> as well as we can.
>
>>
>> //Aho
>
> stop it you are making my eyes water :). i dont mind a lot of work, i
> want what will be best.
> thank you for putting up with me and my always changing mind. i have to
> take a rest for a while i didnt get to sleep last night till about 7am. i
> have to talk to my doc about this insomnia thing.
>
> Frank
>
Re: Learning php Sql
am 07.06.2006 01:33:19 von Frankly
I hope i have fixed the problem. I had to remove the domain from domains by
proxy and also some privacy bull from godaddy. I hope it works. i will
take off the rest of the day and see what happens tomorrow.
--
Thank you
Frank
PHPmySQL1(remove)@yahoo.com
Re: Learning php Sql
am 10.06.2006 16:48:17 von Frankly
>> I tried this in Access with out any luck. i was able to create a combo
>> box in a form with fields for Area and Zipcode.. however when i selected
>> the Area it wouldnt automatically bring the zip code. in other forms i
>> was able to include fields from other talbes that would get filled
>> according to a selection i made in a combo box.
>
> This requires some javascript coding too, if you want the zip code box to
> be automatically filled when you entered the area. Otherwise if you allow
> people to leave the box empty, you can let the receiving php page to fetch
> the zip code (keep in mind that an area may have more than one zip code,
> so it's really better to do it the other way around, fill the zip code and
> let the php script fetch the area name from the database and then save it
> into the row).
I am not sure how i would create this table.
I guess allowing null would let some records have more zip codes than
others.
so i could have
Area, ZipCode1, ZipCode2, ZipCode3. I would also understand if you think
this is over my head.
So it might be better if i insert these things manually. I know it would
allow for more errors but even with out doing that the amount of help I will
need is more than i ever expected getting.
but then again when ever i did look to learn these things in the past i
never had any one to help explain
the explainations I didnt understand. I guess I can try and if need be just
add a Area and Zip code field to the buildings table later on :).. yep thats
the ticket.
time to start building :).
i did search for my web again today and it now says.
Coming Soon.. this is the home of a future MySQL Hosting Website.. :).
Frank
Re: Learning php Sql
am 10.06.2006 18:15:10 von Shion
Frankly wrote:
>>> I tried this in Access with out any luck. i was able to create a combo
>>> box in a form with fields for Area and Zipcode.. however when i selected
>>> the Area it wouldnt automatically bring the zip code. in other forms i
>>> was able to include fields from other talbes that would get filled
>>> according to a selection i made in a combo box.
>> This requires some javascript coding too, if you want the zip code box to
>> be automatically filled when you entered the area. Otherwise if you allow
>> people to leave the box empty, you can let the receiving php page to fetch
>> the zip code (keep in mind that an area may have more than one zip code,
>> so it's really better to do it the other way around, fill the zip code and
>> let the php script fetch the area name from the database and then save it
>> into the row).
>
> I am not sure how i would create this table.
ZipTable
ZipCode AreaName
> I guess allowing null would let some records have more zip codes than
> others.
No nulls, always a zip code and the area name, otherwise you get troubles.
> so i could have
> Area, ZipCode1, ZipCode2, ZipCode3. I would also understand if you think
> this is over my head.
This is a slow approach and you don't know how many columns you need for the
one with the most zip codes.
> So it might be better if i insert these things manually. I know it would
> allow for more errors but even with out doing that the amount of help I will
> need is more than i ever expected getting.
I think you can get a list from USPS, at least SP does provide such for free,
then just make a small php script that reads the file one line at the time and
saves the data to the sql database, don't take long time for 80000 zip codes
to be saved. The down side with this is that you need to keep the list
updated, at least here you may get a few changes an year.
> but then again when ever i did look to learn these things in the past i
> never had any one to help explain
> the explainations I didnt understand. I guess I can try and if need be just
> add a Area and Zip code field to the buildings table later on :).. yep thats
> the ticket.
Here you can do two different things, just save the zip code, you can then
joint the buildings table with the zip table, the draw back to do this is that
the more zip codes and buildings you have, the longer time it will take to
make the join.
The faster way is to store both area and zip code in the building table, but
still allow only the user (your wife?) to type the zip code in the form for
saving the building to the database, in your php script you get the area name
from the zip table, and then save this name to the building table, this way
you always have the same spelling on the areas. I know here that sometimes
people uses ' ' (space) or '-' (hyphen) on names that is "two" parted as 'Los
Angeles' which could be written badly as 'Los-Angeles'.
> time to start building :).
> i did search for my web again today and it now says.
> Coming Soon.. this is the home of a future MySQL Hosting Website.. :).
Good that it goes forward, I hope it won't take those 14 days as the support
first said, it feels all to slow IMHO.
Good luck with your building :)
//Aho
Re: Learning php Sql
am 10.06.2006 18:57:21 von Frankly
"J.O. Aho" wrote in message
news:4f09geF1gcqe8U1@individual.net...
> Frankly wrote:
>>>> I tried this in Access with out any luck. i was able to create a combo
>>>> box in a form with fields for Area and Zipcode.. however when i
>>>> selected the Area it wouldnt automatically bring the zip code. in
>>>> other forms i was able to include fields from other talbes that would
>>>> get filled according to a selection i made in a combo box.
>>> This requires some javascript coding too, if you want the zip code box
>>> to be automatically filled when you entered the area. Otherwise if you
>>> allow people to leave the box empty, you can let the receiving php page
>>> to fetch the zip code (keep in mind that an area may have more than one
>>> zip code, so it's really better to do it the other way around, fill the
>>> zip code and let the php script fetch the area name from the database
>>> and then save it into the row).
> >
>> I am not sure how i would create this table.
>
> ZipTable
> ZipCode AreaName
I thought a table like this would create dupes.
if i understand this correctly I could put multiple zip codes in a single
column :).
>
>> I guess allowing null would let some records have more zip codes than
>> others.
>
> No nulls, always a zip code and the area name, otherwise you get troubles.
i remember reading something that showed me how... I could help protect
myself by making it so
that I cant put an apartment, unless there is a building, and cant put a
building unless there is a management.
so the same thing for areas and zipcodes.
>> So it might be better if i insert these things manually. I know it would
>> allow for more errors but even with out doing that the amount of help I
>> will need is more than i ever expected getting.
>
> I think you can get a list from USPS, at least SP does provide such for
> free, then just make a small php script that reads the file one line at
> the time and saves the data to the sql database, don't take long time for
> 80000 zip codes to be saved. The down side with this is that you need to
> keep the list updated, at least here you may get a few changes an year
I have already done - Managements, Buildings and apartments tables today.
i guess this script will be in the form I create later on for inputing new
records.
what I had planned for today was to build all the tables, give my best shot
at making relations,
and input some records. then start learning how to make those records show
on my web site.
after that start working on those kinds of forms.
Does that sound like a good plan?
>
>
>> but then again when ever i did look to learn these things in the past i
>> never had any one to help explain
>> the explainations I didnt understand. I guess I can try and if need be
>> just add a Area and Zip code field to the buildings table later on :)..
>> yep thats the ticket.
>
> Here you can do two different things, just save the zip code, you can then
> joint the buildings table with the zip table, the draw back to do this is
> that the more zip codes and buildings you have, the longer time it will
> take to make the join.
> The faster way is to store both area and zip code in the building table,
> but still allow only the user (your wife?) to type the zip code in the
> form for saving the building to the database, in your php script you get
> the area name from the zip table, and then save this name to the building
> table, this way you always have the same spelling on the areas. I know
> here that sometimes people uses ' ' (space) or '-' (hyphen) on names that
> is "two" parted as 'Los Angeles' which could be written badly as
> 'Los-Angeles'.
ok, zipe code and area fields will be in the buildlings table. I guess I
will understand
this more once i start working on those forms :).
>
>
>> time to start building :).
>> i did search for my web again today and it now says.
>> Coming Soon.. this is the home of a future MySQL Hosting Website.. :).
>
> Good that it goes forward, I hope it won't take those 14 days as the
> support first said, it feels all to slow IMHO.
>
> Good luck with your building :)
>
>
>
> //Aho
While i do feel a bit lost with this new admin tool. I do believe in the
long run I will
be able to do more while asking less questions. to tell you the truth if
"I" get this thing done
I dont understand why anyone would limit them selves to MS. I am still a
bit nervous about it. I see
even Strawberry is asking questions on how to do things. back to work.
Frank
Re: Learning php Sql
am 10.06.2006 19:51:09 von Shion
Frankly wrote:
> "J.O. Aho" wrote in message
>> Frankly wrote:
>>>> This requires some javascript coding too, if you want the zip code box
>>>> to be automatically filled when you entered the area. Otherwise if you
>>>> allow people to leave the box empty, you can let the receiving php page
>>>> to fetch the zip code (keep in mind that an area may have more than one
>>>> zip code, so it's really better to do it the other way around, fill the
>>>> zip code and let the php script fetch the area name from the database
>>>> and then save it into the row).
>>> I am not sure how i would create this table.
>> ZipTable
>> ZipCode AreaName
>
>
> I thought a table like this would create dupes.
> if i understand this correctly I could put multiple zip codes in a single
> column :).
No, you wouldn't get dupes, as
WA98108 Seattle
ain't the same as
WA98109 Seattle
even if both are located in Seattle, with some work you can even add another
column which tells which part of town the zip code belongs and that way get
even better check on locations that you normally would have.
>>> I guess allowing null would let some records have more zip codes than
>>> others.
>> No nulls, always a zip code and the area name, otherwise you get troubles.
>
>
> i remember reading something that showed me how... I could help protect
> myself by making it so
> that I cant put an apartment, unless there is a building, and cant put a
> building unless there is a management.
> so the same thing for areas and zipcodes.
When you create a column you can use
AreaName VARCHAR(40) NOT NULL
this prevents null values in a column.
> I have already done - Managements, Buildings and apartments tables today.
> i guess this script will be in the form I create later on for inputing new
> records.
> what I had planned for today was to build all the tables, give my best shot
> at making relations,
> and input some records. then start learning how to make those records show
> on my web site.
> after that start working on those kinds of forms.
> Does that sound like a good plan?
Yes, but I do my relations on paper before I create tables, even if you have
ALTER http://dev.mysql.com/doc/refman/5.0/en/alter-table.html
it's better to get the tables right from the beginning than altering them
afterwards.
>> Here you can do two different things, just save the zip code, you can then
>> joint the buildings table with the zip table, the draw back to do this is
>> that the more zip codes and buildings you have, the longer time it will
>> take to make the join.
>> The faster way is to store both area and zip code in the building table,
>> but still allow only the user (your wife?) to type the zip code in the
>> form for saving the building to the database, in your php script you get
>> the area name from the zip table, and then save this name to the building
>> table, this way you always have the same spelling on the areas. I know
>> here that sometimes people uses ' ' (space) or '-' (hyphen) on names that
>> is "two" parted as 'Los Angeles' which could be written badly as
>> 'Los-Angeles'.
>
> ok, zipe code and area fields will be in the buildlings table. I guess I
> will understand
> this more once i start working on those forms :).
As I said much depends on how you want to do things, in a database you avoid
to store the same data in all to many places, exception is when you get
performance problems, then you start to duplicate data to speed things up.
> While i do feel a bit lost with this new admin tool. I do believe in the
> long run I will
> be able to do more while asking less questions. to tell you the truth if
> "I" get this thing done
> I dont understand why anyone would limit them selves to MS. I am still a
> bit nervous about it. I see
> even Strawberry is asking questions on how to do things. back to work.
I'm sure you will manage this well, the worst things that can happen is that
you manage to crash the server ;) Really, it's not that bad, but a badly
chosen DELETE can result in data loss, but creating a table that you think is
wrong will not cause in data loss, just create a new table and export the data
to the new table before you DROP the old table, this way you will not loose
your data.
//Aho
Re: Learning php Sql
am 10.06.2006 19:53:39 von Shion
Frankly wrote:
> "J.O. Aho" wrote in message
> news:4f09geF1gcqe8U1@individual.net...
>> Frankly wrote:
>>>>> I tried this in Access with out any luck. i was able to create a combo
>>>>> box in a form with fields for Area and Zipcode.. however when i
>>>>> selected the Area it wouldnt automatically bring the zip code. in
>>>>> other forms i was able to include fields from other talbes that would
>>>>> get filled according to a selection i made in a combo box.
>>>> This requires some javascript coding too, if you want the zip code box
>>>> to be automatically filled when you entered the area. Otherwise if you
>>>> allow people to leave the box empty, you can let the receiving php page
>>>> to fetch the zip code (keep in mind that an area may have more than one
>>>> zip code, so it's really better to do it the other way around, fill the
>>>> zip code and let the php script fetch the area name from the database
>>>> and then save it into the row).
>>> I am not sure how i would create this table.
>> ZipTable
>> ZipCode AreaName
>
>
> I thought a table like this would create dupes.
> if i understand this correctly I could put multiple zip codes in a single
> column :).
Forgot to say
Seattle WA98108,WA98109,...
will be slower to search than
Seattle WA98108
Seattle WA98109
and the fist one makes you can't have real relations between the ZipTable and
other tables (JOIN won't work), so the later is always a better one.
//Aho
Re: Learning php Sql
am 14.06.2006 17:20:47 von Frankly
"Frankly" wrote in message news:...
>
>
>>> "J.O. Aho" wrote in message
>>
>> Seattle WA98108,WA98109,...
>>
>> will be slower to search than
>>
>> Seattle WA98108
>> Seattle WA98109
>>
>> and the fist one makes you can't have real relations between the ZipTable
>> and other tables (JOIN won't work), so the later is always a better one.
>>
>>
>>
>> //Aho
>
I started this a couple of days ago and have been away since.
That is how I will do it.
I remember a while back when we talked about the RelationManagementBuildings
table.
I wasnt sure if i should put a primary key there and you replied something
like.
it is a good idea to have "A" primary key in that table. Some of the stuff
I
read says that in some cases it might be better to have both ManagementID
and BuildingsID set as primaries. However you said "A" primary key. I
want to build this database according to what you think is best. do you
think it is better to only use A primary key or should i set both. I am
thinking that the relation table will hold the foreign keys.
in the begining i felt it was better to explore my choices and build tables
from within the Admin. however at this point you are so right. I just
created the tables and here goes.
I am not sure if Management and buildings table should hold the primary keys
or
the relations building should hold both.
time to hold my nose and jump in - now the fun starts. i am a bit nervous
about what I have already forgotten to do
in the tables below. if you feel something looks like i didnt put enough
effort into it please tell me the terms I should look up.
Management Table
ManID - Int Auto unless relations table holds both primary keys.
Name - varchar (45)
Contact - varchar (45)
Phone - Varchar (45)
Address - Varchar (45)
City - varchar (45) default New York
State varchar (2) default NY
ZipCode - Varchar (10)
Website - Varchar (50)
Buildings Table
BuildingID INT Auto
Name - Varchar (45)
Address - varchar ( 50 )
Cross streetA - Varchar 50
Cross StreetB - Varchar 50
WebSite - Varchar 50
Picture - Varchar 50
Elevator- varchar 1
Laundry - varchar 1
Pets - varchar 1 - sometimes they do allow pets that are smaller than 12lbs.
so i am thinking pets comments feild.
pets comments if pets = 1
Gym -varchar 1
video intercome varchar 1
contact varchar 45
contact phone varchar 45
Area varchar 45
Zip Code Varchar 45
RelationManagementBuilding table
ManagementID INT
BuildingID INT
Apartments Table
ApartmentID - int
BuildingID - int
Rent - dec
AptNumber - varchar 6
Bedroom - dec 3
bathroom - dec 3
WebSite varchar 50
Picture varchar 50
Notes - text - there will be 4 picture fields and 1 note field for each
picture.
MoveInDate - Date 0000-00-00
Still Available Varchar 2
ZipArea table
ZipCode varchar 10
Area varchar 45
i feel like i am handing in a very important test and this is the easy part.
how bad did i do.
i know i have forgotten alot of what i read.
after this I am going to look into creating relations using the admin tool.
Thank you
Frank
Re: Learning php Sql -EDITED- ignore other post from today
am 14.06.2006 17:23:42 von Frankly
--
Frank
PHPmySQL1@yahoo.com
"Frankly" wrote in message
news:jPVjg.5322$891.5296@trndny01...
>
>
> "Frankly" wrote in message news:...
>>
>>
>>>> "J.O. Aho" wrote in message
>>>
>>> Seattle WA98108,WA98109,...
>>>
>>> will be slower to search than
>>>
>>> Seattle WA98108
>>> Seattle WA98109
>>>
>>> and the fist one makes you can't have real relations between the
>>> ZipTable and other tables (JOIN won't work), so the later is always a
>>> better one.
>>>
>>>
>>>
>>> //Aho
>>
>
That is how I will do it.
I remember a while back when we talked about the RelationManagementBuildings
table.
I wasnt sure if i should put a primary key there and you replied something
like.
it is a good idea to have "A" primary key in that table. Some of the stuff
I
read says that in some cases it might be better to have both ManagementID
and BuildingsID set as primaries. However you said "A" primary key. I
want to build this database according to what you think is best. do you
think it is better to only use A primary key or should i set both.
in the begining i felt it was better to explore my choices and build tables
from within the Admin. however at this point you are so right. I just
created the tables and here goes.
I am not sure if Management and buildings table should hold the primary keys
or
the relations building should hold both.
time to hold my nose and jump in - now the fun starts. i am a bit nervous
about what I have already forgotten to do
in the tables below. if you feel something looks like i didnt put enough
effort into it please tell me the terms I should look up.
Management Table
ManID - Int Auto unless relations table holds both primary keys.
Name - varchar (45)
Contact - varchar (45)
Phone - Varchar (45)
Address - Varchar (45)
City - varchar (45) default New York
State varchar (2) default NY
ZipCode - Varchar (10)
Website - Varchar (50)
Buildings Table
BuildingID INT Auto
Name - Varchar (45)
Address - varchar ( 50 )
Cross streetA - Varchar 50
Cross StreetB - Varchar 50
WebSite - Varchar 50
Picture - Varchar 50
Elevator- varchar 1
Laundry - varchar 1
Pets - varchar 1 - sometimes they do allow pets that are smaller than 12lbs.
so i am thinking pets comments feild.
pets comments if pets = 1
Gym -varchar 1
video intercome varchar 1
contact varchar 45
contact phone varchar 45
Area varchar 45
Zip Code Varchar 45
RelationManagementBuilding table
ManagementID INT
BuildingID INT
Apartments Table
ApartmentID - int
BuildingID - int
Rent - dec
AptNumber - varchar 6
Bedroom - dec 3
bathroom - dec 3
WebSite varchar 50
Picture varchar 50
Notes - text - there will be 4 picture fields and 1 note field for each
picture.
MoveInDate - Date 0000-00-00
Still Available Varchar 2
ZipArea table
ZipCode varchar 10
Area varchar 45
i feel like i am handing in a very important test and this is the easy part.
how bad did i do.
i know i have forgotten alot of what i read.
after this I am going to look into creating relations using the admin tool.
I started this a couple of days ago and have been away since.
Thank you
Frank
Re: Learning php Sql -EDITED- ignore other post from today
am 14.06.2006 19:23:52 von zac.carey
Well, it's definitely a 'Pass'. I'm not sure I'm qualified to give you
a grade though!
A couple of things. Apologies if they've been covered before...
I think I'd have separate tables for things like Cities and States -
just like you do for ZipCodes, that way they can be selected from drop
down lists - so less chance of typos. In fact, as you go along you
might find ways of constructing context sensitive select boxes, thereby
speeding up data entry (although this might not be such a big deal).
I'd have separate fields for first and last name. You can concatenate
these items when presenting them to the viewer if you like. It just
makes searching by both first name and last name a little neater.
Also, unless you deal with properties on Lake
Chargogagogmanchargogagogcharbunagungamog, MA - or insist on referring
to LA by it's (alleged) full proper name - VARCHAR (45) is probably a
little over the top. I suspect VARCHAR(20) would suffice.
Conversely VARCHAR(50) might not be sufficient for websites. This page,
for instance, is listed in my browser as being 185 characters long. I'd
make websites VARCHAR(200) or
VARCHAR(255).
I'm still not sure that the images bit is flexible enough, but I guess
it's a start.
I love that they do pets by weight. Only in America.
Anyway, a great start.
Frankly wrote:
> --
>
> Frank
> PHPmySQL1@yahoo.com
> "Frankly" wrote in message
> news:jPVjg.5322$891.5296@trndny01...
> >
> >
> > "Frankly" wrote in message news:...
> >>
> >>
> >>>> "J.O. Aho" wrote in message
> >>>
> >>> Seattle WA98108,WA98109,...
> >>>
> >>> will be slower to search than
> >>>
> >>> Seattle WA98108
> >>> Seattle WA98109
> >>>
> >>> and the fist one makes you can't have real relations between the
> >>> ZipTable and other tables (JOIN won't work), so the later is always a
> >>> better one.
> >>>
> >>>
> >>>
> >>> //Aho
> >>
> >
>
> That is how I will do it.
> I remember a while back when we talked about the RelationManagementBuildings
> table.
> I wasnt sure if i should put a primary key there and you replied something
> like.
> it is a good idea to have "A" primary key in that table. Some of the stuff
> I
> read says that in some cases it might be better to have both ManagementID
> and BuildingsID set as primaries. However you said "A" primary key. I
> want to build this database according to what you think is best. do you
> think it is better to only use A primary key or should i set both.
>
> in the begining i felt it was better to explore my choices and build tables
> from within the Admin. however at this point you are so right. I just
> created the tables and here goes.
> I am not sure if Management and buildings table should hold the primary keys
> or
> the relations building should hold both.
>
> time to hold my nose and jump in - now the fun starts. i am a bit nervous
> about what I have already forgotten to do
> in the tables below. if you feel something looks like i didnt put enough
> effort into it please tell me the terms I should look up.
>
> Management Table
>
> ManID - Int Auto unless relations table holds both primary keys.
> Name - varchar (45)
> Contact - varchar (45)
> Phone - Varchar (45)
> Address - Varchar (45)
> City - varchar (45) default New York
> State varchar (2) default NY
> ZipCode - Varchar (10)
> Website - Varchar (50)
>
> Buildings Table
>
> BuildingID INT Auto
> Name - Varchar (45)
> Address - varchar ( 50 )
> Cross streetA - Varchar 50
> Cross StreetB - Varchar 50
> WebSite - Varchar 50
> Picture - Varchar 50
> Elevator- varchar 1
> Laundry - varchar 1
> Pets - varchar 1 - sometimes they do allow pets that are smaller than 12lbs.
> so i am thinking pets comments feild.
> pets comments if pets = 1
> Gym -varchar 1
> video intercome varchar 1
> contact varchar 45
> contact phone varchar 45
> Area varchar 45
> Zip Code Varchar 45
>
> RelationManagementBuilding table
>
> ManagementID INT
> BuildingID INT
>
> Apartments Table
>
> ApartmentID - int
> BuildingID - int
> Rent - dec
> AptNumber - varchar 6
> Bedroom - dec 3
> bathroom - dec 3
> WebSite varchar 50
> Picture varchar 50
> Notes - text - there will be 4 picture fields and 1 note field for each
> picture.
> MoveInDate - Date 0000-00-00
> Still Available Varchar 2
>
> ZipArea table
> ZipCode varchar 10
> Area varchar 45
>
> i feel like i am handing in a very important test and this is the easy part.
> how bad did i do.
> i know i have forgotten alot of what i read.
> after this I am going to look into creating relations using the admin tool.
>
> I started this a couple of days ago and have been away since.
> Thank you
> Frank
Re: Learning php Sql
am 14.06.2006 20:00:14 von Shion
Frankly wrote:
> "Frankly" wrote in message news:...
>>
>>>> "J.O. Aho" wrote in message
>>> Seattle WA98108,WA98109,...
>>>
>>> will be slower to search than
>>>
>>> Seattle WA98108
>>> Seattle WA98109
>>>
>>> and the fist one makes you can't have real relations between the ZipTable
>>> and other tables (JOIN won't work), so the later is always a better one.
>>>
>>>
>>>
>>> //Aho
>
> I started this a couple of days ago and have been away since.
>
> That is how I will do it.
> I remember a while back when we talked about the RelationManagementBuildings
> table.
> I wasnt sure if i should put a primary key there and you replied something
> like.
> it is a good idea to have "A" primary key in that table. Some of the stuff
> I
> read says that in some cases it might be better to have both ManagementID
> and BuildingsID set as primaries. However you said "A" primary key. I
> want to build this database according to what you think is best. do you
> think it is better to only use A primary key or should i set both. I am
> thinking that the relation table will hold the foreign keys.
Much depends on how the table looks and is supposed to work, in a relation
table you use the two foreign keys (ManagementID and BuildingsID) together to
be a primary key, this gives you the advantage that you won't get any
duplicates in your relation table.
While in the Management table you only have the ManagementID as the primary
key (you don't the foreign key BuildingsID at all as the relation is set in
the relation table).
> in the begining i felt it was better to explore my choices and build tables
> from within the Admin. however at this point you are so right. I just
> created the tables and here goes.
> I am not sure if Management and buildings table should hold the primary keys
> or
> the relations building should hold both.
It should have both the foreign keys together as primary keys (don't remember
the syntax offhand here how to set it).
You may ask why not set both of them as primary keys in the relation table,
then answer is quite obvious if putting your mind into it for a while, primary
key will automatically mean unique, which makes you can only have the ID once
in the whole table
table managementbuildingrelation
managementid(primary key) buildingid(primary key)
M001 B002
M002 B001
The following won't be allowed in the table
M001 B003
as M001 has already been there
table managementbuildingrelation
managementid buildingid [managementid+buildingid=primary key]
M001 B002
M002 B001
M001 B003
This time you can have all three lines in the table as M001+B002 isn't the
same as M001+B003.
> time to hold my nose and jump in - now the fun starts. i am a bit nervous
> about what I have already forgotten to do
> in the tables below. if you feel something looks like i didnt put enough
> effort into it please tell me the terms I should look up.
>
> Management Table
>
> ManID - Int Auto unless relations table holds both primary keys.
You still need the ID here, otherwise you can't use the relation table to
match the management with the right building. Int and auto is good. Keeping it
primary key too.
> Name - varchar (45)
> Contact - varchar (45)
> Phone - Varchar (45)
> Address - Varchar (45)
> City - varchar (45) default New York
> State varchar (2) default NY
> ZipCode - Varchar (10)
> Website - Varchar (50)
>
> Buildings Table
>
> BuildingID INT Auto
Same applies as for ManID.
> Name - Varchar (45)
> Address - varchar ( 50 )
> Cross streetA - Varchar 50
> Cross StreetB - Varchar 50
> WebSite - Varchar 50
> Picture - Varchar 50
> Elevator- varchar 1
> Laundry - varchar 1
> Pets - varchar 1 - sometimes they do allow pets that are smaller than 12lbs.
> so i am thinking pets comments feild.
> pets comments if pets = 1
> Gym -varchar 1
> video intercome varchar 1
> contact varchar 45
> contact phone varchar 45
> Area varchar 45
> Zip Code Varchar 45
>
> RelationManagementBuilding table
>
> ManagementID INT
> BuildingID INT
Yes, the look of them is okey, you only need to make the
ManagementID+BuildingID to be primary key.
> Apartments Table
>
> ApartmentID - int
> BuildingID - int
This works nicely a primary key and a foreign key, you could have used a
relation table, but in this case I think this (how you done9 would be better.
> Rent - dec
> AptNumber - varchar 6
> Bedroom - dec 3
> bathroom - dec 3
> WebSite varchar 50
> Picture varchar 50
> Notes - text - there will be 4 picture fields and 1 note field for each
> picture.
> MoveInDate - Date 0000-00-00
> Still Available Varchar 2
>
> ZipArea table
> ZipCode varchar 10
> Area varchar 45
>
> i feel like i am handing in a very important test and this is the easy part.
> how bad did i do.
> i know i have forgotten alot of what i read.
> after this I am going to look into creating relations using the admin tool.
I think this looks quite good, some sizes could be larger, specially for URLs.
Not sure what you want to store in bathroom, how many sqf or the number of
them, but if it's the number of bathrooms, then I would go with INT as you
never have a half bathroom.
//Aho
Re: Learning php Sql -EDITED- ignore other post from today
am 14.06.2006 20:05:06 von Shion
strawberry wrote:
> I'm still not sure that the images bit is flexible enough, but I guess
> it's a start.
It depends on what would be stored there, if it's with full path to the image,
then it may or may not be enough, but if it's just the name of the image (you
can hardcode the path, so you don't need to save that in the table), then many
digital cameras uses 8.3 (12 character in total) as the name for the image, in
this case the 50 would be over kill, but then I don't know what Frankly want
to store.
//Aho
Re: Learning php Sql -EDITED- ignore other post from today
am 15.06.2006 18:19:52 von Frankly
"strawberry" wrote in message
news:1150305832.027267.316250@y41g2000cwy.googlegroups.com.. .
> Well, it's definitely a 'Pass'. I'm not sure I'm qualified to give you
> a grade though!
thank you. Aualified or not.. I WILL TAKE IT :).
>
> A couple of things. Apologies if they've been covered before...
>
> I think I'd have separate tables for things like Cities and States -
> just like you do for ZipCodes, that way they can be selected from drop
> down lists - so less chance of typos. In fact, as you go along you
> might find ways of constructing context sensitive select boxes, thereby
> speeding up data entry (although this might not be such a big deal).
I have never really done searches by cites or states. about 99% will be in
New York
and tell you the truth i will never use it.
I cant wait to get up to trying to create contest sensitive select boxes.
>
> I'd have separate fields for first and last name. You can concatenate
> these items when presenting them to the viewer if you like. It just
> makes searching by both first name and last name a little neater.
thank you for bringing that up. I am trying to think if we have ever needed
to do searching
by first or last name. Most of the time I wont have a last name. I
probably have not used a last name in a very long time.
however, I do plan on starting to aim at the smaller landlords and so i
think you are right. I should include those feilds but also also them to be
blank.
>
> Also, unless you deal with properties on Lake
> Chargogagogmanchargogagogcharbunagungamog, MA - or insist on referring
> to LA by it's (alleged) full proper name - VARCHAR (45) is probably a
> little over the top. I suspect VARCHAR(20) would suffice.
lol ok.. will do.
>
> Conversely VARCHAR(50) might not be sufficient for websites. This page,
> for instance, is listed in my browser as being 185 characters long. I'd
> make websites VARCHAR(200) or
> VARCHAR(255).
Will do
>
> I'm still not sure that the images bit is flexible enough, but I guess
> it's a start.
>
> I love that they do pets by weight. Only in America.
>
> Anyway, a great start.
Thank you Stawberry. however something happen today that is going to cause
my usual work to take much longer.
but this by far is the most important thing to me as of this moment. I wish
I knew how long it would take to get my site up and running if i stopped all
other work and gave this site 18 hours a day. could it be done in a couple
of days?
I am in uncharted territory. I have no idea what to expect on how hard this
is going to be.
Frank
Re: Learning php Sql -EDITED- ignore other post from today
am 15.06.2006 18:19:52 von Frankly
"J.O. Aho" wrote in message
news:4fb1eiF1hup8mU1@individual.net...
> strawberry wrote:
>
>> I'm still not sure that the images bit is flexible enough, but I guess
>> it's a start.
>
> It depends on what would be stored there, if it's with full path to the
> image, then it may or may not be enough, but if it's just the name of the
> image (you can hardcode the path, so you don't need to save that in the
> table), then many digital cameras uses 8.3 (12 character in total) as the
> name for the image, in this case the 50 would be over kill, but then I
> don't know what Frankly want to store.
>
>
> //Aho
I will have to go over the other post when my mind is a little more relaxed.
what i would like is to show you a site much like the one I would like to
build.
of course those things you recommend me not getting into will change things
a bit.
www.Anchornyc.com .
i have already purchased a really nice picture to take the place of the 3 on
that page.
tell you the truth. I like that picture so much i would love to just frame
it and put in a few hot spots.
i think 4 pictures per apartment will be good enough, because i have hopes
of having lots of aparments with pictures. i have about 8 hours of realy
hard and really fast data entry. that is just a guess as today will be the
first time I have to do things this way.......... it dont look good. It is
going to effect my advertising greatly. I now need a link to a web site in
my ads more than ever.
tell you the truth i feel like a cartoon character that is running so fast
in one direction and back to the other that all you see is a blur like in a
picture with a realy long exposure time.
do i stop what i am doing to do the site -
do i do what needs to be done in order to survive. <-- tell you the truth i
dont really know what that is or what the best choice is. the slow season
is right around the corner.
oooo It is common to refer to apartments with 1.5 bathrooms when 1 bathroom
does not include a shower and say 2 full bathrooms when both have showers.
I will also use that for apartments that have 1 normal size bedroom and
another that is really a walk in closet. it isnt very often that we find
bedrooms like the ones many of you have. apartments that are no larger than
200 sqft go for $2300 and much higher a month.
some areas you can pay about $1700 a month for the same size place. its all
about location here.
the same apartment only 1 block away from the $2300 can be $500 cheaper a
month and another $500 on the next block. its crazy here.
Re: Learning php Sql Read Me First.
am 15.06.2006 18:33:39 von Frankly
I would also be more than happy to just have a link on the home page that
calls
for the current listings to be shown in price or bedroom order.
I would love to have about 5 pictures on the home page that will display the
lastest apartments that where added.
--
Frank
PHPmySQL1@yahoo.com
Re: Learning php Sql -EDITED- ignore other post from today
am 15.06.2006 19:11:28 von Shion
Frankly wrote:
> Thank you Stawberry. however something happen today that is going to cause
> my usual work to take much longer.
> but this by far is the most important thing to me as of this moment. I wish
> I knew how long it would take to get my site up and running if i stopped all
> other work and gave this site 18 hours a day. could it be done in a couple
> of days?
> I am in uncharted territory. I have no idea what to expect on how hard this
> is going to be.
A couple of weekend I guess you could fix that, much of course depending on
your PHP and SQL skills and how much you already have planed out on paper.
But overworking like 18h/day could of course lead to that it takes a lot
longer than just work 8-10h a day.
//Aho
Re: Learning php Sql -EDITED- ignore other post from today
am 15.06.2006 19:20:49 von Shion
Frankly wrote:
> oooo It is common to refer to apartments with 1.5 bathrooms when 1 bathroom
> does not include a shower and say 2 full bathrooms when both have showers.
Here we wouldn't call the "half" for a bathroom but a WC.
> I will also use that for apartments that have 1 normal size bedroom and
> another that is really a walk in closet.
Here we don't call it as a room, so still no need of a half "room" :)
But of course you should on calling things as they are called over there, but
here you never have a half room or bathroom, but if I had been working on
something similar here, I would have more options in that case and only
display those options on the web page that the flat/apartment has.
//Aho
Re: Learning php Sql -EDITED- ignore other post from today
am 15.06.2006 23:04:29 von Frankly
"J.O. Aho" wrote in message
news:4fb1eiF1hup8mU1@individual.net...
> strawberry wrote:
>
>> I'm still not sure that the images bit is flexible enough, but I guess
>> it's a start.
>
> It depends on what would be stored there, if it's with full path to the
> image, then it may or may not be enough, but if it's just the name of the
> image (you can hardcode the path, so you don't need to save that in the
> table), then many digital cameras uses 8.3 (12 character in total) as the
> name for the image, in this case the 50 would be over kill, but then I
> don't know what Frankly want to store.
>
>
> //Aho
I dont really know what hardcoding the path involves. As to what I want to
do.
I would have to ask your opinions on the subject. which would be better for
me at my skill level lol.
any recommendations on which way to go would be great.
Frank
Re: Learning php Sql -EDITED- ignore other post from today
am 15.06.2006 23:23:31 von Shion
Frankly wrote:
> "J.O. Aho" wrote in message
>> strawberry wrote:
>>
>>> I'm still not sure that the images bit is flexible enough, but I guess
>>> it's a start.
>> It depends on what would be stored there, if it's with full path to the
>> image, then it may or may not be enough, but if it's just the name of the
>> image (you can hardcode the path, so you don't need to save that in the
>> table), then many digital cameras uses 8.3 (12 character in total) as the
>> name for the image, in this case the 50 would be over kill, but then I
>> don't know what Frankly want to store.
>
> I dont really know what hardcoding the path involves.
Instead of storing "http://example.net/images/IMAGE.JPG" in the database you
may only store te image name "IMAGE.JPG" in the database, then you can query
the image name from the database and concat it with the hardcoded path.
$fullpathofimage="http://example.net/images/" . $row['ImageName'];
> As to what I want to do.
I think it's a good option.
> I would have to ask your opinions on the subject. which would be better for
> me at my skill level lol.
> any recommendations on which way to go would be great.
I would make an include file where I store variables with values for things I
would have fixed, like the path to the images in this example
---- includefile.php ----
$imagepath="http://example.net/images/";
?>
---- eof ----
and then you include that file to all your scripts and you have only one file
where to change the static info.
---- script1.php ----
include_once('includefile.php');
....
?>

....
---- eof ----
I hope you get the picture of what I mean, bit late here so my brain is a bit
slow at the moment.
//Aho
Re: Learning php Sql -
am 16.06.2006 00:22:21 von Frankly
"J.O. Aho" wrote in message
news:4fb1eiF1hup8mU1@individual.net...
> strawberry wrote:
>
>> I'm still not sure that the images bit is flexible enough, but I guess
>> it's a start.
>
> It depends on what would be stored there, if it's with full path to the
> image, then it may or may not be enough, but if it's just the name of the
> image (you can hardcode the path, so you don't need to save that in the
> table), then many digital cameras uses 8.3 (12 character in total) as the
> name for the image, in this case the 50 would be over kill, but then I
> don't know what Frankly want to store.
>
>
> //Aho
I am thinking it would be better to hardcode the path. I tried to do the 2
foreign key, primary key thing.
of course it did not work with the tables I have done before. i need to try
it again with these tables once they are corrected.
the camera does a IMG_166 for example.
i normally leave what the camera does and add in Kitchen, bathroom ect. the
camera helps me keep the file names unigue. another choice might be a table
with hardcode paths to the pictures and make a relation to the apartments
table and if that works would i need a relation for the buildings table to
show that picture.
Frank
Re: Learning php Sql
am 16.06.2006 00:50:09 von Frankly
>
> Instead of storing "http://example.net/images/IMAGE.JPG" in the database
> you may only store te image name "IMAGE.JPG" in the database, then you can
> query the image name from the database and concat it with the hardcoded
> path.
>
> $fullpathofimage="http://example.net/images/" . $row['ImageName'];
>
>
>> As to what I want to do.
>
> I think it's a good option.
>
>
>> I would have to ask your opinions on the subject. which would be better
>> for me at my skill level lol.
>> any recommendations on which way to go would be great.
>
> I would make an include file where I store variables with values for
> things I would have fixed, like the path to the images in this example
>
> ---- includefile.php ----
>
> $imagepath="http://example.net/images/";
> ?>
> ---- eof ----
>
> and then you include that file to all your scripts and you have only one
> file where to change the static info.
>
> ---- script1.php ----
>
> include_once('includefile.php');
> ...
> ?>
> 
> ...
> ---- eof ----
>
>
> I hope you get the picture of what I mean, bit late here so my brain is a
> bit slow at the moment.
>
>
> //Aho
i will need to get back to this in a day or 2. the tutorials i have used so
far for php and sql only showed how to get pictures to display in
phpmyadmin. or at least that is all i remember.
Re: Learning php Sql -
am 16.06.2006 01:29:53 von Shion
Frankly wrote:
> "J.O. Aho" wrote in message
> news:4fb1eiF1hup8mU1@individual.net...
>> strawberry wrote:
>>
>>> I'm still not sure that the images bit is flexible enough, but I guess
>>> it's a start.
>> It depends on what would be stored there, if it's with full path to the
>> image, then it may or may not be enough, but if it's just the name of the
>> image (you can hardcode the path, so you don't need to save that in the
>> table), then many digital cameras uses 8.3 (12 character in total) as the
>> name for the image, in this case the 50 would be over kill, but then I
>> don't know what Frankly want to store.
>>
>>
>> //Aho
>
> I am thinking it would be better to hardcode the path. I tried to do the 2
> foreign key, primary key thing.
Should be
CREATE TABLE tablename( id1 INT, id2 INT, PRIMARY KEY(id1,id2));
> the camera does a IMG_166 for example.
> i normally leave what the camera does and add in Kitchen, bathroom ect.
In that case the varchar(50) makes more sense, maybe you can go down to say 30
or 40, this makes the database to become smaller.
> another choice might be a table
> with hardcode paths to the pictures and make a relation to the apartments
> table and if that works would i need a relation for the buildings table to
> show that picture.
You could make a relation table with ImageID, ApartmentID and BuildingID, this
way you don't have to make as many joins if you want to show pictures from all
apartments in a building. The ImageID could be the name of the picture.
//Aho
Re: Learning php Sql -
am 16.06.2006 15:07:57 von zac.carey
With regards the VARCHAR(1) fields listed above, is there any advantage
(in terms of performance) of CHAR(1) over VARCHAR(1)? Would anyone do
it differently - other than normalizing it of course?
Re: Learning php Sql -
am 16.06.2006 18:12:55 von Shion
strawberry wrote:
> With regards the VARCHAR(1) fields listed above, is there any advantage
> (in terms of performance) of CHAR(1) over VARCHAR(1)? Would anyone do
> it differently - other than normalizing it of course?
>
From the MySQL online manual:
The length of a CHAR column is fixed to the length that you declare when you
create the table. The length can be any value from 0 to 255. When CHAR values
are stored, they are right-padded with spaces to the specified length. When
CHAR values are retrieved, trailing spaces are removed.
So CHAR(50) will always be 50 characters long, while a VARCHAR(50) will be as
long as the string stored, to a max of 50 characters. There are more
differences, for more info you can check
http://dev.mysql.com/doc/refman/5.0/en/char.html
//Aho
Re: Learning php Sql -
am 16.06.2006 21:59:22 von Frankly
>> I am thinking it would be better to hardcode the path. I tried to do the
>> 2 foreign key, primary key thing.
>
> Should be
>
> CREATE TABLE tablename( id1 INT, id2 INT, PRIMARY KEY(id1,id2));
i dont know what code was created within the admin. now that I think my
tables are stable enough
its time to try this 2 primary key thing. ok ok I know its not ready yet.
that new ImageApartmentsBuildings table got me not knowing again.
> You could make a relation table with ImageID, ApartmentID and BuildingID,
> this way you don't have to make as many joins if you want to show pictures
> from all apartments in a building. The ImageID could be the name of the
> picture.
>
>
> //Aho
I have been looking at other database relationships trying to figure out how
I can use it to create my relations. I don't know if this is right at all.
Management Table
ManID - Key, Int Auto
Name - varchar (45)
FirstName - Varchar (20)
LastName - varchar (20)
Phone - Varchar (20)
Address - Varchar (45)
City - varchar (20) default New York
State varchar (2) default NY
ZipCode - Varchar (10)
Website - Varchar (255)
Buildings Table - for the yes/no fields I would like to create a default
that isn't yes or no.
One that lets me know that information isn't known yet. I am thinking a
default of 2 for unknown.
BuildingID - Key - INT - Auto
Name - Varchar (20)
Address - varchar ( 45 )
Cross streetA - Varchar 50
Cross StreetB - Varchar 50
WebSite - Varchar 255
Picture - Varchar 25
Elevator- varchar 1 default 2
Laundry - varchar 1 default 2
Dogs - varchar 1
Cats - varchar 1.
pets comments if pets = 1 - if empty dont show.
Gym -varchar 1
video intercome varchar 1
contact varchar 45
contact phone varchar 45
Area varchar 20
Zip Code Varchar 10
RelationManagementBuilding table
ManagementID INT
BuildingID INT
Apartments Table
ApartmentID - PK auto - int to image table?
BuildingID - int
Rent - dec
AptNumber - varchar 6
Bedroom - dec 3
bathroom - dec 3
WebSite varchar 255
Picture varchar 25
Notes - text - there will be 4 picture fields and 1 note field for each
picture.
MoveInDate - Date 0000-00-00
Still Available Varchar 2
ZipArea table
ZipCode varchar 10
Area varchar 20
RelationPictureApartmentBuilding Table\
ImageID Auto
ApartmentID F, int to apartments table
BuildingID int
I have been looking at other database relationships trying to figure out how
I can use it to create my relations. I don't know if this is right at all.
Re: Learning php Sql -
am 16.06.2006 22:05:57 von Frankly
news:1150463277.771418.303770@g10g2000cwb.googlegroups.com.. .
> With regards the VARCHAR(1) fields listed above, is there any advantage
> (in terms of performance) of CHAR(1) over VARCHAR(1)? Would anyone do
> it differently - other than normalizing it of course?
i am trying to think what I can do to prevent duplicating as much as
possible.
please dont take any of the feed back i give your posts as a reason why i
wont do what you suggest.
I am just saying why i did it. I am not a stubburn person at all ( unless I
am right :) ). so please if you see something you think is wrong and i
explain why i did it that why. please tell me if you think it is still
wrong. i am in no place to correct anyone in this group and know that you
see things in the future where right now I am taking one step at a time.
I feel once I get into PHP i will be a little better off and be able to
learn more from the examples i find on the internet.
once again i can not thank you people enough for what you are doing.
Frank
Re: Learning php Sql -
am 16.06.2006 23:13:42 von Shion
Frankly wrote:
> I have been looking at other database relationships trying to figure out how
> I can use it to create my relations. I don't know if this is right at all.
> Buildings Table - for the yes/no fields I would like to create a default
> that isn't yes or no.
DEFAULT NULL
> BuildingID - Key - INT - Auto
>
> Name - Varchar (20)
>
> Address - varchar ( 45 )
>
> Cross streetA - Varchar 50
>
> Cross StreetB - Varchar 50
>
> WebSite - Varchar 255
>
> Picture - Varchar 25
>
> Elevator- varchar 1 default 2
>
> Laundry - varchar 1 default 2
Don't use VARCHAR(1) here, use INT(1) and all other where you are using values
1 or 0 (NULL if unknown).
> Dogs - varchar 1
>
> Cats - varchar 1.
>
> pets comments if pets = 1 - if empty dont show.
>
> Gym -varchar 1
>
> video intercome varchar 1
>
> contact varchar 45
>
> contact phone varchar 45
>
> Area varchar 20
>
> Zip Code Varchar 10
> Apartments Table
>
>
>
> ApartmentID - PK auto - int to image table?
>
> BuildingID - int
>
> Rent - dec
>
> AptNumber - varchar 6
>
> Bedroom - dec 3
>
> bathroom - dec 3
>
> WebSite varchar 255
>
> Picture varchar 25
This allows you to only have one image per apartment, not that good, I would
skip this one completely.
> Notes - text - there will be 4 picture fields and 1 note field for each
> picture.
You could skip this too.
> MoveInDate - Date 0000-00-00
>
> Still Available Varchar 2
> RelationPictureApartmentBuilding Table\
>
> ImageID Auto
>
> ApartmentID F, int to apartments table
>
> BuildingID int
This don't make any sense, here is what I would have done:
Picture Table
ImageID VARCHAR(25) ;The name of the image.
ApartmentID INT ;from the Apartments Table
BuildingID INT ;from the Buildings Table
Notes TEXT ;Description of the image
This way you aren't limited to how many pictures an apartment can have, you
could have one from each room, even if the apartment would have 12 rooms, 4
bathrooms, a kitchen and a big living room which you have 3 photos of.
As the camera ID plus your description on the filename makes each image name
to be unique, you can use it as the ImageID, this way you save a bit of space
and you don't need as many columns.
> I have been looking at other database relationships trying to figure out how
> I can use it to create my relations. I don't know if this is right at all.
Your RelationPictureApartmentBuilding table is lacking completely a relation
to the image, it's quite useless, the only relations it has is
building-apartment, the same relation is hold in the picture table I done and
data about the images.
//Aho
Re: Learning php Sql -
am 16.06.2006 23:16:09 von Shion
J.O. Aho wrote:
> Your RelationPictureApartmentBuilding table is lacking completely a
> relation to the image, it's quite useless, the only relations it has is
> building-apartment, the same relation is hold in the picture table I
> done and data about the images.
I hope you don't take offense of the strong wording here, but your ImageID
don't relate anywhere.
//Aho
Re: Learning php Sql -
am 16.06.2006 23:55:26 von Frankly
"strawberry" wrote in message
news:1150463277.771418.303770@g10g2000cwb.googlegroups.com.. .
> With regards the VARCHAR(1) fields listed above, is there any advantage
> (in terms of performance) of CHAR(1) over VARCHAR(1)? Would anyone do
> it differently - other than normalizing it of course?
i remember reading and have seen those that know so much more than I do
argue about this.
from what i have read on this i feel 1 type helps create a smaller database
while the other is better for searches.
i have also read that with todays computers it makes less of a difference as
far as the speed goes.
i am also happy for picking the right plan for my data base. the cheaper
plan would not allow me to create some of these relations using the MyISAM
and lucky for me the middle plan did include the InnoDB.
thank goodness those are the only 2 choices i have lol with this plan.
Frank
Re: Learning php Sql -
am 17.06.2006 00:38:43 von Frankly
"J.O. Aho" wrote in message
news:4fglcpF1i90ndU2@individual.net...
> J.O. Aho wrote:
>
>> Your RelationPictureApartmentBuilding table is lacking completely a
>> relation to the image, it's quite useless, the only relations it has is
>> building-apartment, the same relation is hold in the picture table I done
>> and data about the images.
>
> I hope you don't take offense of the strong wording here, but your ImageID
> don't relate anywhere.
>
>
>
> //Aho
no offense taken but i do feel bad. this is my first time building a
database. Before this i did build a flat file of about 8 columns. i know
that has nothing to do with my putting varchars where I should have known
and do know to put INT - i have no excuse and can understand your thinking
HTH. i think i put varchar when i thought it was going to be Yes or No, but
also be to honest I am a bit confused because i thought as long as you wont
be using numbers for calculations varchar can be used. not questioning you
at all, I will make them INT.
i wish i didnt bother looking into all that MS and Coldfusion stuff. I
should have just jumped in and did this when that tutorial was fresh in my
head. Still is no excuse for some of the mistakes I have been making.
Frank
Re: Learning php Sql -
am 17.06.2006 01:31:44 von Shion
Frankly wrote:
> no offense taken but i do feel bad. this is my first time building a
> database.
Most of your doings are good and first time is learning, next time you will
make an excellent job.
> i know
> that has nothing to do with my putting varchars where I should have known
> and do know to put INT - i have no excuse and can understand your thinking
> HTH. i think i put varchar when i thought it was going to be Yes or No, but
> also be to honest I am a bit confused because i thought as long as you wont
> be using numbers for calculations varchar can be used.
It's faster to use 0 for NO, 1 for YES, it takes longer time to compare string
than compare values and you get an easier syntax
if($intval) {
/* the $intval is a value bigger or less than 0 - we got a yes */
} else {
/* the $intval is 0, we got a no */
}
compared to
if(strcmp(strtolower($string),"yes")==0) {
/* we have a yes */
} else if(strcmp(strtolower($string),"no")==0) {
/* we got a no */
}
For a multi option, you could do
switch(intval) {
case 0:
/* We have a no */
break;
case 1:
/* We have a yes */
break;
default:
/* We got something else, so we will tell we don't know */
break;
}
of course you can do the switch and use strings, but comparing string takes
always more time than comparing values.
> i wish i didnt bother looking into all that MS and Coldfusion stuff. I
> should have just jumped in and did this when that tutorial was fresh in my
> head. Still is no excuse for some of the mistakes I have been making.
We all make mistakes, that's what makes us humans.
There can be many good ideas in the coldfusion tutorials that you can have use
of too, so I won't say it's a mistake to read it.
//Aho
Re: Learning php Sql -
am 19.06.2006 18:38:27 von Frankly
"J.O. Aho" wrote in message
news:4fgtb0F1jdibqU1@individual.net...
> Frankly wrote:
>
>> no offense taken but i do feel bad. this is my first time building a
>> database.
>
> Most of your doings are good and first time is learning, next time you
> will make an excellent job.
if i was younger i think i would like to do something like this. what i was
thinking with that new table
was that it could very well be that i had to delete some of the relations
and create new ones using that new table. I felt like anything thing i did
was a total guess. yes i did think of just making creations from those
fields.
>
>> i know that has nothing to do with my putting varchars where I should
>> have known and do know to put INT - i have no excuse and can understand
>> your thinking HTH. i think i put varchar when i thought it was going to
>> be Yes or No, but also be to honest I am a bit confused because i thought
>> as long as you wont be using numbers for calculations varchar can be
>> used.
>
>> i wish i didnt bother looking into all that MS and Coldfusion stuff. I
>> should have just jumped in and did this when that tutorial was fresh in
>> my head. Still is no excuse for some of the mistakes I have been making.
>
> We all make mistakes, that's what makes us humans.
> There can be many good ideas in the coldfusion tutorials that you can have
> use of too, so I won't say it's a mistake to read it.
>
>
> //Aho
basically what i did was research my choices, see who says what is easiest
and who thinks what are the best. my main concern was money. i didnt want
to start a path only to find out that at the end i would need a program that
cost a few grand. lots of what I read i think turned out to be spam. for
the first time in i cant remember how long I actually took off both days
this week end. I finished up enough work so that I can now put these tables
in my admin. I am going to be adding a few new fields that I use to post
adds to online realestate pages. see you soon :). after that i will try to
create the relations.
Frank.
Re: Learning php Sql
am 19.06.2006 18:42:41 von Frankly
"J.O. Aho" wrote in message
news:4fe1ekF1j1jtlU1@individual.net...
> Frankly wrote:
>> "J.O. Aho" wrote in message
>>> strawberry wrote:
>>>
>>>> I'm still not sure that the images bit is flexible enough, but I guess
>>>> it's a start.
>>> It depends on what would be stored there, if it's with full path to the
>>> image, then it may or may not be enough, but if it's just the name of
>>> the image (you can hardcode the path, so you don't need to save that in
>>> the table), then many digital cameras uses 8.3 (12 character in total)
>>> as the name for the image, in this case the 50 would be over kill, but
>>> then I don't know what Frankly want to store.
>>
>> I dont really know what hardcoding the path involves.
>
> Instead of storing "http://example.net/images/IMAGE.JPG" in the database
> you may only store te image name "IMAGE.JPG" in the database, then you can
> query the image name from the database and concat it with the hardcoded
> path.
>
> $fullpathofimage="http://example.net/images/" . $row['ImageName'];
>
>
>> As to what I want to do.
>
> I think it's a good option.
>
>
>> I would have to ask your opinions on the subject. which would be better
>> for me at my skill level lol.
>> any recommendations on which way to go would be great.
>
> I would make an include file where I store variables with values for
> things I would have fixed, like the path to the images in this example
>
> ---- includefile.php ----
>
> $imagepath="http://example.net/images/";
> ?>
> ---- eof ----
>
> and then you include that file to all your scripts and you have only one
> file where to change the static info.
>
> ---- script1.php ----
>
> include_once('includefile.php');
> ...
> ?>
> 
> ...
> ---- eof ----
>
>
> I hope you get the picture of what I mean, bit late here so my brain is a
> bit slow at the moment.
>
>
> //Aho
i was actually very excited when i read this post.. My first PHP script file
:). I did want to wait to reply
until i actually had a script of my own to reply. however i feel now that
its like waiting to long to say thank you for a really good birthday
present.
thank you Aho who ever you are :).
Frank
Re: Learning php Sql -
am 19.06.2006 19:37:40 von Shion
Frankly wrote:
> "J.O. Aho" wrote in message
> what i was thinking with that new table
> was that it could very well be that i had to delete some of the relations
> and create new ones using that new table. I felt like anything thing i did
> was a total guess. yes i did think of just making creations from those
> fields.
Okey, like a temp table? That could be useful. The reason I was so against the
table was that there was no image id anywhere else and you had it already
building and apartment relations in the apartment table.
I do regret that I did tell my opinion in such strong words and I understand
it was a hard blow for you.
> basically what i did was research my choices, see who says what is easiest
> and who thinks what are the best. my main concern was money. i didnt want
> to start a path only to find out that at the end i would need a program that
> cost a few grand.
*nods*
Thats always a risk that comes, as long as you don't have the option of making
it yourself and have the time to spend.
> I finished up enough work so that I can now put these tables
> in my admin. I am going to be adding a few new fields that I use to post
> adds to online realestate pages. see you soon :). after that i will try to
> create the relations.
I would suggest when you have created your tables, make a "backup" of the
database, this way you can experiment with filling test data and see that
everything works, and if they do, you can easily recreate an empty database
with all the tables empty and IDs starting from 1 again.
I hope it will go well for you and don't forget ALTER TABLE if you notice that
your table is missing something after you have created it and filled it with
test data, instead of dropping it and make a new one and then fill it again
with data, you can make the changes directly.
http://dev.mysql.com/doc/refman/5.0/en/alter-table.html (works the same way in
older versions too).
//Aho
Re: Learning php Sql
am 19.06.2006 19:37:56 von Frankly
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.
i will need to add 10 feilds.
Website, to save space i think i will just make this a Varchar ( 40) there
is no need for this to be a link.
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.
Edit link. Varchar (255)
Date posted. date 0000-00-00
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?
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.
If i had my own place i would make them all 1 month fee. i think that is
very reasonable.
Frank
Re: Learning php Sql -
am 19.06.2006 19:46:56 von Frankly
"J.O. Aho" wrote in message
news:4fo5n4F1ji4k0U1@individual.net...
> Frankly wrote:
>> "J.O. Aho" wrote in message
>
>> what i was thinking with that new table
>> was that it could very well be that i had to delete some of the relations
>> and create new ones using that new table. I felt like anything thing i
>> did was a total guess. yes i did think of just making creations from
>> those fields.
>
> Okey, like a temp table? That could be useful. The reason I was so against
> the table was that there was no image id anywhere else and you had it
> already building and apartment relations in the apartment table.
> I do regret that I did tell my opinion in such strong words and I
> understand it was a hard blow for you.
dont regret it my friend. you had no way of knowing how i felt at the time.
even until now i didnt express myself correctly. I felt any thing i did was
a total guess or in my heart it felt like a cheat.
what i think i ended up doing was making a post with the fields and saying -
please create the relations for me. but in my heart I couldnt help but feel
no matter what relations I put it was a guess and the end result was the
same. i felt terribly guilty and no matter how many relations i looked at
for examples i couldnt figure it out to the point where I didnt feel it was
a guess. however my first quess believe it or not was just to create new
relations with the new fields. I am sorry I didnt do that because it looked
bad for me.
>
>
>> basically what i did was research my choices, see who says what is
>> easiest and who thinks what are the best. my main concern was money. i
>> didnt want to start a path only to find out that at the end i would need
>> a program that cost a few grand.
>
> *nods*
> Thats always a risk that comes, as long as you don't have the option of
> making it yourself and have the time to spend.
>
>
>
>> I finished up enough work so that I can now put these tables in my admin.
>> I am going to be adding a few new fields that I use to post adds to
>> online realestate pages. see you soon :). after that i will try to
>> create the relations.
>
> I would suggest when you have created your tables, make a "backup" of the
> database, this way you can experiment with filling test data and see that
> everything works, and if they do, you can easily recreate an empty
> database with all the tables empty and IDs starting from 1 again.
Will do and thank you.
>
> I hope it will go well for you and don't forget ALTER TABLE if you notice
> that your table is missing something after you have created it and filled
> it with test data, instead of dropping it and make a new one and then fill
> it again with data, you can make the changes directly.
> http://dev.mysql.com/doc/refman/5.0/en/alter-table.html (works the same
> way in older versions too).
>
>
>
> //Aho
Re: Learning php Sql
am 19.06.2006 19:49:07 von Shion
Frankly wrote:
> "J.O. Aho" wrote in message
>> I hope you get the picture of what I mean, bit late here so my brain is a
>> bit slow at the moment.
> i was actually very excited when i read this post.. My first PHP script file
> :). I did want to wait to reply
> until i actually had a script of my own to reply. however i feel now that
> its like waiting to long to say thank you for a really good birthday
> present.
:) I'm glad to hear that you got use of the example and created a working
script yourself. If I had knew it was your birthday, I had made it more
special. Happy Birthday !!!
//Aho
Re: Learning php Sql
am 19.06.2006 20:30:41 von Shion
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
Re: Learning php Sql
am 19.06.2006 21:13:14 von Frankly
"J.O. Aho" wrote in message
news:4fo8qhF1jvtpeU1@individual.net...
>> 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).
I have never posted to 10 but they are out there.
>
>
>> 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).
sorry bout that i am still thinking the old way. this database is going to
be a fantastic tool
that i will be working from most of the time. yes I will prep it for the
web site instead of using my favorites list.
>
>
>> 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.
will do and i will make proper relations to this new table.
>
>
>> Edit link. Varchar (255)
>
> Not sure what this is, so I can't comment this.
usually when i post an ad, I get a reply email with a link to that ad. if i
post 10 ads i get 10 emails back.
>
>
>> 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());
I hope by tomorrow I am doing stuff like this.
>
>
>> 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.
i take it that you like the binary way better. in doing this i would have
to watch out for values that can have different combos like your not making
the 3rd 3. when someone is helping me i usually go the way they think is
best. I am wondering how much extra code will be needed and if using the
number system will be more confusing for my wife and allow for more errors.
having a feild for each site does seem easier but you have the ability to
see down the road.
i find it odd that the Administrator does not have a print function to print
out my table structure.
>
>> 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.
you are not good at ENUM? there must be more to it than i know. dispite
the mistake i made in another post. i did do enums in a tutorial. i
thought you didnt like enum perhaps because it was slower than using INT
>
>
>> 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
i have met this one and wow, I would love to get my wife out of there.
Re: Learning php Sql
am 20.06.2006 00:11:24 von Frankly
> table managementbuildingrelation
> managementid buildingid [managementid+buildingid=primary key]
>
> M001 B002
> M002 B001
> M001 B003
CREATE TABLE 'RelationManagementsBuildings (
ManID int not null,
BuildingID int not null,
primary key (ManID,BuildingID))
that was actually the first time i typed something like that.
from what I understand this would create the table I need but for the life
of me i can not figure out
how to do it in the MySQL Administrator.
i am begining to wonder if i am better off droping this admin tool lol.
i can easily creat 2 primary keys once the table is made
this is hard
Re: Learning php Sql
am 20.06.2006 03:10:02 von Frankly
i Have a table with 2 primary keys any time i try to make a relation it does
work.
i do not know how to view the sql from the administrator so cant tell if its
2 primary keys or id+id primary key.
I have created lots of relationships in Acces. video tutorials is one place
that MS has the upper hand.
do i need to insert records first.
--
Frank
PHPmySQL1@yahoo.com
"Frankly" wrote in message
news:giFlg.2571$DI2.1722@trnddc05...
>
>
>> table managementbuildingrelation
>> managementid buildingid [managementid+buildingid=primary key]
>>
>> M001 B002
>> M002 B001
>> M001 B003
>
> CREATE TABLE 'RelationManagementsBuildings (
> ManID int not null,
> BuildingID int not null,
> primary key (ManID,BuildingID))
>
> that was actually the first time i typed something like that.
>
> from what I understand this would create the table I need but for the life
> of me i can not figure out
> how to do it in the MySQL Administrator.
> i am begining to wonder if i am better off droping this admin tool lol.
> i can easily creat 2 primary keys once the table is made
> this is hard
>
Re: Learning php Sql
am 20.06.2006 03:35:52 von Shion
Frankly wrote:
> "J.O. Aho" wrote in message
>>> 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.
>
> i take it that you like the binary way better. in doing this i would have
> to watch out for values that can have different combos like your not making
> the 3rd 3. when someone is helping me i usually go the way they think is
> best. I am wondering how much extra code will be needed and if using the
> number system will be more confusing for my wife and allow for more errors.
> having a feild for each site does seem easier but you have the ability to
> see down the road.
I'm really not sure, I do like the idea of the binary way, but having
different columns is the easy way around, of course you need to add more
columns if you increase the number of places where to post. With the columns
it's easier to search for sites that has been posted at one specific site
SELECT * FROM table WHERE site1column=1;
while withe the binary system you would need to make
SELECT * FROM table where stiescolumn IN(1,3,5,7,9,11,13,15);
> i find it odd that the Administrator does not have a print function to print
> out my table structure.
It can be quite a lot of data in a database, say you have 100000 rows, then
you could end up with a really big print. It's not meant to be used by normal
users to check things, for that you usually have a front end.
//Aho
Re: Learning php Sql
am 20.06.2006 03:37:41 von Shion
Frankly wrote:
> i Have a table with 2 primary keys any time i try to make a relation it does
> work.
> i do not know how to view the sql from the administrator so cant tell if its
> 2 primary keys or id+id primary key.
> I have created lots of relationships in Acces. video tutorials is one place
> that MS has the upper hand.
> do i need to insert records first.
I'm not sure either how to do that, I haven't used the mysql admin more than
once more for fun, I guess I should take a look at it when back home from work.
//Aho
Re: Learning php Sql
am 20.06.2006 03:59:44 von Frankly
i just learned how to view the sql from the admin
for some reason the relations table is the only one that shows the
Row_Format=Dynamic.
i am so glad i found this. I am so tired and while I am looking at this I
did make a few changes. if you see anything that looks really stupid you
dont have to fix it just give me some pointers. for the life of me i dont
know why i cant do these relations. although i just found this
In the manual search for this chapter "Creating InnoDB Tables" and the title
"FOREIGN KEY Constraints"...
Foreign keys definitions are subject to the following conditions:
- Both tables must be InnoDB type.
- In the referencing table, there must be an index where the foreign key
columns are listed as the first columns in the same order.
- In the referenced table, there must be an index where the referenced
columns are listed as the first columns in the same order.
- Index prefixes on foreign key columns are not supported. One consequence
of this is that BLOB and TEXT columns cannot be included in a foreign key,
because indexes on those columns must always include a prefix length
i am to tired to try again.
i think the problem i am having here is not naming the index's and foreign
keys correctly. im going to stop for the night.
this the the RelationManagements table
DROP TABLE IF EXISTS `myweb325573_grace`.`RelationManagementsBuildings`;
CREATE TABLE `RelationManagementsBuildings` (
`ManID` int(10) unsigned NOT NULL default '0',
`BuildingID` int(10) unsigned NOT NULL default '0',
PRIMARY KEY (`ManID`,`BuildingID`)
) TYPE=InnoDB ROW_FORMAT=DYNAMIC;
this is the Managements table
DROP TABLE IF EXISTS `myweb325573_grace`.`Managements`;
CREATE TABLE `Managements` (
`ManID` int(10) unsigned NOT NULL auto_increment,
`Name` varchar(45) NOT NULL default '',
`Contact` varchar(20) NOT NULL default '',
`Phone` varchar(20) NOT NULL default '',
`Address` varchar(45) NOT NULL default '',
`City` varchar(20) NOT NULL default 'New York',
`State` char(2) NOT NULL default 'NY',
`ZipCode` varchar(10) NOT NULL default '',
`WebSite` varchar(255) NOT NULL default '',
PRIMARY KEY (`ManID`)
) TYPE=InnoDB;
this is the Buildings table
DROP TABLE IF EXISTS `myweb325573_grace`.`Buildings`;
CREATE TABLE `Buildings` (
`BuildingID` int(10) unsigned NOT NULL auto_increment,
`BuildingName` varchar(20) NOT NULL default '',
`Address` varchar(45) NOT NULL default '',
`Street` varchar(45) NOT NULL default '',
`CrossStreetA` varchar(45) NOT NULL default '',
`CrossStreetB` varchar(45) NOT NULL default '',
`WebSite` varchar(255) default NULL,
`Elevator` int(10) unsigned default NULL,
`Laundry` int(10) unsigned default NULL,
`Dogs` int(10) unsigned default NULL,
`Cats` int(10) unsigned default NULL,
`Gym` int(10) unsigned default NULL,
`VideoIntercom` int(10) unsigned default NULL,
`Contact` varchar(20) NOT NULL default '',
`ContactPhone` varchar(15) NOT NULL default '',
`Area` varchar(20) NOT NULL default '',
`ZipCode` varchar(10) NOT NULL default '',
`Notes` text NOT NULL,
PRIMARY KEY (`BuildingID`)
) TYPE=InnoDB;
--
Frank
PHPmySQL1@yahoo.com
Re: Learning php Sql
am 20.06.2006 09:02:49 von Frankly
its just about 3am here. I was having a hard time sleeping so i figured i
would give this another shot.
CREATE DATABASE `myweb325573_grace`;
DROP TABLE IF EXISTS `myweb325573_grace`.`RelationManagementsBuildings`;
CREATE TABLE `RelationManagementsBuildings` (
`ManID` int(10) unsigned NOT NULL default '0',
`BuildingID` int(10) unsigned NOT NULL default '0',
PRIMARY KEY (`ManID`,`BuildingID`),
CONSTRAINT `FK_RelationManagementsBuildings_1` FOREIGN KEY (`ManID`)
REFERENCES `Managements` (`ManID`) ON DELETE CASCADE ON UPDATE CASCADE
) TYPE=InnoDB ROW_FORMAT=DYNAMIC;
i think this is wrong because it was created in the ManagementsBuildings
table and used
the primary keys in the other tables as foreign.
o well it the admin crashed because i picked the wrong table ok ok i tried
to create a relation for the relation table to the relation table lol duh..
i realized it as soon as i pressed the button. well my foot fell asleep big
time and its bothering me. time to try sleep once again. 3:01am see you
in 5 hours hope i get at least 4 hours. it dont look good.
Frank
Re: Learning php Sql
am 20.06.2006 18:48:40 von Shion
Frankly wrote:
> its just about 3am here. I was having a hard time sleeping so i figured i
> would give this another shot.
>
> CREATE DATABASE `myweb325573_grace`;
This creates the database itself, you don't need this at this moment, as it's
already created.
> DROP TABLE IF EXISTS `myweb325573_grace`.`RelationManagementsBuildings`;
This removes the table RelationManagementsBuildings, if it already exists in
the database.
> CREATE TABLE `RelationManagementsBuildings` (
>
> `ManID` int(10) unsigned NOT NULL default '0',
>
> `BuildingID` int(10) unsigned NOT NULL default '0',
>
> PRIMARY KEY (`ManID`,`BuildingID`),
This seems okey.
> CONSTRAINT `FK_RelationManagementsBuildings_1` FOREIGN KEY (`ManID`)
> REFERENCES `Managements` (`ManID`) ON DELETE CASCADE ON UPDATE CASCADE
Haven't used Constraints and cascades, I guess I should read on them, but the
part here you could drop without it affecting the main functionality of the
table, if you remove this, don't forget to remove the comma after the
definition of the primary keys.
Haven't slept much myself tonight, so I will be off early today.
//Aho
Re: Learning php Sql
am 20.06.2006 18:57:39 von Frankly
no matter what i try i keep getting
mysql error 1005 and errno:150. i read alot about this error and can not
see where it applies
to what I am doing wrong.
both tables are Innodb, both are set the same, it seems in MySQL
Administrator once you make a key primary it becomes indexed. very
fustrating.
--
Frank
PHPmySQL1@yahoo.com
"Frankly" wrote in message
news:t4Nlg.2360$ia6.1199@trndny09...
>
>
> its just about 3am here. I was having a hard time sleeping so i figured i
> would give this another shot.
>
> CREATE DATABASE `myweb325573_grace`;
>
> DROP TABLE IF EXISTS `myweb325573_grace`.`RelationManagementsBuildings`;
>
> CREATE TABLE `RelationManagementsBuildings` (
>
> `ManID` int(10) unsigned NOT NULL default '0',
>
> `BuildingID` int(10) unsigned NOT NULL default '0',
>
> PRIMARY KEY (`ManID`,`BuildingID`),
>
> CONSTRAINT `FK_RelationManagementsBuildings_1` FOREIGN KEY (`ManID`)
> REFERENCES `Managements` (`ManID`) ON DELETE CASCADE ON UPDATE CASCADE
>
> ) TYPE=InnoDB ROW_FORMAT=DYNAMIC;
>
>
>
> i think this is wrong because it was created in the ManagementsBuildings
> table and used
>
> the primary keys in the other tables as foreign.
>
>
>
>
>
> o well it the admin crashed because i picked the wrong table ok ok i tried
> to create a relation for the relation table to the relation table lol
> duh..
> i realized it as soon as i pressed the button. well my foot fell asleep
> big
> time and its bothering me. time to try sleep once again. 3:01am see you
> in 5 hours hope i get at least 4 hours. it dont look good.
>
>
>
> Frank
>
>
>
Re: Learning php Sql
am 20.06.2006 19:32:40 von Frankly
what I dont understand is what cant I create a 1 to many relationship
with managements and buildings with out using a linking table.
Managements can have many buildings but buildings cant have many
managements.
same thing for apartments. a building can have many aparments but
apartments cant have many buildings.
i know your way is better but perhaps it would be easier for someone with
my skill level to do it that way. I was just in access and created the
relations using the linking table very easily. I am sure it will have some
limits but at this point i think it might be better to have a limited data
driven web site for my busy season and then in the winter work on making a
better database. i just dont know what to do anymore. maybe this thing is
beyond me.
--
Frank
PHPmySQL1@yahoo.com
"Frankly" wrote in message
news:7OVlg.3720$VF.341@trndny03...
> no matter what i try i keep getting
> mysql error 1005 and errno:150. i read alot about this error and can not
> see where it applies
> to what I am doing wrong.
> both tables are Innodb, both are set the same, it seems in MySQL
> Administrator once you make a key primary it becomes indexed. very
> fustrating.
>
> --
>
> Frank
> PHPmySQL1@yahoo.com
> "Frankly" wrote in message
> news:t4Nlg.2360$ia6.1199@trndny09...
>>
>>
>> its just about 3am here. I was having a hard time sleeping so i figured
>> i
>> would give this another shot.
>>
>> CREATE DATABASE `myweb325573_grace`;
>>
>> DROP TABLE IF EXISTS `myweb325573_grace`.`RelationManagementsBuildings`;
>>
>> CREATE TABLE `RelationManagementsBuildings` (
>>
>> `ManID` int(10) unsigned NOT NULL default '0',
>>
>> `BuildingID` int(10) unsigned NOT NULL default '0',
>>
>> PRIMARY KEY (`ManID`,`BuildingID`),
>>
>> CONSTRAINT `FK_RelationManagementsBuildings_1` FOREIGN KEY (`ManID`)
>> REFERENCES `Managements` (`ManID`) ON DELETE CASCADE ON UPDATE CASCADE
>>
>> ) TYPE=InnoDB ROW_FORMAT=DYNAMIC;
>>
>>
>>
>> i think this is wrong because it was created in the ManagementsBuildings
>> table and used
>>
>> the primary keys in the other tables as foreign.
>>
>>
>>
>>
>>
>> o well it the admin crashed because i picked the wrong table ok ok i
>> tried
>> to create a relation for the relation table to the relation table lol
>> duh..
>> i realized it as soon as i pressed the button. well my foot fell asleep
>> big
>> time and its bothering me. time to try sleep once again. 3:01am see
>> you
>> in 5 hours hope i get at least 4 hours. it dont look good.
>>
>>
>>
>> Frank
>>
>>
>>
>
>
Re: Learning php Sql
am 20.06.2006 19:37:08 von Frankly
>> CREATE DATABASE `myweb325573_grace`;
>
> This creates the database itself, you don't need this at this moment, as
> it's already created.
>
>
>> DROP TABLE IF EXISTS `myweb325573_grace`.`RelationManagementsBuildings`;
>
> This removes the table RelationManagementsBuildings, if it already exists
> in the database.
>
those are just statements that were included when i copied the SQL.
>
>> CREATE TABLE `RelationManagementsBuildings` (
>>
>> `ManID` int(10) unsigned NOT NULL default '0',
>>
>> `BuildingID` int(10) unsigned NOT NULL default '0',
>>
>> PRIMARY KEY (`ManID`,`BuildingID`),
>
> This seems okey.
>
>> CONSTRAINT `FK_RelationManagementsBuildings_1` FOREIGN KEY (`ManID`)
>> REFERENCES `Managements` (`ManID`) ON DELETE CASCADE ON UPDATE CASCADE
>
> Haven't used Constraints and cascades, I guess I should read on them, but
> the part here you could drop without it affecting the main functionality
> of the table, if you remove this, don't forget to remove the comma after
> the definition of the primary keys.
but isnt this the part the creates the actual join? this is where I am
having trouble. i did that one fine
but when i try to make the join using the 2nd part of the primary key which
is Buildings and make the join with the buildings table is when i get the
mysql error 1005 (errno:150) if i dont need this join than my tables are
complete. lol at least i think they are.
Frank
>
>
> Haven't slept much myself tonight, so I will be off early today.
>
>
> //Aho
Re: Learning php Sql
am 20.06.2006 20:21:45 von Shion
Frankly wrote:
>>> CREATE DATABASE `myweb325573_grace`;
>> This creates the database itself, you don't need this at this moment, as
>> it's already created.
>>
>>
>>> DROP TABLE IF EXISTS `myweb325573_grace`.`RelationManagementsBuildings`;
>> This removes the table RelationManagementsBuildings, if it already exists
>> in the database.
>>
>
> those are just statements that were included when i copied the SQL.
>
>>> CREATE TABLE `RelationManagementsBuildings` (
>>>
>>> `ManID` int(10) unsigned NOT NULL default '0',
>>>
>>> `BuildingID` int(10) unsigned NOT NULL default '0',
>>>
>>> PRIMARY KEY (`ManID`,`BuildingID`),
>> This seems okey.
>>
>>> CONSTRAINT `FK_RelationManagementsBuildings_1` FOREIGN KEY (`ManID`)
>>> REFERENCES `Managements` (`ManID`) ON DELETE CASCADE ON UPDATE CASCADE
>> Haven't used Constraints and cascades, I guess I should read on them, but
>> the part here you could drop without it affecting the main functionality
>> of the table, if you remove this, don't forget to remove the comma after
>> the definition of the primary keys.
>
> but isnt this the part the creates the actual join? this is where I am
> having trouble. i did that one fine
> but when i try to make the join using the 2nd part of the primary key which
> is Buildings and make the join with the buildings table is when i get the
> mysql error 1005 (errno:150) if i dont need this join than my tables are
> complete. lol at least i think they are.
http://dev.mysql.com/doc/refman/5.0/en/join.html
SELECT * FROM RelationManagementsBuildings LEFT JOIN (ManagementsTable,
BuildingTable) ON (ManagementTable.ManID=RelationManagementsBuildings.ManID
AND BuildingTable.BuildingID=RelationManagementsBuildings.Buildi ngID)
I think the join looks like this, now you would get all the data from both
ManagementsTable and BuildingTable as if they where all stored in the same table.
//Aho
Re: Learning php Sql
am 20.06.2006 21:09:34 von Frankly
"J.O. Aho" wrote in message
news:4fqslqF1k82bvU1@individual.net...
> Frankly wrote:
>>>> CREATE DATABASE `myweb325573_grace`;
>>> This creates the database itself, you don't need this at this moment, as
>>> it's already created.
>>>
>>>
>>>> DROP TABLE IF EXISTS
>>>> `myweb325573_grace`.`RelationManagementsBuildings`;
>>> This removes the table RelationManagementsBuildings, if it already
>>> exists in the database.
>>>
>>
>> those are just statements that were included when i copied the SQL.
>>
>>>> CREATE TABLE `RelationManagementsBuildings` (
>>>>
>>>> `ManID` int(10) unsigned NOT NULL default '0',
>>>>
>>>> `BuildingID` int(10) unsigned NOT NULL default '0',
>>>>
>>>> PRIMARY KEY (`ManID`,`BuildingID`),
>>> This seems okey.
>>>
>>>> CONSTRAINT `FK_RelationManagementsBuildings_1` FOREIGN KEY (`ManID`)
>>>> REFERENCES `Managements` (`ManID`) ON DELETE CASCADE ON UPDATE CASCADE
>>> Haven't used Constraints and cascades, I guess I should read on them,
>>> but the part here you could drop without it affecting the main
>>> functionality of the table, if you remove this, don't forget to remove
>>> the comma after the definition of the primary keys.
>>
>> but isnt this the part the creates the actual join? this is where I am
>> having trouble. i did that one fine
>> but when i try to make the join using the 2nd part of the primary key
>> which is Buildings and make the join with the buildings table is when i
>> get the mysql error 1005 (errno:150) if i dont need this join than my
>> tables are complete. lol at least i think they are.
>
> http://dev.mysql.com/doc/refman/5.0/en/join.html
>
> SELECT * FROM RelationManagementsBuildings LEFT JOIN (ManagementsTable,
> BuildingTable) ON
> (ManagementTable.ManID=RelationManagementsBuildings.ManID AND
> BuildingTable.BuildingID=RelationManagementsBuildings.Buildi ngID)
>
> I think the join looks like this, now you would get all the data from both
> ManagementsTable and BuildingTable as if they where all stored in the same
> table.
>
>
> //Aho
First off all thank you once again.
you know what I hate about reading from Dev.mysql is that they keep jumping
from version to verison
in what can and can not be done in the version you have but can be done in
versions I do not have. of course for people smarter than myself this
probably isnt a problem.
i just can not understand why when i am trying to study what i need to do
and what I can not do that they keep bring up different versions. it is very
confusing. it is probably not their fault as the more i see how complicated
this is the more i wonder if i should expect myself to be able to do it. i
probably could learn it given some time to sit down and study.
i am looking at that statement you gave me and even still I dont know where
to put it. the good news is - i just went to my web sites database and yes
the tables i created locally using the admin tool are there. i am at the
RelationManagementsBuildings table structure tab and see a "Run SQL queries
on database myweb_grace.
Below it is a feild that says.
Select * FROM 'RelationManagementsBuildings' WHERE 1. do i delete that and
put in your statement
or do i ad your statement to this one. I am so sorry I need so much help.
my whole life everytime i wanted to learn something i was able to sit down
and teach myself. ok i never done anything like this but i didnt think i
would require so much help. I would understand if you think i should drop
this design and try something more simple. would also like you to contact
me via email if you dont mind. at least i know that user@example.net isnt a
real email :).
i really did think i would do better at this. I would also understand if
after seeing how much help is needed that you think i should stick with
Access and just upload certain feilds from the database as i make changes
and ask people to refresh their browser. Everyting I read leads me to
believe that SQL is the easy part of this project and that scares me.
i do think that there is pre written scripts for php that will be helpful.
dont mind me i am just feeling a little under the weather today. ttyl and
thank you again.
Frank
Re: Learning php Sql
am 20.06.2006 22:37:41 von Frankly
I guess its time to go back to the PHPmyAdmin tutorial. I do see it says
something about Multi table query generation to create automatic joins lol.
ok ok so i dont know what it means yet but i will.
i am going to start this tutorial over from the begining. I'll Be Back!!!
--
Frank
PHPmySQL1@yahoo.com
Re: Learning php Sql
am 21.06.2006 03:41:38 von Shion
Frankly wrote:
> I guess its time to go back to the PHPmyAdmin tutorial. I do see it says
> something about Multi table query generation to create automatic joins lol.
> ok ok so i dont know what it means yet but i will.
> i am going to start this tutorial over from the begining. I'll Be Back!!!
SELECT is a Sql command to fetch something from a table, WHERE is used to tell
the fetch what you want to fetch, usually with some kind of "if-statement", as
'WHERE columnA=1' tells us that we want everything that in the columnA has
the value 1. When you want data from two or more tables at the same time, you
use JOIN (multi table query), in the JOIN statement you tell which columns in
the tables are the same value, so that the database can put together a
temporary table with all the data you need.
As it's 3 in the morning over here, I'm not in the mood to run the
mysql-administrator as this requires me to open the server running on another
computer for external connections, so I can't at this moment say where you can
use the SQL queries.
When it comes to the online manual, the links I have given you, all those are
the same as for other versions (3.x and 4.x), myself I use Mysql 5 on my
server, so I do make searches against the 5.0 online manual. On the top left
side of the page you have "Find this page for version", just click on the
version number that matches best the version you are using and you get the
page that always will be right for you.
Yes, the example.net e-mail address is a fake one, as no one owns that domain
and is always used for examples, no one will get the spams that spammers
sends. I mail you an e-mail, so you will get mine, don't worry.
Don't worry about things to much, there will always be moments that will feel
difficult, but you will get passed those and you may even wonder afterwards
why you did think things so difficult.
//Aho
Re: Learning php Sql
am 21.06.2006 06:26:26 von Frankly
"J.O. Aho" wrote in message
news:4fqn78F1jt57qU1@individual.net...
> Frankly wrote:
>> its just about 3am here. I was having a hard time sleeping so i figured
>> i
>> would give this another shot.
>>
>> CREATE DATABASE `myweb325573_grace`;
>
> This creates the database itself, you don't need this at this moment, as
> it's already created.
>
>
>> DROP TABLE IF EXISTS `myweb325573_grace`.`RelationManagementsBuildings`;
>
> This removes the table RelationManagementsBuildings, if it already exists
> in the database.
>
>
>> CREATE TABLE `RelationManagementsBuildings` (
>>
>> `ManID` int(10) unsigned NOT NULL default '0',
>>
>> `BuildingID` int(10) unsigned NOT NULL default '0',
>>
>> PRIMARY KEY (`ManID`,`BuildingID`),
>
> This seems okey.
>
>> CONSTRAINT `FK_RelationManagementsBuildings_1` FOREIGN KEY (`ManID`)
>> REFERENCES `Managements` (`ManID`) ON DELETE CASCADE ON UPDATE CASCADE
>
> Haven't used Constraints and cascades, I guess I should read on them, but
> the part here you could drop without it affecting the main functionality
> of the table, if you remove this, don't forget to remove the comma after
> the definition of the primary keys.
>
>
> Haven't slept much myself tonight, so I will be off early today.
>
>
> //Aho
I had a little too much wine tonight so im not about to even think about
that last post of yours :).
I just came to reply to a couple of posts I havnt replied to.
Constraints? well i could cheat and look it up.. I really dont know what
that is - it was done within the Administrator while i was doing what ever
it was I was doing.
Cascades... I believe will help me for if for some reason a building is sold
to a new owner.
I am thinking that cascades are needed to cascade the changes to all the
related records in other tables.
my plan for tonight is to sleep like a baby :).
Frank
Re: Learning php Sql
am 21.06.2006 06:34:03 von Frankly
"J.O. Aho" wrote in message
news:4fo6ckF1k1ddcU1@individual.net...
> Frankly wrote:
>> "J.O. Aho" wrote in message
>
>>> I hope you get the picture of what I mean, bit late here so my brain is
>>> a bit slow at the moment.
>
>> i was actually very excited when i read this post.. My first PHP script
>> file :). I did want to wait to reply
>> until i actually had a script of my own to reply. however i feel now
>> that its like waiting to long to say thank you for a really good birthday
>> present.
>
> :) I'm glad to hear that you got use of the example and created a working
> script yourself. If I had knew it was your birthday, I had made it more
> special. Happy Birthday !!!
>
>
>
> //Aho
I am not really getting use of the PHP file but its sure nice to have it.
its like my first step to geekhood.
ever since i bought my first computer in 1995 i wanted to learn as much as i
could about it. problem is most of ok.. all of my friends cant do more than
send email via AOL.
first thing i did was learn how to type and can type or have tested at about
90 words a minute.. I tested my self with a typing program and the words
were really small.
Sorry for the poor way i express myself in writting most of the time. even
tho i was very excited when i read what you wrote about putting that in my
PHP script file. I delayed the thank you for that because i had hoped to do
even a little something in PHP and then thank you. however that was taking
longer than expected and i felt like i didnt say thank you to someone that
gave me a really good gift.
Frank
Always wanted his own PHP script file :).
now he wants to use it.
Re: Learning php Sql
am 21.06.2006 06:42:42 von Frankly
"J.O. Aho" wrote in message
news:4frmeiF1k59dtU1@individual.net...
> Don't worry about things to much, there will always be moments that will
> feel difficult, but you will get passed those and you may even wonder
> afterwards why you did think things so difficult.
>
>
> //Aho
Yea....... I wasnt myself today. actually for the last couple of days.
remember when i started this how i told you i was snapping at my wife and
threatening my three, five pound dogs? Well it started again but today when
i realized I had to stop and learn or the only way this was going to get
done was if i followed you do it step by step. dont get me wrong i wouldnt
mind but i dont think its what you had intended to do and probably would get
sick of doing. I can tell a lot of things you help me with you expect me to
know and i dont blame you. i aint touching the rest of your reply with a
gold mine of info. tonight i aint thinking about that database. i also
read something today that made me realize or think that sql is going to be
the most important part of this project of mine. dont tell me if i am
wrong. let me get past this and then i will deal with PHP and her little
HTML to.
Have a good night my friend.
Frank
Re: Learning php Sql
am 21.06.2006 20:49:23 von Frankly
"J.O. Aho" wrote in message
news:4frmeiF1k59dtU1@individual.net...
> Frankly wrote:
>> I guess its time to go back to the PHPmyAdmin tutorial. I do see it says
>> something about Multi table query generation to create automatic joins
>> lol. ok ok so i dont know what it means yet but i will.
>> i am going to start this tutorial over from the begining. I'll Be
>> Back!!!
>
> SELECT is a Sql command to fetch something from a table, WHERE is used to
> tell the fetch what you want to fetch, usually with some kind of
> "if-statement", as 'WHERE columnA=1' tells us that we want everything that
> in the columnA has the value 1. When you want data from two or more tables
> at the same time, you use JOIN (multi table query), in the JOIN statement
> you tell which columns in the tables are the same value, so that the
> database can put together a temporary table with all the data you need.
I hope today to get up to where SQL commands are placed in the sql field of
PHPmyAdmin.
my goal is to use this to in a way bypass the Admin tool and work directly
with mysql.
I feel starting from the begining using mostly mysql will help me down the
road when I need to create these types of queries to import data to my web
site. I feel much better today and understand enough how much info is
really in your posts.
for example your Left Join Query can be changed a bit to work with other
joins I will need to make.
not to mention your other posts. when i first read them i felt like it
might as well be chinese.
with those posts, your explanations and the other readings I am doing I feel
pretty good.
>
> As it's 3 in the morning over here, I'm not in the mood to run the
> mysql-administrator as this requires me to open the server running on
> another computer for external connections, so I can't at this moment say
> where you can use the SQL queries.
i think you might find that tool interesting. I also down loaded the MySQL
workbench.
there is also something else for queries. I am going to try and by pass
these admin tools to get
a better understanding of MySQL but do plan on learning them later on. that
is just my newbie way of thinking. perhaps they are only meant as eye candy
to attract MS users like myself.
however i do hope you download it cause i would love to know your opinion
about it.
>
> When it comes to the online manual, the links I have given you, all those
> are the same as for other versions (3.x and 4.x), myself I use Mysql 5 on
> my server, so I do make searches against the 5.0 online manual. On the top
> left side of the page you have "Find this page for version", just click on
> the version number that matches best the version you are using and you get
> the page that always will be right for you.
as i am replying to this my other monitor is at
http://dev.mysql.com/doc/refman/4.1/en/join.html
and it might just be that I am in a more relaxed state of mind but the
As of MySQL 3.23.12,
From MySQL 4.0.9
doesnt seem to confuse me as much. if i just ignore the "As of" and the
"From" it is right on target.
i just have to also ignore when they mention things As of 'a version newer
than mine'
like you said... sometimes you just got to walk away for a bit to have it
come together.
>
> Yes, the example.net e-mail address is a fake one, as no one owns that
> domain and is always used for examples, no one will get the spams that
> spammers sends. I mail you an e-mail, so you will get mine, don't worry.
Tell you the truth even spammers dont like me :). I hardly ever check my
personal emails and when i do maybe i get about 8 spams.
>
> Don't worry about things to much, there will always be moments that will
> feel difficult, but you will get passed those and you may even wonder
> afterwards why you did think things so difficult.
>
>
> //Aho
i feel much better already. when you explained to me that 'join statement'
it was like having a world of information and not knowing what to do with
it. Ok i still dont know if i have to be at a certain table when i enter
the mysql query field or if there are other steps, but after i see it done
in my tutorial it will be much clearer. to tell you the truth i think im
just going to go through this tread from the begining and read again what
you and strawberry had to say. in the tutorial i am about where I was when
i became side tracked by looking into MS and Macromedia.
Frank
Re: Learning php Sql
am 22.06.2006 09:47:03 von unknown
Post removed (X-No-Archive: yes)
Re: Learning php Sql
am 22.06.2006 15:53:16 von Shion
427SOHC wrote:
> Any recommendations for a good SQL reference book? Trying to find something a
> little generic that isn't necessarily for MySQL.
Sams Teach Yourself SQL in 21 Days
ISBN 0-672-31674-9
Sams Publishing
//Aho
Re: Learning php Sql
am 24.06.2006 03:03:47 von unknown
Post removed (X-No-Archive: yes)
Re: Learning php Sql
am 24.06.2006 19:56:47 von Frankly
"J.O. Aho" wrote in message
news:4fp1npF1je48bU1@individual.net...
> I'm really not sure, I do like the idea of the binary way, but having
> different columns is the easy way around, of course you need to add more
> columns if you increase the number of places where to post. With the
> columns it's easier to search for sites that has been posted at one
> specific site
>
> SELECT * FROM table WHERE site1column=1;
>
> while withe the binary system you would need to make
>
> SELECT * FROM table where stiescolumn IN(1,3,5,7,9,11,13,15);
Another choice is Set. Set is like Enum with the difference it allows you
to have more than 1 choice.
At this point I am thinking 1 feild per site would be better for us. it
really all comes down to what is easiest for my wife. Back to my learning..
TTYS
Frank
Re: Learning php Sql
am 11.07.2006 19:19:22 von Frankly
"J.O. Aho" wrote in message
news:4frmeiF1k59dtU1@individual.net...
Hello J.O.
you might want to check your email. i sent you one last night but it was
returned.
Frank
Re: Learning php Sql
am 11.07.2006 21:00:01 von Shion
Frankly wrote:
> "J.O. Aho" wrote in message
> news:4frmeiF1k59dtU1@individual.net...
>
> Hello J.O.
>
> you might want to check your email. i sent you one last night but it was
> returned.
Got your mail today, will read it tomorrow after work as it's time for me to
hit the bed.
//Aho
Re: Learning php Sql
am 17.07.2006 23:30:01 von Frankly
"J.O. Aho" wrote in message
news:4fqslqF1k82bvU1@individual.net...
> Frankly wrote:
>>>> CREATE DATABASE `myweb325573_grace`;
>>> This creates the database itself, you don't need this at this moment, as
>>> it's already created.
>>>
>>>
>>>> DROP TABLE IF EXISTS
>>>> `myweb325573_grace`.`RelationManagementsBuildings`;
>>> This removes the table RelationManagementsBuildings, if it already
>>> exists in the database.
>>>
>>
>> those are just statements that were included when i copied the SQL.
>>
>>>> CREATE TABLE `RelationManagementsBuildings` (
>>>>
>>>> `ManID` int(10) unsigned NOT NULL default '0',
>>>>
>>>> `BuildingID` int(10) unsigned NOT NULL default '0',
>>>>
>>>> PRIMARY KEY (`ManID`,`BuildingID`),
>>> This seems okey.
>>>
>>>> CONSTRAINT `FK_RelationManagementsBuildings_1` FOREIGN KEY (`ManID`)
>>>> REFERENCES `Managements` (`ManID`) ON DELETE CASCADE ON UPDATE CASCADE
>>> Haven't used Constraints and cascades, I guess I should read on them,
>>> but the part here you could drop without it affecting the main
>>> functionality of the table, if you remove this, don't forget to remove
>>> the comma after the definition of the primary keys.
>>
>> but isnt this the part the creates the actual join? this is where I am
>> having trouble. i did that one fine
>> but when i try to make the join using the 2nd part of the primary key
>> which is Buildings and make the join with the buildings table is when i
>> get the mysql error 1005 (errno:150) if i dont need this join than my
>> tables are complete. lol at least i think they are.
>
> http://dev.mysql.com/doc/refman/5.0/en/join.html
>
> SELECT * FROM RelationManagementsBuildings LEFT JOIN (ManagementsTable,
> BuildingTable) ON
> (ManagementTable.ManID=RelationManagementsBuildings.ManID AND
> BuildingTable.BuildingID=RelationManagementsBuildings.Buildi ngID)
>
> I think the join looks like this, now you would get all the data from both
> ManagementsTable and BuildingTable as if they where all stored in the same
> table.
>
>
> //Aho
the query worked fine after i removed the word table a few times and added
an S or 2 :).
SELECT *
FROM RelationManagementsBuildings
LEFT JOIN (
Managements, Buildings
) ON ( Managements.ManID = RelationManagementsBuildings.ManID
AND Buildings.BuildingID = RelationManagementsBuildings.BuildingID )
LIMIT 0 , 30
thank you.
Frank
Re: Learning php Sql
am 18.07.2006 00:07:41 von Frankly
"J.O. Aho" wrote in message
news:4fo8qhF1jvtpeU1@individual.net...
> 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).
this new table will require an inner join to the Apartments table. ?
lets call it NewTable.
Select Apartments.ApartmentID, NewTable.ApartmentID,
from Apartments, NewTable
where Apartments.ApartmentID = NewTable.ApartmentID;
it seems to have worked.
i know its not much but i am pretty damn happy.
my first join.. i will remember it always :).
Frank
>
>
>> 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
Re: Learning php Sql
am 18.07.2006 16:59:41 von Shion
Frankly wrote:
> "J.O. Aho" wrote in message
> news:4fo8qhF1jvtpeU1@individual.net...
>> 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).
>
> this new table will require an inner join to the Apartments table. ?
> lets call it NewTable.
>
>
> Select Apartments.ApartmentID, NewTable.ApartmentID,
> from Apartments, NewTable
> where Apartments.ApartmentID = NewTable.ApartmentID;
The "Select Apartments.ApartmentID, NewTable.ApartmentID" is a bit bad, as you
are joining the tables, you will get the same result in those two columns, so
a "Select Apartments.ApartmentID" or "Select NewTable.ApartmentID" would be
better. Of course as testing and learning to understand how things works it's
okey to get both ApartmentID's.
SELECT Apartments.ApartmentID FROM Apartments, NewTable WHERE
Apartments.ApartmentID = NewTable.ApartmentID;
This requires that you have the same ID's in both tables
Apartments.ApartmentID
1
2
3
4
5
NewTable.ApartmentID
1
2
3
4
5
Then in your joint table you will get
ApartmentID
1 - 1
2 - 2
3 - 3
4 - 4
5 - 5
If you do not have the same ID's in the tables
Apartments.ApartmentID
11
21
31
41
51
NewTable.ApartmentID
12
22
32
42
52
Then in the joint table you will get
ApartmentID
If you want to join anyway and get results, then you will need to use outer joins.
SELECT Apartments.ApartmentID FROM Apartments LEFT JOIN NewTable ON
(Apartments.ApartmentID = NewTable.ApartmentID);
This way all ID's in the Apartments will appear and those ID's that are the
same in the NewTable as in Apartments.
Apartments.ApartmentID
11
21
31
41
51
NewTable.ApartmentID
11
12
13
14
15
ApartmentID
11 - 11
21 - NULL
31 - NULL
41 - NULL
51 - NULL
For more detailed info, you can take a look at
http://dev.mysql.com/doc/refman/5.0/en/join.html
At least I hope I did remember this right :)
> it seems to have worked.
Thats good :)
> i know its not much but i am pretty damn happy.
> my first join.. i will remember it always :).
When taking the first step, then the next one will be easier, I think it was
like that when I learned to walk :P Congrats.
//Aho
Re: Learning php Sql
am 18.07.2006 20:56:50 von Frankly
"J.O. Aho" wrote in message
news:4i4bauF22d6jU1@individual.net...
>Of course as testing and learning to understand how things works it's okey
>to get both ApartmentID's.
i guess this is what I will do. I will do some finall touch ups and FINALLY
put some data in.
there is so much more I could comment on about your post. at this point i
think you are right.
I should test to understand how things work.
there are still more joins i will need to make.
as time went by we changed tables around a bit.
i will give a some detail about the tables I have.
each table contains more fields, i only listed those that will be needed for
joins.
Managements Table
State
ZipCode
WebSite
Buildings Table
Area
ZipCode
RelationBuildingsManagements Table
Apartments Table
ImageTable
AddsPosted Table
AreaZipCode table
drum roll press send
Frank
Re: Learning php Sql
am 18.07.2006 23:15:23 von Frankly
after putting 2 records into all my tables i went exploring to see how i can
delete the join that i made.
when at the operations tab in PHPmyAdmin i came accross
Xerro
The additional features for working with linked tables have been
deactivated. to find out why click here.
PMA Database... not OK [Documentation]
General relation features Disabled.
[Documentaion] = link to this page.
i replaced some info with [edit] didnt know if it told anything i wouldnt
want posted in the open.
$cfg['Servers'][$i]['pmadb'] string
The name of the database containing the linked-tables infrastructure.
See the Linked-tables infrastructure section in this document to see the
benefits of this infrastructure, and for a quick way of creating this
database and the needed tables.
If you are the only user of this phpMyAdmin installation, you can use your
current database to store those special tables; in this case, just put your
current database name in $cfg['Servers'][edit]['edit']. For a multi-user
installation, set this parameter to the name of your central database
containing the linked-tables infrastructure.
Re: Learning php Sql
am 19.07.2006 01:06:49 von Frankly
I think i did good by stepping out of PHPmyAdmin for a bit and working with
sql.
however i think it would be good if i stepped back into the admin for the
joins.
i called up Rackspace and as soon as the guy started to talk i knew it was
going to be a wasted call.
he told me the the PHPmyadmin people were all in a meeting (lol) i think it
was just close to closing time. and that he never heard of PMA Database...
not OK. i did some research on it and I did my best to understand what is
needed to be done. at this point i will give Rackspace another call
tomorrow.
I will continue to look into making joins using phpmyadmin.
right now i have 2 hosting plans ipower web and rackspace. i think ipower
blows rackspace away.
i cant find any help files what so ever. perhaps it is better suited for
someone that knows much more than i do.
anywayzzzz. back to work.
Frank
"Frankly" wrote in message
news:Lbcvg.467$ve.360@trndny06...
>
> after putting 2 records into all my tables i went exploring to see how i
> can delete the join that i made.
> when at the operations tab in PHPmyAdmin i came accross
>
> Xerro
> The additional features for working with linked tables have been
> deactivated. to find out why click here.
>
> PMA Database... not OK [Documentation]
> General relation features Disabled.
>
> [Documentaion] = link to this page.
>
> i replaced some info with [edit] didnt know if it told anything i wouldnt
> want posted in the open.
>
>
> $cfg['Servers'][$i]['pmadb'] string
> The name of the database containing the linked-tables infrastructure.
>
> See the Linked-tables infrastructure section in this document to see the
> benefits of this infrastructure, and for a quick way of creating this
> database and the needed tables.
>
> If you are the only user of this phpMyAdmin installation, you can use your
> current database to store those special tables; in this case, just put
> your current database name in $cfg['Servers'][edit]['edit']. For a
> multi-user installation, set this parameter to the name of your central
> database containing the linked-tables infrastructure.
>
>
>
>
Re: Learning php Sql
am 19.07.2006 05:46:39 von Shion
Frankly wrote:
> after putting 2 records into all my tables i went exploring to see how i can
> delete the join that i made.
> when at the operations tab in PHPmyAdmin i came accross
I'm sorry, I have no experience of using phpmyadmin, so I won't be able to
give you a good help here. I guess you would need to edit the configuration
file for phpmyadmin.
//Aho
Re: Learning php Sql
am 19.07.2006 05:50:31 von Shion
Frankly wrote:
> I think i did good by stepping out of PHPmyAdmin for a bit and working with
> sql.
> however i think it would be good if i stepped back into the admin for the
> joins.
>
> i called up Rackspace and as soon as the guy started to talk i knew it was
> going to be a wasted call.
> he told me the the PHPmyadmin people were all in a meeting (lol) i think it
> was just close to closing time. and that he never heard of PMA Database...
> not OK. i did some research on it and I did my best to understand what is
> needed to be done. at this point i will give Rackspace another call
> tomorrow.
Google.com gave me this page
http://lists.evolt.org/archive/Week-of-Mon-20021007/124434.h tml
Just in case you don't get the help you need.
Time for me to finish breakfast and then to work...
//Aho
Re: Learning php Sql
am 19.07.2006 08:19:06 von Frankly
"J.O. Aho" wrote in message
news:4i5og7F29pkjU2@individual.net...
> Frankly wrote:
>> I think i did good by stepping out of PHPmyAdmin for a bit and working
>> with sql.
>> however i think it would be good if i stepped back into the admin for the
>> joins.
>>
>> i called up Rackspace and as soon as the guy started to talk i knew it
>> was going to be a wasted call.
>> he told me the the PHPmyadmin people were all in a meeting (lol) i think
>> it was just close to closing time. and that he never heard of PMA
>> Database... not OK. i did some research on it and I did my best to
>> understand what is needed to be done. at this point i will give
>> Rackspace another call tomorrow.
>
> Google.com gave me this page
> http://lists.evolt.org/archive/Week-of-Mon-20021007/124434.h tml
>
> Just in case you don't get the help you need.
>
>
> Time for me to finish breakfast and then to work...
>
>
> //Aho
Thank you JO and yes i read that earlier today.
with my limited understanding i guess it is telling me that my 1 database
will indeed be 2 databases.
> I'm sorry, I have no experience of using phpmyadmin, so I won't be able to
> give you a good help here. I guess you would need to edit the
> configuration file for phpmyadmin.
>
>
> //Aho
i hope editing the configuration file is not required because i dont think i
have the rights to the file.
i will call rackspace again in the morning.
PHPmyAdmin has a Multi Table Query Generator that i think will help me do
the joins while bothering you less. i am no longer intersted in a GUI i
think this is a tool i should learn to use. honestly i am afraid of losing
your respect and your help. look around there is a reason you are the only
one helping me or even talking to me. i dont want that to happen to you.
i need more joins and while i can try to do it myself, i lost faith that the
joins i write will come out right. perhaps if i use the MTQG i have a
better chance. this is the hardest thing i have ever tried to learn. its
2:15 am and i am very tired. sorry for my babble.
sure i can try to do those joins now but i dont think they will be right. i
found all i though to be true is wrong.
i thought left joins were used for many to many and inner joins were for 1
to many and it seems even that was wrong.
Frank
Re: Learning php Sql
am 19.07.2006 16:28:54 von Shion
Frankly wrote:
> honestly i am afraid of losing
> your respect and your help. look around there is a reason you are the only
> one helping me or even talking to me.
Think this thread got so long that people don't want to start from the top and
read and see what happens and this time of year people ten to leave town and
spend time on a hot beach and get BBQ:ed.
> i thought left joins were used for many to many and inner joins were for 1
> to many and it seems even that was wrong.
Using the different types of joins are there so you can get the result you
want, as you may noticed from my reply, depending on how to join the results
was different.
It can be good to decide what kind of output you want and then test the
different joins and see which one delivers what you want, I think this will
give you a good lesson how to use joins.
I'm not sayin you shouldn't use phpmyadmin, but you will need to know how to
do things in pure SQL when you are starting with your php code.
//Aho
Re: Learning php Sql
am 19.07.2006 17:27:22 von Frankly
"J.O. Aho" wrote in message
news:4i6tt6F2eud1U1@individual.net...
> Frankly wrote:
>
>> honestly i am afraid of losing your respect and your help. look around
>> there is a reason you are the only one helping me or even talking to me.
>
> Think this thread got so long that people don't want to start from the top
> and read and see what happens and this time of year people ten to leave
> town and spend time on a hot beach and get BBQ:ed.
i was thinking they are thinking.
"this guy got come nerver, he
>
>
>> i thought left joins were used for many to many and inner joins were for
>> 1 to many and it seems even that was wrong.
>
> Using the different types of joins are there so you can get the result you
> want, as you may noticed from my reply, depending on how to join the
> results was different.
i guess the reason that i didnt see an results from the joins was because
that error message i recieved.
i will call Rackspace again if nothing happens i will just try ipower web
and perhaps drop Rackspace and take my loss.
>
> It can be good to decide what kind of output you want and then test the
> different joins and see which one delivers what you want, I think this
> will give you a good lesson how to use joins.
at least now i have a few records in the tables.
>
> I'm not sayin you shouldn't use phpmyadmin, but you will need to know how
> to do things in pure SQL when you are starting with your php code.
>
>
> //Aho
very true. i am wondering how much help phpmyadmin is going to be with the
php.
well i have a few things i need to do today and then its back to the books.
i will also look at your other post a few more times. this stuff is hard
:).
Frank
Re: Learning php Sql
am 19.07.2006 18:08:16 von Shion
Frankly wrote:
> very true. i am wondering how much help phpmyadmin is going to be with the
> php.
phpmyadmin are usually used only to maintain the data in the database.
Even if it's written in php, it won't give you any advantage when you write
your own php code.
> well i have a few things i need to do today and then its back to the books.
> i will also look at your other post a few more times. this stuff is hard
> :).
Don't worry to much about things, start with something simple and do the
examples you have in your books, that way you learn.
//Aho
Re: Learning php Sql
am 19.07.2006 20:50:45 von Frankly
"J.O. Aho" wrote in message
news:4i73ngF2a6doU1@individual.net...
> Frankly wrote:
>
>> very true. i am wondering how much help phpmyadmin is going to be with
>> the php.
>
> phpmyadmin are usually used only to maintain the data in the database.
> Even if it's written in php, it won't give you any advantage when you
> write your own php code.
>
>
>> well i have a few things i need to do today and then its back to the
>> books. i will also look at your other post a few more times. this stuff
>> is hard :).
>
> Don't worry to much about things, start with something simple and do the
> examples you have in your books, that way you learn.
>
>
> //Aho
i just recieve the email from rackspace.
You are able to join tables on our system but phpmyadmin program does not
allow this. If you want to join tables you can use a another software
program or a script to connect remotely to the server to do the this. A
alternative program is Mysql Administrator at the following link:
http://www.mysql.com/products/tools/
This are free MySql tools that you can download. I apologize for any
inconvenience.
Thank You
Webhosting Support
no body reading this works with PHPmyAdmin?
ttyl
Frank
Re: Learning php Sql
am 19.07.2006 21:28:57 von Shion
Frankly wrote:
> "J.O. Aho" wrote in message
> news:4i73ngF2a6doU1@individual.net...
>> Frankly wrote:
>>
>>> very true. i am wondering how much help phpmyadmin is going to be with
>>> the php.
>> phpmyadmin are usually used only to maintain the data in the database.
>> Even if it's written in php, it won't give you any advantage when you
>> write your own php code.
>>
>>
>>> well i have a few things i need to do today and then its back to the
>>> books. i will also look at your other post a few more times. this stuff
>>> is hard :).
>> Don't worry to much about things, start with something simple and do the
>> examples you have in your books, that way you learn.
>>
>>
>> //Aho
>
> i just recieve the email from rackspace.
> You are able to join tables on our system but phpmyadmin program does not
> allow this. If you want to join tables you can use a another software
> program or a script to connect remotely to the server to do the this. A
> alternative program is Mysql Administrator at the following link:
>
> http://www.mysql.com/products/tools/
>
> This are free MySql tools that you can download. I apologize for any
> inconvenience.
>
>
>
> Thank You
>
> Webhosting Support
>
> no body reading this works with PHPmyAdmin?
The phpmyadmin they have configured, don't support the needed "PMA Database",
which seems to be required to use joins in a proper way in phpmyadmin.
You can use another tools or your own scripts to use joins and it will work
properly.
//Aho
Re: Learning php Sql
am 19.07.2006 21:41:19 von Frankly
"J.O. Aho" wrote in message
news:4i7ffqF2i3j6U1@individual.net...
> Frankly wrote:
>> "J.O. Aho" wrote in message
>> news:4i73ngF2a6doU1@individual.net...
>>> Frankly wrote:
>>>
>>>> very true. i am wondering how much help phpmyadmin is going to be with
>>>> the php.
>>> phpmyadmin are usually used only to maintain the data in the database.
>>> Even if it's written in php, it won't give you any advantage when you
>>> write your own php code.
>>>
>>>
>>>> well i have a few things i need to do today and then its back to the
>>>> books. i will also look at your other post a few more times. this
>>>> stuff is hard :).
>>> Don't worry to much about things, start with something simple and do the
>>> examples you have in your books, that way you learn.
>>>
>>>
>>> //Aho
>>
>> i just recieve the email from rackspace.
>> You are able to join tables on our system but phpmyadmin program does not
>> allow this. If you want to join tables you can use a another software
>> program or a script to connect remotely to the server to do the this. A
>> alternative program is Mysql Administrator at the following link:
>>
>> http://www.mysql.com/products/tools/
>>
>> This are free MySql tools that you can download. I apologize for any
>> inconvenience.
>>
>>
>>
>> Thank You
>>
>> Webhosting Support
>>
>> no body reading this works with PHPmyAdmin?
>
> The phpmyadmin they have configured, don't support the needed "PMA
> Database", which seems to be required to use joins in a proper way in
> phpmyadmin.
>
> You can use another tools or your own scripts to use joins and it will
> work properly.
> //A
yes i know i iwas just looking around mysql administrator again. lol i felt
lost when trying to create joins. i was suprised to see a spot for for
i am looking around for a tutorial for it. as you know i am able to help my
wife more these days
and am about to go out and show someone one of our stores.
i wish there was a way i can test those joins you gave me. or atleast see
where they are stored or what ever. can i test them by creating a web site
and trying to pull information?
i have 2 records in all the tables except the image table. its good that i
am going to show the store and give my head a rest. i was suprised to see a
foreign key naming feild because i thought foreign keys are not needed in
mysql.
Re: Learning php Sql
am 20.07.2006 01:06:04 von Frankly
"J.O. Aho" wrote in message
news:4i7ffqF2i3j6U1@individual.net...
>>> phpmyadmin are usually used only to maintain the data in the database.
>>> Even if it's written in php, it won't give you any advantage when you
>>> write your own php code.
i am going to be working on my new site for the next couple of days.
i guess I am about to see just what kind of pain in the ass this PHP thing
is going to be.
>>> Don't worry to much about things, start with something simple and do the
>>> examples you have in your books, that way you learn.
>>>
>>>
>>> //Aho
i have a little more experience in working on web sites than i do databases.
i can see you laugh as you say to yourself " i hope so " :)
so i do feel better already. once the web site is up and i am able to put
my stuff on it i can relax and take my time.
i have really good stuff and unable to show it.
another good thing is that the other day i almost took a spill on my bike.
i hit this huge pot hole very hard. both mirrors broke loose of their seal
and flew freely.
i also thought that my front rim was broke and only held to the forks on one
side.
found out today that she is still rideable and wont be down for a while :).
any info on PHP you think i should know in preparing my site for the future
i would be happy to hear it.
talk to you soon my friend.
Franky :)
Re: Learning php Sql
am 20.07.2006 01:45:29 von Shion
Frankly wrote:
> "J.O. Aho" wrote in message
> news:4i7ffqF2i3j6U1@individual.net...
>
>>>> phpmyadmin are usually used only to maintain the data in the database.
>>>> Even if it's written in php, it won't give you any advantage when you
>>>> write your own php code.
>
>
> i am going to be working on my new site for the next couple of days.
> i guess I am about to see just what kind of pain in the ass this PHP thing
> is going to be.
It's good to switch and try other things too, I do that myself too from time
to time.
> so i do feel better already. once the web site is up and i am able to put
> my stuff on it i can relax and take my time.
> i have really good stuff and unable to show it.
> any info on PHP you think i should know in preparing my site for the future
> i would be happy to hear it.
> talk to you soon my friend.
I'll make a simple example on how to use a join in your own php script, but
you have to wait to tomorrow, as I should be sleeping right now.
> another good thing is that the other day i almost took a spill on my bike.
> i hit this huge pot hole very hard. both mirrors broke loose of their seal
> and flew freely.
> i also thought that my front rim was broke and only held to the forks on one
> side.
> found out today that she is still rideable and wont be down for a while :).
You should be a bit more careful when out biking, take a drive with the car,
it's not as bad if you would hit a pot hole :P
Good to hear that the bake wasn't as damaged as you first thought.
//Aho
Re: Learning php Sql
am 20.07.2006 02:07:15 von Frankly
"J.O. Aho" wrote in message
news:4i7uh0F2i36dU1@individual.net...
> I'll make a simple example on how to use a join in your own php script,
> but you have to wait to tomorrow, as I should be sleeping right now.
it will be a long night :)
>
> You should be a bit more careful when out biking, take a drive with the
> car, it's not as bad if you would hit a pot hole :P
my car died of neglect about 6 months after i bought the bike.
all in all i have a pretty good record. I there are a lot of pot holes
around here
and a lot of cars and taxi's that will try to kill you.
>
> Good to hear that the bake wasn't as damaged as you first thought.
>
> //Aho
I know :).
Re: Learning php Sql
am 20.07.2006 18:42:19 von Shion
Frankly wrote:
> "J.O. Aho" wrote in message
> news:4i7uh0F2i36dU1@individual.net...
>
>> I'll make a simple example on how to use a join in your own php script,
>> but you have to wait to tomorrow, as I should be sleeping right now.
>
> it will be a long night :)
Nights never long, always shorter than what you want them to be :)
Here is the script, it's quite long, I mail you the script too, so you don't
have to get problems with line breaks in the wrong place.
//Aho
--- test.php ---
Join Test
Join test
// We connect to the database
$link = mysql_connect($db_server, $db_login, $db_pass);
if (!$link) {
// The connection failed
die('Could not connect: ' . mysql_error());
}
// we select which database to use
if(!mysql_select_db($db_name, $link)) {
// we couldn't select the wanted database
die ("Can't use $db_name : " . mysql_error());
}
switch($_REQUEST['join']) {
case 0:
$query="SELECT * FROM $db_table1, $db_table2 WHERE $db_table1.$db_column1 =
$db_table2.$db_column2";
echo "Join was selected
\n$query
\n";
break;
case 1:
$query="SELECT * FROM $db_table1 INNER JOIN ($db_table2) ON
($db_table1.$db_column1 = $db_table2.$db_column2)";
echo "Inner join was selected
\n$query
\n";
break;
case 2:
$query="SELECT * FROM $db_table1 CROSS JOIN ($db_table2) ON
($db_table1.$db_column1 = $db_table2.$db_column2)";
echo "Cross join was selected
\n$query
\n";
break;
case 3:
$query="SELECT * FROM $db_table1 LEFT JOIN ($db_table2) ON
($db_table1.$db_column1 = $db_table2.$db_column2)";
echo "Left join was selected
\n$query
\n";
break;
case 4:
$query="SELECT * FROM $db_table1 RIGHT JOIN ($db_table2) ON
($db_table1.$db_column1 = $db_table2.$db_column2)";
echo "Right join was selected
\n$query
\n";
break;
case 5:
$query="SELECT * FROM $db_table1 LEFT OUTER JOIN ($db_table2) ON
($db_table1.$db_column1 = $db_table2.$db_column2)";
echo "Left outer join was selected
\n$query
\n";
break;
case 6:
$query="SELECT * FROM $db_table1 RIGHT OUTER JOIN ($db_table2) ON
($db_table1.$db_column1 = $db_table2.$db_column2)";
echo "Right outer join was selected
\n$query
\n";
break;
case 7:
$query="SELECT * FROM $db_table2, $db_table1 WHERE $db_table2.$db_column2 =
$db_table1.$db_column1";
echo "Join was selected
\n$query
\n";
break;
case 8:
$query="SELECT * FROM $db_table2 INNER JOIN ($db_table1) ON
($db_table2.$db_column2 = $db_table1.$db_column1)";
echo "Inner join was selected
\n$query
\n";
break;
case 9:
$query="SELECT * FROM $db_table2 CROSS JOIN ($db_table1) ON
($db_table2.$db_column2 = $db_table1.$db_column1)";
echo "Cross join was selected
\n$query
\n";
break;
case 10:
$query="SELECT * FROM $db_table2 LEFT JOIN ($db_table1) ON
($db_table2.$db_column2 = $db_table1.$db_column1)";
echo "Left join was selected
\n$query
\n";
break;
case 11:
$query="SELECT * FROM $db_table2 RIGHT JOIN ($db_table1) ON
($db_table2.$db_column2 = $db_table1.$db_column1)";
echo "Right join was selected
\n$query
\n";
break;
case 12:
$query="SELECT * FROM $db_table2 LEFT OUTER JOIN ($db_table1) ON
($db_table2.$db_column2 = $db_table1.$db_column1)";
echo "Left outer join was selected
\n$query
\n";
break;
case 13:
$query="SELECT * FROM $db_table2 RIGHT OUTER JOIN ($db_table1) ON
($db_table2.$db_column2 = $db_table1.$db_column1)";
echo "Right outer join was selected
\n$query
\n";
break;
default:
echo "hello\n";
break;
}
// we make the query to the database
$result=mysql_query($query);
if(!$result) {
echo "The query failed
\n";
exit;
}
// we type out the result
$color=0;
echo "
\n";
$numfields = mysql_num_fields($result);
echo "\n";
for ($i=0; $i < $numfields; $i++) {
echo ''.mysql_field_name($result, $i)." | \n";
}
echo "
\n";
while($row=mysql_fetch_array($result)) {
if($color%2) {
$col="#dddddd";
} else {
$col="#bbbbbb";
}
echo "\n";
for($i=0;$i
echo "".$row[$i]." | \n";
}
echo "
\n";
$color++;
}
echo "
\n";
// we close the connection to the database
mysql_close($link);
?>
--- end of file ---
Re: Learning php Sql
am 20.07.2006 19:20:16 von Frankly
"J.O. Aho" wrote in message
news:4i9q3cF2rliuU1@individual.net...
> Frankly wrote:
>> "J.O. Aho" wrote in message
>> news:4i7uh0F2i36dU1@individual.net...
>>
>>> I'll make a simple example on how to use a join in your own php script,
>>> but you have to wait to tomorrow, as I should be sleeping right now.
>>
>> it will be a long night :)
>
> Nights never long, always shorter than what you want them to be :)
>
> Here is the script, it's quite long, I mail you the script too, so you
> don't have to get problems with line breaks in the wrong place.
>
>
> //Aho
>
>
> --- test.php ---
OMG!!! this is what i think it is - isnt it.
i truely am at a loss for words. i sit here looking at what you wrote
i am a bit in shock. ok im really in shock.
I am going to do my best to understand what you wrote. i still have a days
worth of work i have to do before i can get to this. i will try my best to
start tonight.
time to wipe my eyes and get back to work.
Dude - you are amazing.
lol i want to ask questions but thank yous are all my fingers keep typing.
this is going to display the apartments i put into my database - ON TO MY
WEB SITE!!!!!!!!!
Dude it truely is a pleasure to have met you - not only for what you do -
more so because you are the type of person that does what you do.
Frank
Re: Learning php Sql
am 20.07.2006 19:23:45 von Frankly
"J.O. Aho" wrote in message
news:4i7uh0F2i36dU1@individual.net...
> I'll make a simple example on how to use a join in your own php script,
> but you have to wait to tomorrow, as I should be sleeping right now.
> //Aho
lol i have seen your SIMPLE SCRIPT.
i really have to hurry up and finish what i have to do and get working on
your simple script.
Re: Learning php Sql
am 20.07.2006 19:51:36 von Shion
Frankly wrote:
> "J.O. Aho" wrote in message
> news:4i7uh0F2i36dU1@individual.net...
>
>> I'll make a simple example on how to use a join in your own php script,
>> but you have to wait to tomorrow, as I should be sleeping right now.
>> //Aho
>
> lol i have seen your SIMPLE SCRIPT.
> i really have to hurry up and finish what i have to do and get working on
> your simple script.
It's quite simple, even if it may look as much
1. Connect to sql server, check if it failed or not
2. Select the database to work with, check if it failed or not
3. Select a query depending on what has been selected in the drop down menu
4. Send the query to database and fetch the result
5. Loop trough the results and type them out
6. Disconnect from the sql server
As it don't do much, it's simple. :)
//Aho
Re: Learning php Sql
am 21.07.2006 00:37:58 von Frankly
"J.O. Aho" wrote in message
news:4i9q3cF2rliuU1@individual.net...
>
> --- test.php ---
>
>
> Join Test
>
>
> Join test
>
>
>
> // We connect to the database
> $link = mysql_connect($db_server, $db_login, $db_pass);
> if (!$link) {
> // The connection failed
> die('Could not connect: ' . mysql_error());
> }
>
> // we select which database to use
> if(!mysql_select_db($db_name, $link)) {
> // we couldn't select the wanted database
> die ("Can't use $db_name : " . mysql_error());
> }
>
> switch($_REQUEST['join']) {
>
> case 0:
> $query="SELECT * FROM $db_table1, $db_table2 WHERE $db_table1.$db_column1
> = $db_table2.$db_column2";
> echo "Join was selected
\n$query
\n";
> break;
> case 1:
> $query="SELECT * FROM $db_table1 INNER JOIN ($db_table2) ON
> ($db_table1.$db_column1 = $db_table2.$db_column2)";
> echo "Inner join was selected
\n$query
\n";
> break;
> case 2:
> $query="SELECT * FROM $db_table1 CROSS JOIN ($db_table2) ON
> ($db_table1.$db_column1 = $db_table2.$db_column2)";
> echo "Cross join was selected
\n$query
\n";
> break;
> case 3:
> $query="SELECT * FROM $db_table1 LEFT JOIN ($db_table2) ON
> ($db_table1.$db_column1 = $db_table2.$db_column2)";
> echo "Left join was selected
\n$query
\n";
> break;
> case 4:
> $query="SELECT * FROM $db_table1 RIGHT JOIN ($db_table2) ON
> ($db_table1.$db_column1 = $db_table2.$db_column2)";
> echo "Right join was selected
\n$query
\n";
> break;
> case 5:
> $query="SELECT * FROM $db_table1 LEFT OUTER JOIN ($db_table2) ON
> ($db_table1.$db_column1 = $db_table2.$db_column2)";
> echo "Left outer join was selected
\n$query
\n";
> break;
> case 6:
> $query="SELECT * FROM $db_table1 RIGHT OUTER JOIN ($db_table2) ON
> ($db_table1.$db_column1 = $db_table2.$db_column2)";
> echo "Right outer join was selected
\n$query
\n";
> break;
>
> case 7:
> $query="SELECT * FROM $db_table2, $db_table1 WHERE $db_table2.$db_column2
> = $db_table1.$db_column1";
> echo "Join was selected
\n$query
\n";
> break;
> case 8:
> $query="SELECT * FROM $db_table2 INNER JOIN ($db_table1) ON
> ($db_table2.$db_column2 = $db_table1.$db_column1)";
> echo "Inner join was selected
\n$query
\n";
> break;
> case 9:
> $query="SELECT * FROM $db_table2 CROSS JOIN ($db_table1) ON
> ($db_table2.$db_column2 = $db_table1.$db_column1)";
> echo "Cross join was selected
\n$query
\n";
> break;
> case 10:
> $query="SELECT * FROM $db_table2 LEFT JOIN ($db_table1) ON
> ($db_table2.$db_column2 = $db_table1.$db_column1)";
> echo "Left join was selected
\n$query
\n";
> break;
> case 11:
> $query="SELECT * FROM $db_table2 RIGHT JOIN ($db_table1) ON
> ($db_table2.$db_column2 = $db_table1.$db_column1)";
> echo "Right join was selected
\n$query
\n";
> break;
> case 12:
> $query="SELECT * FROM $db_table2 LEFT OUTER JOIN ($db_table1) ON
> ($db_table2.$db_column2 = $db_table1.$db_column1)";
> echo "Left outer join was selected
\n$query
\n";
> break;
> case 13:
> $query="SELECT * FROM $db_table2 RIGHT OUTER JOIN ($db_table1) ON
> ($db_table2.$db_column2 = $db_table1.$db_column1)";
> echo "Right outer join was selected
\n$query
\n";
> break;
>
>
> default:
> echo "hello\n";
> break;
>
> }
>
> // we make the query to the database
> $result=mysql_query($query);
>
> if(!$result) {
> echo "The query failed
\n";
> exit;
> }
>
> // we type out the result
> $color=0;
> echo "
\n";
> $numfields = mysql_num_fields($result);
>
> echo "\n";
> for ($i=0; $i < $numfields; $i++) {
> echo ''.mysql_field_name($result, $i)." | \n";
> }
>
> echo "
\n";
>
> while($row=mysql_fetch_array($result)) {
> if($color%2) {
> $col="#dddddd";
> } else {
> $col="#bbbbbb";
> }
>
> echo "\n";
> for($i=0;$i
> echo "".$row[$i]." | \n";
> }
>
> echo "
\n";
> $color++;
> }
> echo "
\n";
>
> // we close the connection to the database
> mysql_close($link);
>
>
> ?>
>
>
> --- end of file ---
Re: Learning php Sql
am 22.07.2006 01:17:32 von Frankly
i noticed i posted a blank post with out trimming.. sorry.
i just wanted to say that i am having a very hard time doing what i have to
while knowing
that simple code :) is waiting for me to test and learn from.
by the way when you said you were going to post a simple code i was thinking
it was going to be something like the "Hello World" code.
you can amagine my suprise.
the reason i have not done anything with it yet is i am working on my other
site that has windows :( and as a result i do not think they have PHP on
that plan.
well anyway... i just dont want you to think that post is there and i am not
interested. i am very excited and from time to time i look at it trying to
break it down.
i should be able to catch up on a few things by the end of the day.
after that i will get a home page up on my new site and do my best at seeing
what that simple code does. i told my wife about it and she is as happy as
me but like me she is more happy in knowing there are people out there like
you.
let me get this stuff done and then get into PHP.
Frank