The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Mysql not connected
Author Message
admin_teclis
Journeyman
*

Posts: 51
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Aug 2012
Reputation: 0

Age of Apocalypse

Post: #1
Sad Mysql not connected
Hi everyone, I have a problem with connecting to Mysql...

I followed the example of a user I found with the search button.

Report the script:

PHP Code:
sub-zero Wrote:
Code:
---- 
sphere.ini ----
// MySql configuration.
MYSQL=1
MySqlHost
=127.0.0.1
MySqlUser
=root
MySqlPassword
=
MySqlDatabase=sphere


Code
:
---- 
sphere_serv_triggers.scp ----
// This function is called on server startup
[FUNCTION f_onserver_start]
f_sphere_MySQL_connect


Code
:
---- 
sphere_MySQL.scp ----
[Function 
f_sphere_MySQL_connect]
DB.CONNECT
IF ( <DB.CONNECTED> )
    
SERV.LOG "Connection with MySQL...        [ OK ]"
ELSE
    
MySqlDatabase=mysql
    DB
.CONNECT
    DB
.EXECUTE "CREATE DATABASE IF NOT EXISTS `sphere`"
    
DB.EXECUTE "USE `sphere`"
    
MySqlDatabase=sphere
    serv
.f_sphere_MySQL_connect
    
//SERV.LOG "Connection with MySQL...        [ FAILED ]"
ENDIF 

But it did not appear in the log file it in the console status ok.
Obviously I did not even create the table ...
We carry the script made ​​by me to create the table:
PHP Code:
DB.EXECUTE "create table demo ( 
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
account VARCHAR(50),
name VARCHAR(50),
guild TEXT,
kills INT,
fame INT,
karma INT
);" 

What's wrong?
08-14-2012 01:09 AM
Find all posts by this user Like Post Quote this message in a reply
Shaklaban
Master
**

Posts: 378
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Mar 2012
Reputation: 8

DOT

Post: #2
RE: Mysql not connected
MySqlDatabase=sphere

i don't know this part is works or not, it must be serv.MySqlDatabase=sphere i think.

also you have very weird if condition.

and i don't know use keyword works on sphere or not.

best is create database from phpmyadmin etc. then just write your mysql settings to sphere.ini.
(This post was last modified: 08-16-2012 06:11 AM by Shaklaban.)
08-16-2012 06:11 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
admin_teclis
Journeyman
*

Posts: 51
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Aug 2012
Reputation: 0

Age of Apocalypse

Post: #3
RE: Mysql not connected
tnx for the reply...

I can just check and let you know if it works...
08-17-2012 02:31 AM
Find all posts by this user Like Post Quote this message in a reply
xwerswoodx
Journeyman
*

Posts: 86
Likes Given: 4
Likes Received: 7 in 4 posts
Joined: Jun 2012
Reputation: 0

UoMMO

Post: #4
RE: Mysql not connected
Change 127.0.0.1 to localhost and after your problem isn't solved can you write here what is the error on sphere.
08-19-2012 02:57 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)