PDA

View Full Version : mySQL - from the start...


vickree
04-24-2008, 08:21 PM
Hello everyone,

I've once worked with databases mySql and PHP coding together to make beginner shopping carts and login while I was finishing up my diploma. Since the Ive focued on design, and now im for a loss.:confused:

I downloaded Xampp, but I cant recall how to get it to work with my server? It says localroot... Im just for a loss here...

I want to download MySQL, but Im just getting frustrated. Any helpful input will be greatly appreciated!:thumbsup:

Dfraz
04-24-2008, 08:39 PM
So what exactly do you want to do?

vickree
04-24-2008, 08:47 PM
Once i get the database set up, im sure I'll be able to remember how to code everything... But as of right now, I can't recall how to exactally get the database set up. In school we used Xampp, but the whole process of this is confusing me, because in school they pretty much had one made up for you too use...

Dfraz
04-24-2008, 08:57 PM
Ok so you need help with making and setting your database up?

Ok first of all go into your site's control panel and click "Mysql Database Wizard" Then follow the steps.

Then go into phpmyadmin and make your table(s).
Then make a file called: config.php or database.php or whatever you want.

Then put in it: <?php
mysql_connect("localhost", "YOUR_USER", "YOURPASSWORD") or die(mysql_error());
echo "Connected to MySQL<br />";
mysql_select_db("YOUR_DATABASE") or die(mysql_error());
echo "Connected to Database";
?>


Ok in there it shows "YOUR_DATABASE "YOUR_USER" Replace "YOUR" with your site's username. My username is "ocgroup" so you use the username that you login to.

Then replace "USERNAME" with your database's username.

That's it :thumbsup:

If you didn't get any of that read here: http://www.tizag.com/mysqlTutorial/mysqldatabase.php



Gimme some rep if I helped :thumbsup:
Thanks