PDA

View Full Version : Setting up a database driven website


Karkar
06-11-2007, 01:56 PM
I have a few questiosn regarding this matter.

With wamp, can you have more than one www directory and more than one host if you have more than one website using php and mysql? I use 1 host to host my html sites, but if i wanted them to use a database now, i would need to create a few hosts on mysql lite manager, right? And since they are obviously not localhost, how would ido this? I hope this question makes sense...



In the tutorials, we use a local/network connection. Can FTP be used to set up a db driven website?

Obviosuly I have 10000000000s of more questions but for now i thought i'd stick with the 2 above.

davidj
06-11-2007, 02:17 PM
ok in WAMP you set your www directory which should be your remote directory inside that remote dir you can setup sub directories. I use the sub directories a seperate project folders like...

site1
project2
company3

then i setup dreamweaver to use the sub dir as root so it cant navigate outside of the sub dir (//<< hope this bit makes sense) So when you set a site up in DW you use site1 as the root or project2 as the root. You must remember to setup a local dir as you have a remote. You would access your sub dirs the normal way using localhost but just add a sub dir to the end...

http://localhost/site1/
http://localhost/project2/

or you can keep the WWW directory as default (in C:\WAMP\www\) and use an alias (accessed from the WAMP icon) to point to any dir you want. Any php file put into an alias will process using the php engine and accessed using http://localhost/aliasname/

davidj
06-11-2007, 02:20 PM
Can FTP be used to set up a db driven website?


Yes of course but in the tutorial we use the local/network. You would use an FTP conection to connect to your host space to hook dreamweaver into that but id advise against it. I always use a 3rd party FTP client to upload to the live machine. You would never use a development tool to do that anyway.

Karkar
06-11-2007, 02:22 PM
You would never use a development tool to do that anyway.

How come???

davidj
06-11-2007, 02:34 PM
ok dreamweaver is your toolbox

you have a local and remote dir on your machine which is your testing environment. this is where you build and test your frankenstein monster. Tweaking out all the bugs and trying really hard to break it. Finally your happy. Its time for you to flip the switch and make it live for the world. You should close dreamweaver down and FTP using cute or smart FTP because its easy to start using the live machine as a testing/development machine when you have a tweak here and a tweak there. Bad practice. Also this means your going to have to have your testing/development site set up in dreamweaver so your also going to have to setup a live site where the remote looks at your host space. This allows for sync issues where 2 areas are configured for 1 site. I have been there also looking for a quick solution but failed big time. Keep your test site and your live site seperate even if it means using 2 different apps. This is just how i work and feel comfortable. Some one may come along and flame me with a flame machine gun.

Karkar
06-11-2007, 02:36 PM
lol. I see what you mean. Are these Cute/Smart FTP like FileZilla?

davidj
06-11-2007, 02:41 PM
yes sort of

they are straight forward

Karkar
06-11-2007, 02:55 PM
Ok great.

Now that i've completed your tutorials... where do you suggest I go from here to further my learnings of php?

davidj
06-11-2007, 03:01 PM
just build stuff

if you have time then build some fun projects.

Try calculations, file handling, xml processing.

once you have this practiced then move onto OOP or object orientated programing. Its the future and will be a requirement in the professional market very soon

Karkar
06-11-2007, 03:32 PM
Ok I will begin working on a project right away!
I will endeavour to incorporate the 3 main things learnt in your tutorials and experiment with those concepts. I am registering a new domain name tomorrow with mysql and everything set up with my host, so I'll be on the forums most likely asking fo ryour asistance if i fail to set the new site up running smoothly with mysql and php.

Just want to say thanks heaps, david. You've been an awesome help and I really appreciate the time you've taken to help me. Sure is a big plus to people like me who would otherwise struggle to pay $1500 for a week's long course.

Regards,
Alex

davidj
06-11-2007, 03:39 PM
no problem

its people like you who i do this for in the first place.

Those who take time to learn and enjoy the language and what it has to offer will benefit from my undivided attention. Just become a good programer and build some great apps.