Forum Moderators: open

Message Too Old, No Replies

absoluetly stunned by it all

Trying to get a handle on Databases

         

Lovejoy

1:36 am on Jan 11, 2006 (gmt 0)

10+ Year Member



Hi All,
I've decided to take the plunge and set up databases for my websites. Mysql is already installed ( my sites are on Godaddy) but my poor 51 year old brain is ready to explode over getting it all to work, does anyone know of a really, really, basic A-B-C tutorial for PHPmyadmin or a book like PHPmyadmin for dinosaurs? Most of my site upgrading is done at 2 am (when no one is around to bug me) and the learning curve seems unsurmountable. Any help would be greatly appreciated.

skipfactor

1:48 am on Jan 11, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I recently converted to MySQL from MS. After a decade of using Enterprise Manager, I had a difficult time w/ PHPmyadmin and a deadline.

SQL Manager for MYSQL was the nearest I could find to Enterprise Manager. There are probably free ones out there that are similar, but this was the most user-friendly for me that I tested.

Jackson Hole

1:56 am on Jan 11, 2006 (gmt 0)

10+ Year Member



Hey Lovejoy,

If you learned how to make a website, you can learn the basics of building a dynamic website. In a matter of a month, I went from building static sites to building database-driven ones with PHP and MySQL. How? Four key ingredients:

1) A wonderful book by Kevin Yank called "Build Your Own Database Driven Website Using PHP and MySQL". I can't recommend it enough.

2) Search/ask here for answers.

3) Search google for more answers.

4) A great article on webmonkey called "your first database". It'll really get you familiar with the theory behind database design - definitely good to know before you start creating a data-driven site.

If you're interested, first, in PHPmyAdmin, just play around with it, create some tables, add some content, edit some content, delete some content, and watch the queries that run (PHPmyAdmin will show the query it ran to do what the GUI let you do without knowing SQL) and then try to create some of your own in the SQL window.

Good luck!

txbakers

4:20 am on Jan 11, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I would recommend getting a trial copy of Dreamweaver and letting it do the basics for you. Then, just before the trial runs out, go back and study the code generated and start writing your own version of it to see the amount of junk that can be eliminated.

After a month or two you won't need Dreamweaver any more and you'll be well on your way.

Lilliabeth

11:27 pm on Jan 13, 2006 (gmt 0)

10+ Year Member



Get to know the first three normal forms like the back of your hand.

Lovejoy

3:24 am on Jan 15, 2006 (gmt 0)

10+ Year Member



I picked up a trial copy of PHP Runner which has a bunch of forms, wizards etc. which I will play with to get my feet wet. Most of the books I've picked up such as "PHP Mysql for Dummies" aren't working out for me, my brain hurts after a couple of hours. I tend to be a visual learner, a couple of hours to eliminate the sticking points looking over someone's shoulder and I'm generally off and running.

skipfactor

3:45 am on Jan 15, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Lovejoy, read txbakers post above. Look for books and online courses/tutorials for Dreamweaver/PHP/MySQL. Think DREAMWEAVER

Lovejoy

11:50 pm on Jan 15, 2006 (gmt 0)

10+ Year Member



I have looked online, just about every tutorial I've found is the same one, just listed on another site. None of them has helped me get past the sticking point of writing a query. I have downloaded a trial copy of dreamweaver, but from what I've seen so far the phprunner appears to be more intuitive

Jackson Hole

4:09 am on Jan 18, 2006 (gmt 0)

10+ Year Member



In order to be good at databases (and thus data driven sites) you need to know the ins and outs of tables, queries, normalization, and all that good database stuff. Unless I missed something, Dreamweaver won't get you anywhere near any of that, except maybe as a glorified text editor in "code view" to help write queries.

txbakers

5:12 pm on Jan 18, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



dreamweaver will only help you write the code to connect your site to a database.

learning how to deal with databases is up to you. it's a big field, and important to learn if you're going to want to use databases effectively.

