1
mcvegan
using a config file for mysql
  • 2007/8/15 7:43

  • mcvegan

  • Just popping in

  • Posts: 10

  • Since: 2007/8/15


Hello, i`m new at working at xoops. Right now, i`m trying to convert an already existing search egine, to a module. Because i found nowhere such a module. Altough, everything is going great, and it already working. But there is still one slightly problem. And i think it's gonna be a big issue, since the search engine has a config file for connecting to the mysql. I can just write my own information in it, and it works. But i one to configure this automatic when someone installs this module. I'l already know about the $xoopsDB option, but is there a way, so that it first loads the XOOPS variables en then change them to the original variables from this script.(sorry, my english is a little bit crappy :() But already thanx.


    $database="xoops";
    
$mysql_user "";
    
$mysql_password ""
    
$mysql_host "localhost";
    
$mysql_table_prefix "";



    
$success mysql_pconnect ($mysql_host$mysql_user$mysql_password);
    if (!
$success)
        die (
"Cannot connect to database, check if username, password and host are correct.");
    
$success mysql_select_db ($database);
    if (!
$success) {
        print 
"Cannot choose database, check if database name is correct.";
        die();
    }
?>

2
mcvegan
Re: using a config file for mysql
  • 2007/8/16 7:13

  • mcvegan

  • Just popping in

  • Posts: 10

  • Since: 2007/8/15


I now know how to connect the database, but i noticed, that this post is at the wrong place of this forum. I`m sorry about that :(

Login

Who's Online

400 user(s) are online (268 user(s) are browsing Support Forums)


Members: 0


Guests: 400


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits