FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


mySQL help needed, any other good database thing?





speeDemon
Hey!!

I wanted to know if any one can offer em help with mySQL....

I am reading wrox publications learning php5 ..

I have reached the part when I have to start to do stuff with php and mySQl together,,, and ohh what pain it gives me!

If you can tell me stuff about the command prompt, and stuff then i'll be gratefull...

I have installed php, apache and mySQL with xampp...

Please help me..

If you do know any other database management thing like mySQL (but easier, and which can be used with php) then pls do name it!

Thanks!
Diablosblizz
MySQL with PHP is probably the easiest thing to learn in coding (besides HTML) if you know the MySQL queries then you're fine. Keep on reading to tutorials and you'll get a hang of them. Books are also a good way to learn.

Good luck.
[FuN]goku
speeDemon wrote:
Hey!!

I wanted to know if any one can offer em help with mySQL....

I am reading wrox publications learning php5 ..

I have reached the part when I have to start to do stuff with php and mySQl together,,, and ohh what pain it gives me!

If you can tell me stuff about the command prompt, and stuff then i'll be gratefull...

I have installed php, apache and mySQL with xampp...

Please help me..

If you do know any other database management thing like mySQL (but easier, and which can be used with php) then pls do name it!

Thanks!

Easier? i think mysql is as easy as it gets Razz

It's not that hard trust me, i used to think the same way. But once you get working with it for a while you get used to it.

When doing queries try to remember this. if you're 'getting' data from a table then you'll want a query like.

Code:

SELECT * FROM `table_name`;


This here is fairly simple, it means select ALL entries from a specified table.

Code:

SELECT * FROM `table_name` WHERE `column` = 'value';


Again this is simple as well if you break it down a bit.

We see we have the same thing as above but a bit more is added.
Basically with this you're grabbing data from a table where you only want every entry with a specified value. This is useful for having user logins (see below for example)

ex.
Code:

SELECT * FROM `members` WHERE `username` = '$usr' AND `password` = '$pass';


So it would mean that you can only have one unique user/pass combo.
Then if the number of rows = 1, then the user would be successfully logged in, else, it would mean it doesnt exist, or has a wrong password etc.

Inserting things into the table is a bit more tricky

Code:

INSERT INTO `table_name` ('column_A', 'column_B') VALUES ('val1', 'val2');


Now basically, this will insert a new entry into a table.

it will insert val1 into column_A and val2 into column_B

But anyways if you really wanna get into it just google for some mysql guides.
Theres plenty out there.

Heres one for you actually

http://www.w3schools.com/PHP/php_mysql_intro.asp

But , i'd say use mysql. There might be other options but mysql is mostly used. And most other sql languages contain similar syntaxes anyways.

To name a few others MSSQL, PostgreSQL, SQLITE, Oracle.

I cant really help you with the console though i don't have alot of experience with it. but just use the help feature and play around with it a bit.

One last thing, if you do mysql, you should have a couple of GUI's to use so you dont have to use phpmyadmin.

I use Navicat MySQL, which is a very very very good tool for mysql, and i would recommend it to anyone who uses MySql.

*Note* Navicat isn't free, in fact it's not cheap but it's good.
http://mysql.navicat.com/store.html

And theres also SQLyog which you can also buy for a bit cheaper than navicat, but i dont like this tool as much. http://www.webyog.com/en/buy.php

Alternatively, there is a FREE edition of sqlyog avaliable here http://www.webyog.com/en/downloads.php which is known as the Community Edition.

Anyways hope this post helps Wink
rvec
if you want a new gui you should also take a look at http://www.sqlbuddy.com/ . It is kinda like phpmyadmin but should be better. I haven't found the time to try it out myself yet, but it should be good.
speeDemon
[FuN]goku wrote:
speeDemon wrote:
Hey!!

I wanted to know if any one can offer em help with mySQL....

I am reading wrox publications learning php5 ..

I have reached the part when I have to start to do stuff with php and mySQl together,,, and ohh what pain it gives me!

If you can tell me stuff about the command prompt, and stuff then i'll be gratefull...

I have installed php, apache and mySQL with xampp...

Please help me..

If you do know any other database management thing like mySQL (but easier, and which can be used with php) then pls do name it!

Thanks!

Easier? i think mysql is as easy as it gets Razz

It's not that hard trust me, i used to think the same way. But once you get working with it for a while you get used to it.

When doing queries try to remember this. if you're 'getting' data from a table then you'll want a query like.

Code:

SELECT * FROM `table_name`;


This here is fairly simple, it means select ALL entries from a specified table.

Code:

SELECT * FROM `table_name` WHERE `column` = 'value';


Again this is simple as well if you break it down a bit.

We see we have the same thing as above but a bit more is added.
Basically with this you're grabbing data from a table where you only want every entry with a specified value. This is useful for having user logins (see below for example)

ex.
Code:

SELECT * FROM `members` WHERE `username` = '$usr' AND `password` = '$pass';


So it would mean that you can only have one unique user/pass combo.
Then if the number of rows = 1, then the user would be successfully logged in, else, it would mean it doesnt exist, or has a wrong password etc.

Inserting things into the table is a bit more tricky

Code:

INSERT INTO `table_name` ('column_A', 'column_B') VALUES ('val1', 'val2');


Now basically, this will insert a new entry into a table.

it will insert val1 into column_A and val2 into column_B

But anyways if you really wanna get into it just google for some mysql guides.
Theres plenty out there.

Heres one for you actually

http://www.w3schools.com/PHP/php_mysql_intro.asp

But , i'd say use mysql. There might be other options but mysql is mostly used. And most other sql languages contain similar syntaxes anyways.

To name a few others MSSQL, PostgreSQL, SQLITE, Oracle.

I cant really help you with the console though i don't have alot of experience with it. but just use the help feature and play around with it a bit.

One last thing, if you do mysql, you should have a couple of GUI's to use so you dont have to use phpmyadmin.

I use Navicat MySQL, which is a very very very good tool for mysql, and i would recommend it to anyone who uses MySql.

*Note* Navicat isn't free, in fact it's not cheap but it's good.
http://mysql.navicat.com/store.html

And theres also SQLyog which you can also buy for a bit cheaper than navicat, but i dont like this tool as much. http://www.webyog.com/en/buy.php

Alternatively, there is a FREE edition of sqlyog avaliable here http://www.webyog.com/en/downloads.php which is known as the Community Edition.

Anyways hope this post helps Wink


ok man! you told me the a-z of mySQL! but what abt the command promtp? It says change directories in the book..... i dont know how to Crying or Very sad

if you could help me with that, then id be gratefull Very Happy

thnks anyways
[FuN]goku
haha sorry i dont have much experience in the commad prompt with mysql
rvec
change directories in mysql?

In normal command line it would be "cd". So to change the directory to /home/yaron you'd use "cd /home/yaron" (also works in windows althought you need de drive before it).
AOP Web Development
if you are using xampp then this would be easy for you

just start your apache,php and mysql server

then type to your browser

http://localhost/phpmyadmin/

then it will show up the phpmyadmin gui show.
Related topics
Navigation Script (javascript) Help Please!
Help Needed Regarding CGI And Php
Need help with database, can anyone help?
Phpnuke/mysql database help needed
Help needed to choose appropriate server.
Help me please...frontpage help needed!
Online Game
help please...
PHP/Mysql - beginner!
php page-refresh/redirect/boot help needed please
MySQL HELP!!
Big Help needed .
mySQL help needed please.
Help Needed. Host is blocked????
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.