messy mysql

Post all your tuts or request for tuts here.
Post Reply
tomtefan
Posts: 46
Joined: Tue Jun 22, 2010 12:46 pm

messy mysql

Post by tomtefan »

I erased my HD and re-installed wampserver.

but before that, i saved all work (ofcourse).

how ever, i might have saved my database wrong somehow...
i just saved it all into a .sql file. (exported).

and now when i try to import the .sql file. i get errors.


The sql file have both my game tables, and forum tables.
if thats the thing that mess up, is there a way to split them ?
or do i have to re-write all tables again ?


starting to re-write em all as i wait for answear.... :lol:
User avatar
KingScar
Posts: 54
Joined: Wed Sep 08, 2010 5:08 pm

Re: messy mysql

Post by KingScar »

WAMP wouldn't spit an error at you if their wasn't an error in your database in the first place.

The common things that could be wrong are:

***I'd recommend getting notepad++ it's an awesome free tool that can really help with coding***

Open your sql file in notepad++ and look for any errors you may have in their.

Another thing you could try would be to import each table one by one.

You may not be connected to the server.

you may not be creating tables the correct way in your code.

I'm not saying any of these are the problems or the solutions to your situation but, they are the most common problems I've run into when I've been importing sql into a WAMP server and usually how I fix them.

This is how to connect to your database:

Code: Select all

<?php

$db = mysql_connect("localhost","root","") or die("Database could not be found");
if(!$db)
die("no db");
if(!mysql_select_db("tutorial",$db))
die("No Database Selected");

?>
save that as connect.php


And if you wanted to test the connection to the database all you'd have to do is add this to the top of your code:

Code: Select all

include 'connect.php';
and if you wanted to learn more about how the connection between php and mysql I'd recommend reading Kevin Yank's tutorial on it which can be found here:

http://articles.sitepoint.com/article/p ... tutorial/2

It helps out a lot if you have a better understanding of the connection between the two even if you're a skilled coder.
Advanced:Html(XHTML), CSS, Writing
Intermediate: php, MYSQL, Level Design, C++, JavaScript
Beginner:Java, C-Lite, 3D modeling

The difference between me and you:

You: :geek: Me: :ugeek:

Image
tomtefan
Posts: 46
Joined: Tue Jun 22, 2010 12:46 pm

Re: messy mysql

Post by tomtefan »

Yey. i managed to import the database. :D
i splited the forum stuff from the game database stuff into different dokuments.


but now the game is messed up.
some things are not where they are supposed to be, alot of stuff are skewed :lol:

fix one thing, and another problem pops up hahaha
alexander19
Posts: 180
Joined: Fri Apr 02, 2010 1:05 pm

Re: messy mysql

Post by alexander19 »

tomtefan wrote: fix one thing, and another problem pops up hahaha
That happens A LOT while coding(at least it happened,maaaany times to me) :lol:
tomtefan
Posts: 46
Joined: Tue Jun 22, 2010 12:46 pm

Re: messy mysql

Post by tomtefan »

hehe ye, seems so.

but i still find it weird that it worked so much different before i erased the hd...


back then the pages just loaded up smoothly.
now they blink up. annoying as hell.

must be this windows version thats messed up abit.
cuz firefox also get alot of errors and needs to be emediatley closed and shit.

tho, this isnt the first time when iam close to finish line and things mess up.
but this time iam gonna finish it. even it if feckes me up 50 times.


computers are made to piss ppl off <-- what i always think :lol:
tomtefan
Posts: 46
Joined: Tue Jun 22, 2010 12:46 pm

Re: messy mysql

Post by tomtefan »

found the skewing error.

i was viewing it in explorer instead of firefox... doh!! :lol:
Post Reply

Return to “Tutorials”