Jump to content
  • 0

Question

Posted (edited)

Yesterday i post a problem with my offline buffer sellers ,i was just forgot 1line into offlinetradetables.
NOW my problem is so AKWARD!! The code is 100% functional  !

 

I use 2databases in navicat 1 for testing and 1 clean( no1 name=test and no2 name=main server)

(*1 serverfiles with 2 databases , so the code is the same*)

Problem: In my code seller changes  name color & tittle when selling buffs(like offline shops) . & when he stop selling it return into normal.

-In my test database everything works perfect , when buffer sells automatically changes colors & tittle .Also when stop sell return everything to normal.
BUT in my main server database isn't even save the seller as result player changes name color and tittle without get back to previous (i use the same table , even with copy paste the table isn't working)

look Pics here: 
https://imgur.com/a/abSahbO.

I told you most AKWARD problem, why is that happening only in 1/2 databases ? :/ any thoughts?



i let also code pic + query of table

https://imgur.com/a/kOx2pqt

query:

 

-- ------------------------------------------
-- Table structure for sellbuff_seller_data
-- ------------------------------------------
DROP TABLE IF EXISTS `sellbuff_seller_data`;
CREATE TABLE `sellbuff_seller_data` (
  `char_obj_id` decimal(11,0) NOT NULL,
  `lastTitle` varchar(16) DEFAULT NULL,
  `lastTitleColor` varchar(8) NOT NULL,
  `lastNameColor` varchar(8) NOT NULL,
  PRIMARY KEY (`char_obj_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

Edited by Irrelevant

Recommended Posts

  • 0
Posted
7 hours ago, Irrelevant said:

well i am not sure if i get it , but .. i created an backup of test database and i ran it into main database and yes it work fine (but i cant understand why cause its the same backup just with few changes like events,test chars ,etc :/ ) i am currently delete the code and i will insert from beggining even isn't code problem,hopefully find something i missing.
*P.S.1 i also created an new database which the code work again only with "test" databases backup.
*P.S.2 i even changed the name of table in code and still the same . 

 

 

yes at code picture i add last , you can see the table code 

You are not probably looking at the right table. The thing that the code is using a specific table, doesn't mean you have to look only there. And again, does your sql query contains any 'join' word or does it run another instance of "select from where" as a parameter to run a query?

 

  • 0
Posted
4 minutes ago, wongerlt said:

maybe u have changes in other tables?

show code.

dude isnt the table, or code problem.. as you see in pics ,with same code and same table in different database it works perfectly

  • 0
Posted
Just now, Irrelevant said:

dude isnt the table, or code problem.. as you see in pics ,with same code and same table in different database it works perfectly

or just simple mistake that u didn't see.

one simple method to test just print ur mysql query and execute on ur main db via navicat.

  • 0
Posted
Just now, wongerlt said:

or just simple mistake that u didn't see.

you dont get it ... i have 2 databases  with SAME TABLES .
I USE 1 SERVERFILES ,code is the SAME! i change only db location by network.ini .

  • 0
Posted
1 minute ago, Irrelevant said:

you dont get it ... i have 2 databases  with SAME TABLES .
I USE 1 SERVERFILES ,code is the SAME! i change only db location by network.ini .

like i said test ur query via navicat in main db. maybe different mysql version? it can occur syntax errors and etc..

  • 0
Posted
3 minutes ago, wongerlt said:

like i said test ur query via navicat in main db. maybe different mysql version? it can occur syntax errors and etc..

i face that problem yesterday.

 i used the same query to create table,also created it manually .the mysql version is the same ,they are both in same localhost

  • 0
Posted (edited)
5 minutes ago, Irrelevant said:

i face that problem yesterday.

 i used the same query to create table,also created it manually .the mysql version is the same ,they are both in same localhost

in ur code print query, random example:
 

		try (Connection con = ConnectionPool.getConnection();
			PreparedStatement ps = con.prepareStatement(INSERT_MACRO))
		{
			ps.setInt(1, _owner.getObjectId());
			ps.setInt(2, macro.id);
			ps.setInt(3, macro.icon);
			ps.setString(4, macro.name);
			ps.setString(5, macro.descr);
			ps.setString(6, macro.acronym);
			ps.setString(7, sb.toString());
			ps.execute();
          System.out.println(ps); // print query to console.
		}

copy it from console and then execute in navicat in ur MAIN database. idk how explain 😄 

if u not see anything in console then something wrong in ur java code.

Edited by wongerlt
  • 0
Posted (edited)
9 minutes ago, wongerlt said:

in ur code print query, random example:
 




		try (Connection con = ConnectionPool.getConnection();
			PreparedStatement ps = con.prepareStatement(INSERT_MACRO))
		{
			ps.setInt(1, _owner.getObjectId());
			ps.setInt(2, macro.id);
			ps.setInt(3, macro.icon);
			ps.setString(4, macro.name);
			ps.setString(5, macro.descr);
			ps.setString(6, macro.acronym);
			ps.setString(7, sb.toString());
			ps.execute();
          System.out.println(ps); // print query to console.
		}

copy it from console and then execute in navicat in ur MAIN database. idk how explain 😄 

yy the code is the same,i told you that is fine. the problem is something weird!not so obvious, if that so it wouldnt work at all ,now it work in test database.

 

let me explain you further:
Imagine: that you have an functional database right? lets name it "db1", then you create an backup of db1. 
This backup you run it into a new database which named "db2" .
then you go into your serverfiles and you change only localhost location from "db1 to db2" and even so "db1" was functional "db2" is NOT .

i cant help you more to understand :/

Edited by Irrelevant
  • 0
Posted (edited)
8 minutes ago, Irrelevant said:

yy the code is the same,i told you that is fine. the problem is something weird!not so obvious, if that so it wouldnt work at all ,now it work in test database

but you tested ur query manually in navicat??? it's not weird you just didn't see mistake.

just debug every action. easy.

Edited by wongerlt
  • 0
Posted
1 minute ago, wongerlt said:

but you tested ur query manually in navicat??? it's not weird you just didn't see mistake.

yy i even wrote you that above

40 minutes ago, wongerlt said:

but you tested ur query manually in navicat??? it's not weird you just didn't see mistake.

just debug every action. easy.

watch main description. i add code response to sql pictures and my table query

  • 0
Posted
10 hours ago, Irrelevant said:

yy i even wrote you that above

watch main description. i add code response to sql pictures and my table query

did you create `procedures` in your main database? and why u use it???

  • 0
Posted

Do you use any "join" sql query ?? It seems like you have external data in your test database while at your main database you missing them. 

Guest
This topic is now closed to further replies.
×
×
  • Create New...