henry0

10:10 pm on Jan 18, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member




I tend to be a visual learner

I will look for a script that offers a small application that you can use later
for example a very simple "Guest book"
(many sites offer those kind of free scripts)
then do on it a "post mortem"
Understand what you see by searching "the reason why" in a good book
Modify
Experiment
and learn from it

Have fun!

jmusselwhite

10:35 pm on Jan 19, 2006 (gmt 0)

10+ Year Member



Lovejoy,

I'm like you--scared off by all the MySQL syntax and the difficulty of picking it up via manuals. However, I have looked at alot of PHP code generators also, including PHPrunner. I settled on dbqwiksite. It's extremely powerful, blows many others away. Takes some work to get familiar with it, but worth it if you want all the flexibility to develop database-driven web pages for MySQL.

Lovejoy

11:35 pm on Jan 19, 2006 (gmt 0)

10+ Year Member



Thanks, I will check that one as well, but my remaining brains cells have finally begun to grasp the concepts ;~).
Here's what I have so far ( see below), the only part I don't know what to do with is " Your_fields", what goes in there?

<?php
//Sample Database Connection Syntax for PHP and MySQL.

//Connect To Database
$hostname="mysql.#*$!xxx.net";
$username="thisishard";
$password="bollux";
$dbname="loadofswill";
$usertable="pigswill";
$yourfield = "your_field";
mysql_connect($hostname,$username, $password) OR DIE (" ");
mysql_select_db($dbname);

# Check If Record Exists

$query = "SELECT * FROM $usertable";

$result = mysql_query($query);

if($result)
{
while($row = mysql_fetch_array($result))
{
$name = $row["$yourfield"];
echo "Name: ".$name."
";
}
}
?>

Demaestro

11:50 pm on Jan 19, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Forget MySql, the free version doesn't scale well and is wrought with problems. It is worth your time to look into postGreSQL, it is an open source Oracle, totally free to use, and it has many utilities to install and setup as well as Tools for building queries, for the beginner.

Also this will scale so much better if you find yourself with hundreds of thousands of records. I have 100 of sites in production in our office using it, it is all we use and have never needed more, even with clients who have massive massive data requirments.

Lovejoy

12:05 am on Jan 20, 2006 (gmt 0)

10+ Year Member



I'm stuck with mysql, it's all my webhost uses and my ISP doesn't allow mw to use my own server on their network

henry0

12:17 pm on Jan 20, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Your field could be: username
you may have a table with
ID
username
password etc...
this PHP script allows to print in your browser all data included in that field
if $field is defined as username (for example)

of course as is you will have unformatted pieces of info
but it is a beginning
although
the querry could be built diferently
but got to go!
good luck
remember to have fun :)

Jackson Hole

12:41 pm on Jan 20, 2006 (gmt 0)

10+ Year Member



Don't worry about what kind of database you are on for now. I started with MySQL, and moved to an Oracle environment. The transition was pretty painless from a learning/knowing perspective, the queries are mostly the same.

The "your_field" refers to a column in your database table. You just need to change it in the one place where it's written with an underscore to match something in your db table. The other places where it's written "yourfield" are referring to the PHP variable, so you don't have to rename those, although usually I keep things consistently named so I don't get confused.

Lovejoy

1:27 pm on Jan 20, 2006 (gmt 0)

10+ Year Member



One more question, will the fact my website is hosted on a linux server make a difference in how the query is set up?

Demaestro

5:00 pm on Jan 20, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



The OS should not effect the syntax of any of the SQL you execute.

Lovejoy

5:21 pm on Jan 20, 2006 (gmt 0)

10+ Year Member



Thank you Demaestro, I'll fire it all up and post back how it goes;~)

Demaestro

5:42 pm on Jan 20, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



No prob, If you ever have any SQL Syntax questions or need some help debugging SQL I would be happy to help you out.

You can post it here or sticky me.