search
top

Get Database Prefix

I am listing an example for retrieving the Joomla database prefix.

<?php

$db =& JFactory::getDBO(); //Returns a reference to the global database object
echo "Database prefix is : " . $db->getPrefix();
 //output will be something like this Database prefix is : jos_

?>

3 Responses to “Get Database Prefix”

  1. webnoos says:

    Thanks
    Thanks
    Thanks
    Thanks
    Thanks

  2. xhtmlpark says:

    hi,
    this is a very helpfull post.
    please also post about, How to decrypt joomla password?

    Thanks
    xhtmlpark

    • Pragnesh says:

      Hello,

      We cannot decrypt joomla password, but you can change it by updating the password field in the users table, its md5 encrypted.

      So you can do update query like “set `password` = md5(‘test’)”, where test will be the new password.

Leave a Reply

top