This is not quite the same as the other dupes!
I have a web service that grabs data based on a token passed in
$query = "SELECT * FROM Journey WHERE Token='{$token}';";
$result = mysql_query($query,$link) or die('Errant query: '.$query);
$posts = array();
$dto = new Journey();
$dta = new Dta();
if(mysql_num_rows($result) > 0) {
while($post = mysql_fetch_assoc($result)) {
$posts[] = $post;
$posts = array_shift($posts);
When I run the service and pass in a valid token, I get the fatal error at $posts[] = $post
From what I can see (and have read), this looks to be the right way to do this (and indeed, I have it in my other web services and it works there)
Using PHP 5.6.3