Link to home
Start Free TrialLog in
Avatar of eduardo12fox
eduardo12foxFlag for Brazil

asked on

Doubt with angularJs with PHP

Hello guys,

I´m new in the world Angular and need make while in PHP but I´m receive error.

My php is:
$Conn = mysql_connect("127.0.0.1", "root", "");
$Db   = mysql_select_db("cdcol");

$sql = mysql_query("SELECT nome, Id FROM estudante ");
while ($row = mysql_fetch_assoc($sql)){

    $data[]=$row["nome"];
	
}

print json_encode($data);

Open in new window


An my html:

<table>
	<thead>
    	<tr>
        <th>Name</th>
        <th>Roll No</th>
        </tr>
    </thead>
    <tbody>
    	<tr ng-repeat="student in data track by $index"> 
                <td>{{student.nome}}</td>
                <td>{{student.id}}</td>
		</tr>
    </tbody>
</table>

Open in new window



I want get 2 fild from php:  nome and id  and show in html. I not can use Object I need learning with php Structured
ASKER CERTIFIED SOLUTION
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of eduardo12fox

ASKER

Thanks for help me!! Congratulation! Is done!
Thanks
You are welcome.