network.request problem

I have the following network.request( “http://80.5.54.130/http3/unit2.php?a=6”, “GET”, getUser )

The direct link works fine.
The link querys a table and brings back a username.

I use:

local function getUser( event )
if ( event.isError ) then
print( “Network error!”)
else
myData = (event.response)
makeText.text = (event.response)
– print (“returned was”…event.response)
end
return true
end

When I use this in Coronas I get the error:
WARNING: Attempting to set property(text) with nil.

MakeText is null.???
Any ideas what is wrong please
Cheers
SteveW [import]uid: 4585 topic_id: 11686 reply_id: 311686[/import]

I changed the request to :

network.request( “http://80.5.54.130/http3/test123.txt”, “GET”, getUser )

and I get the text returned.

I have noticed in the terminal window I am getting the correct result but also a load of html. How do I strip out and leave just the text I need. (ie the name) [import]uid: 4585 topic_id: 11686 reply_id: 42495[/import]

I have been searching and the examples are using json.

I have changed the php file to :
function Page2Create($sender, $params)
{
$a=$_GET[‘a’];

$query = "SELECT * FROM USER WHERE ITEM = ". $a;

$result = mysql_query($query) or die(mysql_error());
while($row = mysql_fetch_array($result))
{

$PCNCount = $row[‘User’];
}

echo json_encode($PCNCount);
}

I have added the json.lua to my project.

When I use :

more= Json.decode(event.response)

print(more)

I get the error:

ERROR: loadstring() is not available in Corona
Runtime error
…Fo0yPAop-OlhRU+++TI/-Tmp-/TemporaryItems/30/json.lua:389: attempt to call a nil value
stack traceback:
[C]: ?
…Fo0yPAop-OlhRU+++TI/-Tmp-/TemporaryItems/30/json.lua:389: in function <…fo0ypaop-olhru>
(tail call): ?
(tail call): ?
…Fo0yPAop-OlhRU+++TI/-Tmp-/TemporaryItems/30/json.lua:513: in function ‘decode’
…Fo0yPAop-OlhRU+++TI/-Tmp-/TemporaryItems/30/main.lua:29: in function <…fo0ypaop-olhru> [import]uid: 4585 topic_id: 11686 reply_id: 42497[/import] </…fo0ypaop-olhru></…fo0ypaop-olhru>

After many hours of searching I had the wrong json file…

dkjson.lua http://www-users.rwth-aachen.de/David.Kolf/json-lua

I switched to this and I get the correct result.

All very confusing
[import]uid: 4585 topic_id: 11686 reply_id: 42499[/import]