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

报告相同问题?

悬赏问题

  • ¥50 三种调度算法报错 有实例
  • ¥15 关于#python#的问题,请各位专家解答!
  • ¥200 询问:python实现大地主题正反算的程序设计,有偿
  • ¥15 smptlib使用465端口发送邮件失败
  • ¥200 总是报错,能帮助用python实现程序实现高斯正反算吗?有偿
  • ¥15 对于squad数据集的基于bert模型的微调
  • ¥15 为什么我运行这个网络会出现以下报错?CRNN神经网络
  • ¥20 steam下载游戏占用内存
  • ¥15 CST保存项目时失败
  • ¥20 java在应用程序里获取不到扬声器设备