Learning php Sql

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
Frankly [ Fr, 21 April 2006 17:38 ] [ ID #1283375 ]

Re: Learning php Sql

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
Shion [ Fr, 21 April 2006 17:58 ] [ ID #1283376 ]

Re: Learning php Sql

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.
zac.carey [ Fr, 21 April 2006 21:12 ] [ ID #1283381 ]

Re: Learning php Sql

"strawberry" <zac.carey [at] gmail.com> wrote in message
news:1145646751.883922.193210 [at] 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 :).
Frankly [ Fr, 21 April 2006 22:36 ] [ ID #1283382 ]

Re: Learning php Sql

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!
zac.carey [ Sa, 22 April 2006 01:49 ] [ ID #1285365 ]

Re: Learning php Sql

"strawberry" <zac.carey [at] gmail.com> wrote in message
news:1145663366.202380.164450 [at] 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
Frankly [ Sa, 22 April 2006 04:29 ] [ ID #1285366 ]

Re: Learning php Sql

Frankly wrote:
> "strawberry" <zac.carey [at] gmail.com> wrote in message
> news:1145663366.202380.164450 [at] 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
Shion [ Sa, 22 April 2006 07:06 ] [ ID #1285367 ]

Re: Learning php Sql

"J.O. Aho" <user [at] example.net> wrote in message
news:4atrvkFu871aU1 [at] 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
Frankly [ Sa, 22 April 2006 18:22 ] [ ID #1285370 ]

Re: Learning php Sql

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
Shion [ Sa, 22 April 2006 19:23 ] [ ID #1285371 ]

Re: Learning php Sql

"J.O. Aho" <user [at] example.net> wrote in message
news:4av742Fu2a18U1 [at] 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
Frankly [ Sa, 22 April 2006 19:53 ] [ ID #1285372 ]

Re: Learning php Sql

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)
zac.carey [ Sa, 22 April 2006 20:44 ] [ ID #1285373 ]

Re: Learning php Sql

"strawberry" <zac.carey [at] gmail.com> wrote in message
news:1145731440.418447.215070 [at] 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.

<html>

<body>



<?php

$myvar = "Hello World";

echo $myvar;

?>



</body>

</html>

thank you
Frankly [ Sa, 22 April 2006 21:14 ] [ ID #1285374 ]

Re: Learning php Sql

"strawberry" <zac.carey [at] gmail.com> wrote in message
news:1145731440.418447.215070 [at] 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.

<html>

<body>



<?php

$myvar = "Hello World";

echo $myvar;

?>



</body>

</html>

thank you
Frankly [ Sa, 22 April 2006 21:14 ] [ ID #1285375 ]

Re: Learning php Sql

This file is called something like "hello.php" right? In that case it
should work!
zac.carey [ Sa, 22 April 2006 21:20 ] [ ID #1285376 ]

Re: Learning php Sql

"strawberry" <zac.carey [at] gmail.com> wrote in message
news:1145733611.425300.56640 [at] 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.
Frankly [ Sa, 22 April 2006 21:37 ] [ ID #1285377 ]

Re: Learning php Sql

In article <4Cv2g.234$_e.146 [at] trndny08>, "Frankly" <NotReal [at] yahoo.com>
wrote:

> "strawberry" <zac.carey [at] gmail.com> wrote in message
> news:1145733611.425300.56640 [at] 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]
Alan Cole [ Sa, 22 April 2006 22:10 ] [ ID #1285378 ]

Re: Learning php Sql

"Alan Cole" <justal [at] lineone.net> wrote in message
news:justal-24E25C.21102422042006 [at] nntp-readers.plus.net...
> In article <4Cv2g.234$_e.146 [at] trndny08>, "Frankly" <NotReal [at] yahoo.com>
> wrote:
>
>> "strawberry" <zac.carey [at] gmail.com> wrote in message
>> news:1145733611.425300.56640 [at] 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.
Frankly [ Sa, 22 April 2006 23:29 ] [ ID #1285379 ]

Re: Learning php Sql

"Alan Cole" <justal [at] lineone.net> wrote in message
news:justal-24E25C.21102422042006 [at] nntp-readers.plus.net...
> In article <4Cv2g.234$_e.146 [at] trndny08>, "Frankly" <NotReal [at] yahoo.com>
> wrote:
>
>> "strawberry" <zac.carey [at] gmail.com> wrote in message
>> news:1145733611.425300.56640 [at] 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.
Frankly [ Sa, 22 April 2006 23:50 ] [ ID #1285380 ]

Re: Learning php Sql

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
Mick White [ So, 23 April 2006 00:53 ] [ ID #1286132 ]

Re: Learning php Sql

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 ---
<?PHP
echo "<html>\n<head>\n<title>Test1</title>\n</head>\n<body text=\"green\">\n";
$myvar = "Hello World";
echo $myvar;
echo "</body></html>";
?>
--- eof ---


--- test2.php: both html and php ---
<html>
<head>
<title>Test2</title>
</head>
<body text="green">
<?PHP
$myvar = "Hello World";
echo $myvar;
?>
</body>
</html>
--- 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
Shion [ So, 23 April 2006 01:04 ] [ ID #1286133 ]

Re: Learning php Sql

"J.O. Aho" <user [at] example.net> wrote in message
news:4avr38Fv88f3U1 [at] 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 ---
> <?PHP
> echo "<html>\n<head>\n<title>Test1</title>\n</head>\n<body
> text=\"green\">\n";
> $myvar = "Hello World";
> echo $myvar;
> echo "</body></html>";
> ?>
> --- eof ---
>
>
> --- test2.php: both html and php ---
> <html>
> <head>
> <title>Test2</title>
> </head>
> <body text="green">
> <?PHP
> $myvar = "Hello World";
> echo $myvar;
> ?>
> </body>
> </html>
> --- 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
Frankly [ So, 23 April 2006 01:43 ] [ ID #1286134 ]

Re: Learning php Sql

Frankly wrote:
> "J.O. Aho" <user [at] example.net> wrote in message
> news:4avr38Fv88f3U1 [at] 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 ---
>> <?PHP
>> echo "<html>\n<head>\n<title>Test1</title>\n</head>\n<body
>> text=\"green\">\n";
>> $myvar = "Hello World";
>> echo $myvar;
>> echo "</body></html>";
>> ?>
>> --- eof ---
>>
>>
>> --- test2.php: both html and php ---
>> <html>
>> <head>
>> <title>Test2</title>
>> </head>
>> <body text="green">
>> <?PHP
>> $myvar = "Hello World";
>> echo $myvar;
>> ?>
>> </body>
>> </html>
>> --- 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
Shion [ So, 23 April 2006 06:30 ] [ ID #1286135 ]

Re: Learning php Sql

FWIW, when I copied the script that you posted into my system, it
worked fine.
zac.carey [ So, 23 April 2006 15:53 ] [ ID #1286136 ]

Re: Learning php Sql

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
Shion [ So, 23 April 2006 17:08 ] [ ID #1286138 ]

Re: Learning php Sql

Sorry. I should have been clearer:

When I copied Frank's script into my system, it
worked fine.

Apologies for confusing the NG
zac.carey [ So, 23 April 2006 18:25 ] [ ID #1286139 ]

Re: Learning php Sql

"J.O. Aho" <user [at] example.net> wrote in message
news:4avr38Fv88f3U1 [at] 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 ---
> <?PHP
> echo "<html>\n<head>\n<title>Test1</title>\n</head>\n<body
> text=\"green\">\n";
> $myvar = "Hello World";
> echo $myvar;
> echo "</body></html>";
> ?>
> --- eof ---
>
>
> --- test2.php: both html and php ---
> <html>
> <head>
> <title>Test2</title>
> </head>
> <body text="green">
> <?PHP
> $myvar = "Hello World";
> echo $myvar;
> ?>
> </body>
> </html>
> --- 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
Frankly [ So, 23 April 2006 18:56 ] [ ID #1286141 ]

Re: Learning php Sql

"J.O. Aho" <user [at] example.net> wrote in message
news:4av742Fu2a18U1 [at] 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
Frankly [ So, 23 April 2006 19:05 ] [ ID #1286142 ]

Re: Learning php Sql

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
Frankly [ Mi, 26 April 2006 17:38 ] [ ID #1290527 ]

Re: Learning php Sql

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
Shion [ Do, 27 April 2006 05:26 ] [ ID #1292186 ]

Re: Learning php Sql

"J.O. Aho" <user [at] example.net> wrote in message
news:4barumF10siusU2 [at] 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
Frankly [ Sa, 29 April 2006 18:57 ] [ ID #1294782 ]

Re: Learning php Sql

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
Rik [ So, 30 April 2006 02:27 ] [ ID #1295497 ]

Re: Learning php Sql

"Rik" <luiheidsgoeroe [at] hotmail.com> wrote in message
news:e3107q$snp$1 [at] 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.
Frankly [ Di, 02 Mai 2006 18:06 ] [ ID #1297914 ]

Re: Learning php Sql

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
Shion [ Di, 02 Mai 2006 18:17 ] [ ID #1297915 ]

Re: Learning php Sql

Post removed (X-No-Archive: yes)
Notifier Deamon [ Di, 02 Mai 2006 18:43 ] [ ID #1297916 ]

Re: Learning php Sql

"Martie" <martienospammin [at] newsguy.com> wrote in message
news:e3827302shs [at] drn.newsguy.com...
> On Tue, 02 May 2006 16:06:23 GMT, Frankly wrote...
>>
>>
>>"Rik" <luiheidsgoeroe [at] hotmail.com> wrote in message
>>news:e3107q$snp$1 [at] 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.
Frankly [ Di, 02 Mai 2006 20:42 ] [ ID #1297917 ]

Re: Learning php Sql

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
Shion [ Mi, 03 Mai 2006 05:56 ] [ ID #1299563 ]

Re: Learning php Sql

"J.O. Aho" <user [at] example.net> wrote in message
news:4bqnujF12n3psU2 [at] 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
Frankly [ Mi, 03 Mai 2006 18:12 ] [ ID #1299570 ]

Re: Learning php Sql

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.
Frankly [ Do, 04 Mai 2006 18:01 ] [ ID #1301058 ]

Re: Learning php Sql

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.
Frankly [ Do, 04 Mai 2006 18:12 ] [ ID #1301059 ]

Re: Learning php Sql

Frankly wrote:
> "J.O. Aho" <user [at] example.net> wrote in message
> news:4bqnujF12n3psU2 [at] 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
Shion [ Do, 04 Mai 2006 19:50 ] [ ID #1301060 ]
PHP » alt.php.sql » Learning php Sql

Vorheriges Thema: How to do SELECT *-`Column1` from TABLE?
Nächstes Thema: copy function Q