Re: Holes in mysql primary key and other db issues...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Mike Shanley wrote:
I'm currently on a server using mysql 4.x and I'm having a few small issues that I can't seem to find a decent solution to. I would appreciate any help.

First, I have an ID field as my primary key, but whenever I delete a row, that ID is not filled. This is a major problem for random calls, organization, etc. I don't understand what the point of all that extra indexing memory is for if it doesn't keep track of itself.

I'm not sure what you mean by "extra indexing memory". The autonumber feature is simple in that MySQL just keeps track of the last ID used and increments it to get the next one. However, I don't think there is any overhead caused by deleted records. If you can cite a source for that statement then I'd be interested to hear about it.

Second, in part of my code, I build an array of ID values and would like to call them all from the mysql at once, instead of a foreach(~~) {database call here} loop. Any ideas?

select * from tablename where id in (1,2,3,4,5,6,7)

Lastly, I'd like to be able to call data from different (not joined) tables in a database. Aside from not being able to find info to do it, I'm wondering if any such solution would be worth it. What do you think?

If you can't join the tables together then they're not related, so you'll need to do separate DB calls. I'm not sure where the problem is here.

-Stut

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux