I have been working in unity for a little while now and I was fiddling about in Unity 2.6 Indie Free version at home.
I have the following script and php file:
PHPFunctions.js
#pragma strict
var gameGui : GameGui;
var nextHexSpawn : float = 0;
var hexCount : float = 0;
function getHexCount() : System.Collections.IEnumerable
{
var url : String = "http://www.online-behemoth.com/behemoth/gethexcount.php";
var countGet : WWW = new WWW(url);
yield countGet;
if(countGet.error)
{
gameGui.addErrorMessage(countGet.error);
}
else
{
hexCount = parseFloat(countGet.data);
Debug.Log(countGet.data);
}
}
header.php
<?php
/* Get config */
include ('config.php');
/* Connect to database */
require('databaseconnect.php');
?>
gethexcount.php
<?php
include('header.php');
$result = mysql_query("SELECT * FROM behemoth_hex");
echo mysql_num_rows($result);
?>
http://www.online-behemoth.com/behemoth/gethexcount.php
All I get is a Debug.Log output of 0. The result should be 7 however and works fine through firefox.
Is there something going wrong here or is it an issue with me using Indie 2.6 Free version? Is this a Pro-only feature?