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
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 786 - File: showthread.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/showthread.php 786 errorHandler->error






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
Post Reply 


Messages In This Thread
Mysql not connected - admin_teclis - 08-14-2012 01:09 AM
RE: Mysql not connected - Shaklaban - 08-16-2012, 06:11 AM
RE: Mysql not connected - admin_teclis - 08-17-2012, 02:31 AM
RE: Mysql not connected - xwerswoodx - 08-19-2012, 02:57 AM

Forum Jump:


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