dongxiqian2787 2016-07-26 10:27
浏览 56
已采纳

在PhoneGap应用程序上显示SQL数据 - 可能使用URL?

I'm building a web application using PHP & MySQL. A user profile displays MySQL data using a select query like so:

SELECT a.name_first,a.name_last,b.bio_category,b.bio_short,b.bio_full,b.profile_img
FROM stars_login a, stars_data_bio b
WHERE a.id_s=b.id_s
AND a.id_s='$select_id'

The $select_id variable is defined using ?id= in the URL like so:
http://localhost/public_html/profile/profile.php?id=1

I'm also looking at turning the web application into a phone app. I don't have much experience creating native apps as I'm more of a web designer. I have however used Adobe PhoneGap before (cheating kinda, I know).

My question: is there a way to display a user profile in an Adobe PhoneGap app using a similar method to my exploded URLs in PHP?
Eg: there will be a search bar on my PhoneGap App home screen, where a user can search for a username. When they hit the search button they will be redirected to the profile view (similar to the profile.php page on my website). The PhoneGap profile page will then show the SQL data for the corresponding user.

I'm not sure if this is possible, but if it is, could you let me know how to go about it?

Also - how would I display the data that is stored server side on my local app?

I'm fairly new to all of this - I'm 18 and self teaching for a personal project of mine. All help is appreciated!

  • 写回答

1条回答 默认 最新

  • dongwai4434 2016-07-26 10:33
    关注

    You can do this in your Hybrid app:

    1. Create an HTML form which will serve as the front end to user
    2. Use AJAX to send input from the user to your server
    3. Process whatever pass parameter/s in that ajax request (such as the query you mentioned).
    4. Return the result as json/jsonp then display the result back to the front end (no.1)
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 调用函数时,无关变量的改变引起函数值的改变
  • ¥15 xy坐标转化为经纬度坐标
  • ¥15 一般三角模糊数的上界值和下届值取中值的多少比较合理?
  • ¥15 关于#python#的问题,请各位专家解答!
  • ¥20 Hbase启动失败,无法启动HMaster
  • ¥15 sqpingboot在父模块已经引入了mybatisplus 在子组件不写版本号还是报错
  • ¥20 Lumerical FDTD solutions 中模型的相对阻抗,有效介电常数和有效磁导率的实部和虚部的数据如何获得?
  • ¥100 sql reporting service 远程smtp服务器配置支持
  • ¥15 ppyoloe_r带角度目标检测,loss_cls没法收敛
  • ¥15 淘宝交易指数如何解读,其关联的数据指标是什么