mysql - What is wrong with this php code? LEFT OUTER JOIN -
i have table users ("usuarios") , table friends ("amigos"), wanna friends of user id, don't receive error can't see results...
<?php $host = 'localhost'; $username = 'root'; $pwd = ''; $db = "lyne"; $con = mysqli_connect($host,$username,$pwd,$db) or die('unable connect'); if(mysqli_connect_error($con)) { echo "failed connect database ".mysqli_connect_error(); } $id = $_get['prefid']; $sql = "select a.*, u.nome amigos left outer join usuarios u on(u.usu_id = a.usuario_dois) usuario_um ='$id'"; $result = mysqli_query($con,$sql); if($result) { while($row=mysqli_fetch_array($result)) { $data[]=$row; } print(json_encode($data)); } mysqli_close($con); ?>
i receive blank screen (i'm testing get, post when done) sorry bad eng
solved, problem not code. in users list have people accents in names, "andré", , when user friend of 1 of these people, dont work, dont know why. that's it.
Comments
Post a Comment