...

View Full Version : Re-created table failing



h8ids
07-17-2006, 10:50 PM
Re-created a table in my database.
All field names and values are identical to the original table.
Table name is correct too.

Now the web-pages will not store data to the table.

I don't know why?

guelphdad
07-18-2006, 02:52 AM
well you can't have two tables with the same name in the same database. either you have given a different table name or you have used a different database. which is it?

did you modify your php or whatever code to reflect that difference?

raf
07-18-2006, 08:18 AM
what's the tablename + what OS are you on + did you use a db-frontend and which one?

also, can you post the errormessage that you get when you zre trying an insert?

h8ids
07-18-2006, 03:30 PM
I "Dropped" the original table from the database (I'm assuming that "Drop" is another way of saying delete. The MySQL Query Help didn't elaborate much.)

Having dropped the table, I created a new table; identical in every way.
Tests have proven that I can pull and view records (which are inserted driectly into the table) but I can't edit them.
The webpage code hasn't changed. Nor have the Database permissions.

Baffled by the weirdness.
Using MySQL 4.1 with Apache 2.0.58




well you can't have two tables with the same name in the same database. either you have given a different table name or you have used a different database. which is it?

did you modify your php or whatever code to reflect that difference?

raf
07-18-2006, 03:42 PM
I "Dropped" the original table from the database (I'm assuming that "Drop" is another way of saying delete. The MySQL Query Help didn't elaborate much.)
DROP tablename
will mean that the table and all its indexes is deleted

TRUNCATE tablename
will mean that all records are deleted (for InnoDB) OR that the table is dropped + automatically recreated (for the other storage engines (because this is often faster then deleting the records and undating the indexfiles))

DELETE FROM tablename
will mean that all records are deleted.

Seems to me that you actually want FRUNCATE or DELETE FROM ...
maybe try these and see if the problem persists.


Tests have proven that I can pull and view records (which are inserted driectly into the table) but I can't edit them.
Can you elaborate on this? How did you test it? What do you mean by 'inserted driectly into the table'?

h8ids
07-18-2006, 03:52 PM
No error message appears.
Webpages are coded with

error_reporting(E_ALL);
error_reporting(E_ALL | 'E_STRICT');

php.ini has the following line activated.

error_reporting = E_ALL
display_errors = On
display_startup_errors = on
log_errors = On

There are no errors listed in the Administrator error log.



what's the tablename + what OS are you on + did you use a db-frontend and which one?

also, can you post the errormessage that you get when you zre trying an insert?

h8ids
07-18-2006, 03:59 PM
Raf,

Since the original table has been Dropped and no longer appears in the DB, would Truncating the new table resolve the problem?
Hoping I don't have to re-create the table or the DB.

I'm able to edit the DB directly through the MySQL Query tool. I inserted a record to see if my webpage would pull the data; it did. But I can't edit the record nor can I save a new record.



Can you elaborate on this? How did you test it? What do you mean by 'inserted driectly into the table'?



DROP tablename
will mean that the table and all its indexes is deleted

TRUNCATE tablename
will mean that all records are deleted (for InnoDB) OR that the table is dropped + automatically recreated (for the other storage engines (because this is often faster then deleting the records and undating the indexfiles))

DELETE FROM tablename
will mean that all records are deleted.

Seems to me that you actually want FRUNCATE or DELETE FROM ...
maybe try these and see if the problem persists.


Can you elaborate on this? How did you test it? What do you mean by 'inserted driectly into the table'?

h8ids
07-18-2006, 05:03 PM
Dropped the new table.
Created a third table; same name and fields.

Tested the submission page and voila, it now works... :confused: :)

Strange!

Thanks guys.

raf
07-18-2006, 05:10 PM
Since the original table has been Dropped and no longer appears in the DB, would Truncating the new table resolve the problem?
depends on what the problem is.
but it seams to me you're reinventing the wheel --> truncate does automatically what you are doing now.

I'm able to edit the DB directly through the MySQL Query tool. I inserted a record to see if my webpage would pull the data; it did. But I can't edit the record nor can I save a new record
yes, but are you using the same user in MySQL Query as in PHP?
for instance, if you logi to the MySQL Query tool as root, and you use some useraccount with fewer permissions in your mysql_connect(), then you might have different permissions for that table...



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum