• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Get Results from a PHP Query

 
Alexis Michael
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am planning to create an online multiplayer game, using a Java applet. I do not want to use JDBC inside my applet, nor use servlets, so I turned to good ol' PHP.

The problem is, I don't know how to retrieve the results from a PHP query to my SQL database, and store them in my applet variables.

Any help or sample code would be great.

Thanks,
Alex
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24211
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your server can embed initialization information into the page the applet is embedded in -- i.e., if you generate the HTML dynamically on your server (using PHP!) then your applet can be initialized from whatever information you embed in the page.

The actual applet coded will be running on the client (desktop) machine, so once the page is created, all it can do is contact your server over the network. That means it can, for example, use HTTP "POST" requests to send queries, and get results back.
 
Alexis Michael
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
use HTTP "POST" requests to send queries, and get results back.


this is my question actually how do i get those results back? do i have the php script create an html page with the results, and then get that output through a streaming reader in my applet?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic