Author Topic: Connecting to MySQL.  (Read 1214 times)

Hey, Sorry if this sounds (extremely) noobish, but (I've asked this before like 2 months ago) how do you connect to MySQL? Can Torque use PHP? Ty.

It has a TCPObject which can send HTTP GET/POST requests to webservers. Look at RTBH_Support.cs in RTB for examples of this.


Ephi's tutorial was very... Lame. Plus, RTB is a hassel to sift through, and I've never found anything of use in there.

First, you need a server that is hosting a PHP script.

Say your PHP script calls for a name and it does something to it.

Code: [Select]
new HTTPObject(PHPtest);
function PHPtest::onLine(%this, %line)
{
//This is say a echo in PHP, anything you echo and any HTML code will come in through here, so you'll want to filter.
echo(%line); //Puts the returned line in console
}
HTTPObject.get("http://YourWebsite.com/PHPScript.php:80","name=hello");
That would connect to yourWebsite.com/PHPScript?name=hello
Then anything that would be in your browser is transferred to console.

Ephi's tutorial was very... Lame. Plus, RTB is a hassel to sift through, and I've never found anything of use in there.

First, you need a server that is hosting a PHP script.

Say your PHP script calls for a name and it does something to it.

Code: [Select]
new HTTPObject(PHPtest);
function PHPtest::onLine(%this, %line)
{
//This is say a echo in PHP, anything you echo and any HTML code will come in through here, so you'll want to filter.
echo(%line); //Puts the returned line in console
}
HTTPObject.get("http://YourWebsite.com/PHPScript.php:80","name=hello");
That would connect to yourWebsite.com/PHPScript?name=hello
Then anything that would be in your browser is transferred to console.

First off, I didn't write a tutorial. And secondly - atleast what I told him wasn't broken. I think the problem with you is that you're incompetent, RTB pretty nicely shows how to communicate with a webserver via PHP (and even retain sessions, or modify header data) so the fact that you can't find anything "useful" is purely a reflection of your own inability to understand.

HTTPObject.get() would just fail because there is nothing called HTTPObject. Try to pay attention when you're misleadinghelping people trying to learn, ok?
« Last Edit: June 10, 2009, 02:28:42 AM by Ephialtes »

So if I was trying to find how many coins some client had in my database, how would I go about doing that? Btw, can I have a PHP example too?
« Last Edit: June 10, 2009, 10:00:36 PM by Pew446 »

Well, now how would I set up a MySQL or PHP web page, I have no idea how to design web pages. I don't really need to know.

Web page design:

<html>
<head>
<title>Title goes here</title>
</head>
<body>
Content here
</body>
</html>

PHP design:

<?php
Code here
?>

I don't know, might chip in an example.

Obviously I have it working perfectly :)

This is on my to do list.

When I get something working, I may publish it.

Well, now how would I set up a MySQL or PHP web page, I have no idea how to design web pages. I don't really need to know.

Yeah, don't look up PHP/HTML/MySQL tutorials or anything. Ask on the Blockland forums.

Yeah, don't look up PHP/HTML/MySQL tutorials or anything. Ask on the Blockland forums.

Lol.

Well, now how would I set up a MySQL or PHP web page, I have no idea how to design web pages. I don't really need to know.


It would be nice to know, but I don't need to know it.