I've recently gotten a PHP script i've written to return data back to my android java code, Unfortunately the script will only return data when I make a call to the first row of my table.
My Table is formatted as such:
1 Jared Jones
2 Karla Cross
3 Jasmine Smith
4 Vince Stevens
The numbers correspond to a UserId and the other 2 attributes are FName and LName.
My php script to execute the MySQL script is as follows:
<?php
mysql_connect("my database credentials go here");
mysql_select_db("a2275354_gtchose");
$sql=mysql_query("select FName,LName from Test where UserId ='".$_REQUEST['userId']."' ");
while($row=mysql_fetch_assoc($sql))
$output[]=$row;
print(json_encode($output));
mysql_close();
?>
I'm unsure why the only time i receive a result is when i pass 1 as the userId to the query. Any ideas?
Thanks