Page 1 of 1

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

Posted: Thu Jan 31, 2019 5:44 pm
by Harley
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!)

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

Posted: Fri Feb 01, 2019 10:49 am
by Skinny

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

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

Posted: Sun Feb 03, 2019 4:28 pm
by Harley
Skinny, thank you for an example! Will test very soon!