SA-MP Forums Archive
MySQL Database Error - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: MySQL Database Error (/showthread.php?tid=521067)



MySQL Database Error - Jigsaw123 - 21.06.2014

Hello..


Basically, I've compiled the script with no errors, and I've added the MySQL Database. Then when i Press 'GO' It gives me this:

Код:
Error
SQL query:

--
-- Dumping routines for database 'wcrp_gameserver'
--
/*!50003 DROP FUNCTION IF EXISTS `GetLockerItemName` */;


MySQL said: Documentation

#1046 - No database selected
And, I've already connected it to the script.. This is the code:

Код:
#if chc-debug
	#define debug 1
	#define dbg-callbacks 0
	#define MYSQL_HOST "xxxxx"
	#define MYSQL_USER "xxxxx"
	#define MYSQL_DATABASE "xxxxx"
	#define MYSQL_PASSWORD "xxxxx"
	#define ip_remote_check 0
#else
	#define debug 0
	#define dbg-callbacks 0
	#define MYSQL_HOST "xxxxx"
	#define MYSQL_USER "xxxxx"
	#define MYSQL_DATABASE "xxxxx"
	#define MYSQL_PASSWORD "xxxxx"
	#define ip_remote_check 0
#endif
(( I've used X's to cover the actual details )). If anyone could help, I'd appreciate it.

Thanks in Advance!


Re: MySQL Database Error - Jigsaw123 - 21.06.2014

Anybody Knows?!


Re: MySQL Database Error - Vince - 21.06.2014

At the beginning of your SQL script, put:
PHP код:
USE wcrp_gameserver
Or whatever your database name is.


Re: MySQL Database Error - Jigsaw123 - 21.06.2014

I did what you told me to, now I got an error:

PHP код:
 C:\Users\USER\Documents\Backup\RP\pawno\WCRP.pwn(84) : error 010invalid function or declaration 
And this error in the MySQL Database:

PHP код:
 #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */' at line 2 



Re: MySQL Database Error - Jigsaw123 - 21.06.2014

Anyone know how to fix it?:

PHP код:
 Error
SQL query
:
USE 
xxxxx/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
MySQL saidDocumentation
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */' at line 2