Login | Register | FAQ
Anonymous

Stuck with databases .

+ Post a reply

6 posts Page 1 of 1


Stuck with databases .

by sten » Sun Jun 19, 2011 5:13 pm

Hi. I have been reading about databases from w3schools and from the php tutorial here and decided to make a database for practice. But the problem is that I don't know where/ how to create one. I mean, I know all the commands ands so on, but where to type them or what? Where to i write the lines : CREATE DATABASE xxxxx , CREATE TABLE xxxxx (xx,xx,xx,xx) ... and how can I see my databases when i have made them ? Sorry, my English is not very good, therefore I find it hard to express myself.
Thank You in advance .
User avatar

sten

  • Posts: 13
  • Joined: Fri Mar 25, 2011 11:14 pm

Re: Stuck with databases .

by HTML.net » Sun Jun 19, 2011 5:28 pm

Hi Sten

First of all, you need a server. Have a look at this lesson: http://www.html.net/tutorials/php/lesson2.php

Then you simply write the commands in your PHP-page (read how to make a PHP-page here: http://www.html.net/tutorials/php/lesson3.php).

Then just follow the instruction in lesson 17 and forward: http://www.html.net/tutorials/php/lesson17.php

- Andreas, HTML.net
User avatar

HTML.net
Site Admin

  • Posts: 1185
  • Joined: Sat Sep 11, 2010 11:24 am
--
Show some love for HTML.net on Twitter, Facebook and Google: Use the buttons on top of all pages.

Re: Stuck with databases .

by sten » Sun Jun 19, 2011 5:47 pm

Thank you for your response, but, I have done all the things you mentioned above. But is there a way that i can actually see my database's tables ? When i create a database into a php script and save the file with .php extension and then open : http://localhost/.php I can't see anything. Sorry I'm a bit slow when it comes to computers. I just started learning about web programming as i thought this might be a great oppurtunity to start my own business as a teenager orsth ..
Thank you for your time .
User avatar

sten

  • Posts: 13
  • Joined: Fri Mar 25, 2011 11:14 pm

Re: Stuck with databases .

by HTML.net » Sun Jun 19, 2011 5:53 pm

It's actually a very good question! Because you really can't see the database as it normally is stored on different server (a MySQL server). But you can access it using phpMyAdmin (read more here: http://html.net/tutorials/php/lesson18.php).

- Andreas, HTML.net
User avatar

HTML.net
Site Admin

  • Posts: 1185
  • Joined: Sat Sep 11, 2010 11:24 am
--
Show some love for HTML.net on Twitter, Facebook and Google: Use the buttons on top of all pages.

Re: Stuck with databases .

by sten » Sun Jun 19, 2011 5:57 pm

Oh , one more question came to my head ..
Is there a way i can make a database without writing it into my php script ?
The w3 schools tutorial about SQL was fairly easy as it had just the SQL commands without having to deal with the php . is is possible to just write the database stuff in an another file orsth and then add it to the php ? i hope you understand what i'm trying to say .
Thanks!
User avatar

sten

  • Posts: 13
  • Joined: Fri Mar 25, 2011 11:14 pm

Re: Stuck with databases .

by HTML.net » Sun Jun 19, 2011 7:52 pm

You use SQL to communicate with the database. You just use the PHP-function mysql_query() to send the queries. It's actually very easy when you get use to it.

You can use phpMyAdmin to create and databases and tables - it is easier - and then use PHP and SQL for updating the data.

- Andreas, HTML.net
User avatar

HTML.net
Site Admin

  • Posts: 1185
  • Joined: Sat Sep 11, 2010 11:24 am
--
Show some love for HTML.net on Twitter, Facebook and Google: Use the buttons on top of all pages.


+ Post a reply

Page 1 of 1

?>