Grrrr...

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
bobthebobert
Forum Commoner
Posts: 25
Joined: Sat Feb 15, 2003 5:56 pm

Grrrr...

Post by bobthebobert »

Well, I have been doing well lately, but now I have another problem I can't figure out -.-

My MySql/Php table doesn't save when I turn off my computer...

It will be working fine, then I turn my computer off, and when its back on, it doesnt work anymore...
User avatar
Jade
Forum Regular
Posts: 908
Joined: Sun Dec 29, 2002 5:40 pm
Location: VA

Post by Jade »

Sounds like its an installation or compile error. Have you tried re-installing them? Dunno...might work.
bobthebobert
Forum Commoner
Posts: 25
Joined: Sat Feb 15, 2003 5:56 pm

Post by bobthebobert »

What I meant was that the data wasnt saved anymore =/

How exactly would that be an compile error? I am still pretty new to this =/
User avatar
Jade
Forum Regular
Posts: 908
Joined: Sun Dec 29, 2002 5:40 pm
Location: VA

Post by Jade »

When you ran a query on the database did you then check to see if it's actually in the database?

For example, just because you ran a script doesn't mean it always works...
bobthebobert
Forum Commoner
Posts: 25
Joined: Sat Feb 15, 2003 5:56 pm

Post by bobthebobert »

I am 100% the database had it in there before I shut down.

Do you have to close your connection or something for it to save?
User avatar
Jade
Forum Regular
Posts: 908
Joined: Sun Dec 29, 2002 5:40 pm
Location: VA

Post by Jade »

you shouldn't have to close your connection. You can make some queries on the database that don't actually put anything into the database... to put things into the database you should be using (or something similar):

$sql = "INSERT into database_name (name,email,pass) VALUES ('$name','$email','$pass)" or die ('DB Error');

$result = mysql_query($sql);


If you're not doing something that actually PUTS the data into the database then of course it wouldn't still be there when you turn the computer back on the next day.

Jade
bobthebobert
Forum Commoner
Posts: 25
Joined: Sat Feb 15, 2003 5:56 pm

Post by bobthebobert »

Ok, I insert the stuff into the database, and when MySql is running it lets me Select them. But as soon as I turn off MySql.exe, I can't access them anymore..
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

bobthebobert wrote:But as soon as I turn off MySql.exe, I can't access them anymore..
That's because you need MySQL running in order to use the data stored in it's databases. PHP doesn't do the work of querying the database, MySQL does so you need MySQL running when you want to interact with your databases.

Mac
bobthebobert
Forum Commoner
Posts: 25
Joined: Sat Feb 15, 2003 5:56 pm

Post by bobthebobert »

Grrr, I know that. What I meant was as soon as i turned off Mysql, and turned it back on, the data from before that I would use would be gone.
User avatar
phice
Moderator
Posts: 1416
Joined: Sat Apr 20, 2002 3:14 pm
Location: Dallas, TX
Contact:

Post by phice »

What I highly suggest: Save all data (htdocs/ and mysql data); install PHPTriad; use that setup for apache, php, and mysql (along with phpMyAdmin). Works great for me. :)
Image Image
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

bobthebobert wrote:Grrr, I know that. What I meant was as soon as i turned off Mysql, and turned it back on, the data from before that I would use would be gone.
That clarifies it a bit more.

What exactly do you mean by 'it doesnt work anymore' and 'I can't access them anymore'? Do you get error messages, does a script that works before not work after?

Have you tried accessing the database through a database admin tool like phpMyAdmin to see what's in the database? If you haven't it would probably be a good idea.

This is a strange problem, the more information you give us about what you're doing, what error messages or strange script behaviour you're getting the more likely we will be able to help you.

Mac
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

your mysql-data directory contains a subdirectory for each database created with files for each table. Do those files change if you add records?
Hopefully your tables are not defined as HEAP ;)
running mysqlcheck --all-databases might be helpfull, too.
bobthebobert
Forum Commoner
Posts: 25
Joined: Sat Feb 15, 2003 5:56 pm

Post by bobthebobert »

O, i just looked through my tables, they are designated as HEAP. I have no idea why I made them like that, because I have no idea what it means. So I am guessing HEAP tables don't save?
bobthebobert
Forum Commoner
Posts: 25
Joined: Sat Feb 15, 2003 5:56 pm

Post by bobthebobert »

Ok, I guess I might just make it onto the Darwin awards....

They were set as HEAP, changed it and now it works. Christ I am an idiot. Sorry for wasting your time :(
User avatar
Jade
Forum Regular
Posts: 908
Joined: Sun Dec 29, 2002 5:40 pm
Location: VA

Post by Jade »

At least your smart enough to admit it....few people stoop as low. Round of applause to you.

Jade
Post Reply