error in php coding
Posted: Thu Jun 12, 2014 3:44 am
I am having prob in the 'employee'=>$posts. It is crashing my iphone application. I want to convert 'employee'=>$posts to a string and then pass an if else condition for an input to be true or false according to above coding. How should i do it?
Code: Select all
if(mysql_num_rows($selectemployee))
{
while($post = mysql_fetch_assoc($selectemployee))
{
$posts[] = $post;
}
header('Content-type: application/json');
echo stripslashes(json_encode(array('employee'=>$posts)));
}
else
{
header('Content-type: application/json');
echo stripslashes(json_encode(array('employee'=>'No record')));