B Bas Hamstra Member Licensed User Longtime User May 16, 2013 #1 The following works fine: Code: job1.Download2("http://84.84.231.194/test.php", Array As String("query","select UserID from usersonline")) But how to get this working: Code: job1.Download2("http://84.84.231.194/test.php", Array As String("query","select UserID from usersonline where UserID='Hamstra'")) It connects to a MySQL database via PHP. I browsed the fora but couldn't find it. Thousand thanks for a quick answer:sign0060: Bas Hamstra
The following works fine: Code: job1.Download2("http://84.84.231.194/test.php", Array As String("query","select UserID from usersonline")) But how to get this working: Code: job1.Download2("http://84.84.231.194/test.php", Array As String("query","select UserID from usersonline where UserID='Hamstra'")) It connects to a MySQL database via PHP. I browsed the fora but couldn't find it. Thousand thanks for a quick answer:sign0060: Bas Hamstra
B Bas Hamstra Member Licensed User Longtime User May 16, 2013 #2 This is the PHP script <?php $mysqlDatabaseName = "gameroom"; $mysqlUsername = "root"; $mysqlPassword = ""; mysql_connect('localhost', $mysqlUsername, $mysqlPassword) or die(mysql_error()); mysql_select_db("gameroom") or die(mysql_error()); if(isset($_GET['query'])) { $Query = $_GET['query']; $Query = mysql_real_escape_string($Query); $Result = mysql_query($Query); $rows = array(); while($r = mysql_fetch_assoc($Result)) { $rows[] = $r; } echo json_encode($rows); } ?> Upvote 0
This is the PHP script <?php $mysqlDatabaseName = "gameroom"; $mysqlUsername = "root"; $mysqlPassword = ""; mysql_connect('localhost', $mysqlUsername, $mysqlPassword) or die(mysql_error()); mysql_select_db("gameroom") or die(mysql_error()); if(isset($_GET['query'])) { $Query = $_GET['query']; $Query = mysql_real_escape_string($Query); $Result = mysql_query($Query); $rows = array(); while($r = mysql_fetch_assoc($Result)) { $rows[] = $r; } echo json_encode($rows); } ?>
B Bas Hamstra Member Licensed User Longtime User May 16, 2013 #3 Found the answer Anyone interested? I can now fire ANY query as a simple string. Query="Select * from usersonline where UserID = 'Hamstra'" Query="Select * from usersonline where LoggedIn = 1'" Query = "Select * from usersonline where UserID like '%a%'" Query = "Select * from usersonline where UserID < 'Z'" All tested and work. Bas Last edited: May 16, 2013 Upvote 0
Found the answer Anyone interested? I can now fire ANY query as a simple string. Query="Select * from usersonline where UserID = 'Hamstra'" Query="Select * from usersonline where LoggedIn = 1'" Query = "Select * from usersonline where UserID like '%a%'" Query = "Select * from usersonline where UserID < 'Z'" All tested and work. Bas