General Community > Scripting Help

SMF1 Trying to get Auto_increment value.

<< < (2/8) > >>

MrMorph:
Yeah I get how it works.  I know $db_prefix and $db_name are different things.  I'm not really sure why you have tried to explain this to me; but thanks for the effort  ???

In settings.php $db_prefix is en empty string...

I just don't get why SSI.php is doing what it is doing - why is $db_prefix not empty ?

If you take a look at my code and question it's pretty clear what I am getting at....

Arantor:
$db_prefix is not empty in SSI for one very good reason: SSI is supposed to be called outside of SMF. Since that's the case, no mysql_select_db is called, but to ensure that things are actually done as they should be (i.e. that queries actually work), $db_prefix is 'fixed' to re-include the DB name so that even if you're inside another system's database (e.g. WP) SMF queries work.

Better question, why are you trying to get the auto-increment value?

MrMorph:
Cool thanks, that's what I needed to know.  That explains why it works with SELECTS, but as a pattern matcher it's going to be of no use to me.  I will have to obtain the prefix myself and prepend it to my pattern that looks for the table name.

I just need the auto increment for what I am working on... do you really want me to bore you with details ?

Arantor:
Actually, yes I would like the details, because depending on what you're trying to do, you're either at risk of data inconsistency due to race conditions, or there's a better way of doing it than what you're trying to do.

MrMorph:
Oh ye of little faith...

I can't disclose details of the project at the moment sorry.

As for race conditions, it's not mission critical at all.

Thanks for your help :)

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version