• Howdy! Welcome to our community of more than 130.000 members devoted to web hosting. This is a great place to get special offers from web hosts and post your own requests or ads. To start posting sign up here. Cheers! /Peo, FreeWebSpace.net
managed wordpress hosting

php/mysql killing me... Need some help plz...

Mekhu

New Member
Hey guys.

Ok, I have a minor problem and a major problem.

The MINOR:

This line below is from my php file. It's supposed to tell the person what record they deleted.

print("Your Record ($destination) Has Been Deleted");

Here is what is being outputted though:
"Your Record () Has Been Deleted"

Does anyone know why it's not calling the destination name from the database?


THE MAJOR QUESTION:

My database seems to be at some sort of limit...

Right now I have 27 entries into it. But what i've noticed is the id's are in the 100's. How do I reset them each time so they don't count the deleted records that have been removed over time?

Also, how do I get rid of this limit?


Thanks,

Mekhu
 
you probably have made some nutty error somewhere.
do u edit mysql with PHP or thru prompt?
 
If the column is an auto increment column then the numbers keep going up and up - there is nothing you can do about that. The exception is when the LAST record that was inserted is deleted, then that records id number will be reused. If the column you set to auto increment was defined as an INT then potentially you can have millions of records in your table. Better yet is to use an INT UNSIGNED type.

auto increment is designed to provide each record with a unique identfier (an "artificial" primary key) and nothing else. You should not relly on it to maintain order between your records, or as a counter of how many records there are, etc.

:)
 
I fixed the first problem I had...

Still won't let me add new entries though...

Here's the error I am getting:
Insert Failed: 1062 Duplicate entry '127' for key 1

If someone could help me step by step I would appreciate it!
 
Just change that field to an int type...

Not very efficient but after you delete an entry you could do something like:

update table set field=field-1 where field>deleted
 
Woofcat, you're alive! :)

It's been months since your last post.
 
Last edited:
Back
Top