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)
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥100 房产抖音小程序苹果搜不到安卓可以付费悬赏
  • ¥15 STM32串口接收问题
  • ¥15 腾讯IOA系统怎么在文件夹里修改办公网络的连接
  • ¥15 filenotfounderror:文件是存在的,权限也给了,但还一直报错
  • ¥15 MATLAB和mosek的求解问题
  • ¥20 修改中兴光猫sn的时候提示失败
  • ¥15 java大作业爬取网页
  • ¥15 怎么获取欧易的btc永续合约和交割合约的5m级的历史数据用来回测套利策略?
  • ¥15 有没有办法利用libusb读取usb设备数据
  • ¥15 为什么openeluer里面按不了python3呢?