problem in getting the php variable

Discussion and feedback on Construct 2

Post » Thu Jun 14, 2012 1:55 am

How do I retrieve a variable? I saw some examples and I'm not getting.
I tried taking the variable $name, and also with the echo and I could not.
Displays only ERROR

PHP
<?php
if ($_GET['mode']=="load") {
$name = "anna";
//echo "ok";
}
?>


http://www.imagebam/image/11fcfb196130652paulaAnna2012-06-14 01:55:49
B
3
Posts: 10
Reputation: 295

Post » Thu Jun 14, 2012 2:01 pm

This forum isn't the best place to ask questions about PHP. You might want to find a beginner's tutorial, or ask on other programming-specific sites like StackOverflow.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Fri Jun 29, 2012 2:19 pm

I managed to get the variable normally.
Now, when I'm using the database it does not enter the error.
Can anyone help me?

PHP
if($_GET['mode']=="login") {
    $matricula = $_GET['matricula'];
    $resultado = pesquisarJogador($matricula);
    while ($linha = mysql_fetch_array($resultado)) {
           $nome = $linha['nome'];
           if(!empty(nome)){
               echo "ok";
           }
    }
}

CONSTRUCT
B
3
Posts: 10
Reputation: 295

Post » Fri Jun 29, 2012 3:20 pm

@paulaAnna, see my other post. It would be best to ask somewhere else.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 16 guests