Stuck with databases .
Page 1 of 1
Stuck with databases .
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 .
Re: Stuck with databases .
Hi StenFirst 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
--
Show some love for HTML.net on Twitter, Facebook and Google: Use the buttons on top of all pages.
Show some love for HTML.net on Twitter, Facebook and Google: Use the buttons on top of all pages.
Re: Stuck with databases .
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 .
Re: Stuck with databases .
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
--
Show some love for HTML.net on Twitter, Facebook and Google: Use the buttons on top of all pages.
Show some love for HTML.net on Twitter, Facebook and Google: Use the buttons on top of all pages.
Re: Stuck with databases .
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!
Re: Stuck with databases .
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
--
Show some love for HTML.net on Twitter, Facebook and Google: Use the buttons on top of all pages.
Show some love for HTML.net on Twitter, Facebook and Google: Use the buttons on top of all pages.
Page 1 of 1