Android MySql Create and upload image to server with php

I need some help here to put image on an "AD" that user creates. I'm doing it with JSON, Android, PHP and MySql add_ad.php $_POST['ad_title'], ':price' => $_POST['ad_price'], ':category' => $_POST['ad_category'], ':description' => $_POST['ad_description'], ':email' => $_POST['ad_user'], ':mobile' => $_POST['ad_contact'] ); //execute query try { $stmt = $db->prepare($query); $result = $stmt->execute($query_params); } catch (PDOException $ex) { // For testing, you could use a die and message. //die("Failed to run query: " . $ex->getMessage()); //or just use this use this one: $response["success"] = 0; $response["message"] = "Erro base de dados. Impossível adicionar o anúncio."; die(json_encode($response)); } $response["success"] = 1; $response["message"] = "Anúncio criado com sucesso! Aguarde aprovação."; echo json_encode($response); } ?> I don't know how to transform this to receive the image from android and save it on the server/database, PLEASE ALSO tell me the type of the field on database. This is very important, after that I need to send image from my android to this .php and save it on that user. Thanks, please be aware that I'm new on android, so be brave :)

以上就是Android MySql Create and upload image to server with php的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JSON 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