0

So I just started learning MySQL. I am learning from Tizag. They are using PHP files. Now I can see that the PHP files are slightly complex, I'm only 15. And they also recommended PHPMyAdmin. This GUI tool has many complicated options. So I quite don't know what to use. The tutorial till now is using PHP files like

<?php
// Make a MySQL Connection
mysql_connect("localhost", "admin", "1admin") or die(mysql_error());
mysql_select_db("test") or die(mysql_error());

// Create a MySQL table in the selected database
mysql_query("CREATE TABLE example(
id INT NOT NULL AUTO_INCREMENT, 
PRIMARY KEY(id),
 name VARCHAR(30), 
 age INT)")
 or die(mysql_error());  

echo "Table Created!";

?>

So what should I use? I think these PHP files. But then again they are complex and now I am just using XAMPP. When I go for hosting on 000webhost.com(my beloved hosting service), will it be even possible to use these files? Because they have PHPMyAdmin there (I think).

Warm regards,
Cadence

3
Contributors
13
Replies
14
Views
5 Years
Discussion Span
Last Post by jackbauer24-2
-1

If you want to learn MySQL, forget PHP. Look for a MySQL or plain SQL tutorial which does not use PHP and learn the SQL basics using the command line tool mysql.

0

And it is better if it also explains how to setup everything. And will I be able to use the command line tools on a real web server? If yes, how? As I said, now I am just learning on XAMPP.

0

will I be able to use the command line tools on a real web server

That will depend on your webhost. Some allow it, others don't. Check with them.

0

Here, smantscheff says

Look for a MySQL or plain SQL tutorial which does not use PHP and learn the SQL basics using the command line tool mysql.

  1. Is it really good to use command line?
  2. Should I continue with PHPMyAdmin or PHP files? If yes, which one?
  3. If I am supposed to use command line, how do I use it with my webhost? (000webhost.com)

Please answer in a list format.

0

Sorry smantscheff. But now I am using XAMPP. Later, when I head for the real websites on my web host(000webhost.com), what will I do?

0

If you're using xampp, mysql is also installed on your PC and you might as well use the command line. It is an invaluable tool for learning.
Later on, I'd recommend Navicat or, even better, HeidiSQL. These are fine database interfaces, while phpMyAdmin - due to its http-only limitations - is clumsy and awkward.

0

This website (phpforkids.com) gives this piece of code -

mysql -h host -u username -p

So if I am supposed to use this from the command prompt, which directory should I navigate to?

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.