Page 1 of 1

Grrrr...

Posted: Wed Mar 19, 2003 2:50 pm
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...

Posted: Wed Mar 19, 2003 2:53 pm
by Jade
Sounds like its an installation or compile error. Have you tried re-installing them? Dunno...might work.

Posted: Wed Mar 19, 2003 2:56 pm
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 =/

Posted: Wed Mar 19, 2003 3:06 pm
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...

Posted: Wed Mar 19, 2003 5:33 pm
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?

Posted: Wed Mar 19, 2003 8:29 pm
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

Posted: Thu Mar 20, 2003 3:24 pm
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..

Posted: Fri Mar 21, 2003 2:06 am
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

Posted: Wed Mar 26, 2003 7:51 pm
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.

Posted: Wed Mar 26, 2003 11:16 pm
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. :)

Posted: Thu Mar 27, 2003 2:42 am
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

Posted: Thu Mar 27, 2003 4:41 am
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.

Posted: Thu Mar 27, 2003 7:20 pm
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?

Posted: Thu Mar 27, 2003 7:25 pm
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 :(

Posted: Thu Mar 27, 2003 8:54 pm
by Jade
At least your smart enough to admit it....few people stoop as low. Round of applause to you.

Jade