[MySQL] How to send some info from MySQL to POL

Get Help on scripting in POL with configurations, config setups, script trouble shooting, etc.

Moderator: POL Developer

Post Reply
Harley
Forum Regular
Posts: 325
Joined: Sat Mar 18, 2006 1:41 am
Location: Germany

[MySQL] How to send some info from MySQL to POL

Post by Harley » Thu Jan 31, 2019 5:44 pm

Hi guys!
For the reason that answers to my questions still remain, I want to know, how POL can get specific information from MySQL request?

Cause all that I got is only from this code:

Code: Select all

	query:="SELECT card FROM gamecards "+ card +"";
	print( " InMySQL() | query 1 : " + query ); // DEBUG

	query:= mysql_query(connection,query);
	print( " InMySQL() | query 2 : " + query ); // DEBUG
This one:
InMySQL() | query 1 : SELECT card FROM gamecards card_name
InMySQL() | query 2 : SQLResultSet
But I want to return this card_name and compare it. How can I make it with our POL functions?

p.s.
Maybe there is some reason to give more information, besides how MySQL works, how POL works with in this topic?
viewtopic.php?f=7&t=6222

With best regards!)

Skinny
Journeyman Poster
Posts: 68
Joined: Wed Dec 19, 2012 10:27 pm

Re: [MySQL] How to send some info from MySQL to POL

Post by Skinny » Fri Feb 01, 2019 10:49 am

Code: Select all

var value_name := "test";
var query := "SELECT card FROM gamecards WHERE card_name = " + value_name;
var result := mysql_query(connection, query);

if(!mysql_num_rows(result))
	Syslog("\nNo card found.");
	return 0;
endif

var line;
while(line := mysql_fetch_row(result))
	Syslog("\n " + line);
endwhile

Harley
Forum Regular
Posts: 325
Joined: Sat Mar 18, 2006 1:41 am
Location: Germany

Re: [MySQL] How to send some info from MySQL to POL

Post by Harley » Sun Feb 03, 2019 4:28 pm

Skinny, thank you for an example! Will test very soon!

Post Reply