it's been a week that i'm working with a project with angularJS and all i want is to display data after submit the form .
i did this with php and mysql and could'nt show data from database .
php
$data = json_decode(file_get_contents("php://input"));
$subject = mysql_real_escape_string($data->subject);
$body = mysql_real_escape_string($data->body);
mysql_select_db("angular") or die(mysql_error());
mysql_query("INSERT INTO newstory (subject,body) VALUES ('$subject', '$body')");
Print "Your information has been successfully added to the database.";
$query = "SELECT * FROM newstory";
$result = mysql_query($query);
$arr = array();
while ($row = mysql_fetch_array($result)) {
$subject = $row['subject'];
$body = $row['body'];
$arr[] = $row;
}
$json_response = json_encode($arr);
echo $json_response;
Now i want to work with $resource and i got a question !!
Should i use this with mongoDb ?as i know mongo is a database like mysql !
can i use $resource with mysql ?
thx in advance