How to get current database tablename/table prefix?
#1
Hello everyone. Smile

How can I get the current database table name and prefix?
Reply
#2
Do you mean you want to get the table prefix name, like this:

tableprefix_users ?


If that is correct, you can use the TABLE_PREFIX code.
TABLE_PREFIX
[Image: information.gif] MyBB Support Technician
Please do not PM me for support.


MyBBatically - A quick and easy way to update your board!
Reply
#3
(2012-07-25, 04:13 PM)Vernier Wrote: Do you mean you want to get the table prefix name, like this:

tableprefix_users ?


If that is correct, you can use the TABLE_PREFIX code.
TABLE_PREFIX

Correct, I'm guessing that is a PHP constant? Thank you for your help.
Reply
#4
What are you trying to do with it?

For example, if you're running a query, you'd use something like this:

$db->query("UPDATE `".TABLE_PREFIX."users` SET email='1' WHERE uid='1'");
[Image: information.gif] MyBB Support Technician
Please do not PM me for support.


MyBBatically - A quick and easy way to update your board!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)