General Community > Scripting Help
SMF1 Trying to get Auto_increment value.
MrMorph:
I think I will just have to run a query on the plain prefix...would work. Unless it is also stored in some other place already loaded...I'll dig around a bit more.
Yoshi:
Does it work if you remove the ' quotes? Or does it fail to work how you want it, there, too?
EDIT: Reading your new post, try print_ring $context and $db_prefix, like so:
--- Code: ---print_r($context, $db_prefix);
--- End code ---
MrMorph:
--- Quote from: Yoshi2889 on May 21, 2012, 11:12:50 AM ---Does it work if you remove the ' quotes? Or does it fail to work how you want it, there, too?
EDIT: Reading your new post, try print_ring $context and $db_prefix, like so:
--- Code: ---print_r($context, $db_prefix);
--- End code ---
--- End quote ---
Nope removing the quotes just results in a mysql_error. The quotes need to be there to form a proper query.
$db_prefix is `smf1`.
$context does not hold the setting, nor does $settings.
I think whoever wrote that part just did not expect it to be used the way I am using it, ie in a pattern matching exercise.
I can work around it, just would have been simpler... I think the way it is done works in the majority of cases that the coder anticipated and that's fair enough really.
Yoshi:
--- Quote from: MrMorph on May 21, 2012, 11:22:50 AM ---
--- Quote from: Yoshi2889 on May 21, 2012, 11:12:50 AM ---Does it work if you remove the ' quotes? Or does it fail to work how you want it, there, too?
EDIT: Reading your new post, try print_ring $context and $db_prefix, like so:
--- Code: ---print_r($context, $db_prefix);
--- End code ---
--- End quote ---
Nope removing the quotes just results in a mysql_error. The quotes need to be there to form a proper query.
$db_prefix is `smf1`.
$context does not hold the setting, nor does $settings.
I think whoever wrote that part just did not expect it to be used the way I am using it, ie in a pattern matching exercise.
--- End quote ---
Okay, I'm lost at this now. Can't fire a feature request/bug report either as 1.x is frozen except for security issues, which this clearly is not.
--- Quote ---I can work around it, just would have been simpler... I think the way it is done works in the majority of cases that the coder anticipated and that's fair enough really.
--- End quote ---
I suggest you work around it by creating a new variable then, and storing the prefix in there.
Arantor:
Thing is, it's exactly the same in 2.0 and for exactly the same reason.
But you see, if I understood why you wanted the auto-increment, I could probably suggest a better way to get it...
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version