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:

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!

图片转代码服务由CSDN问答提供 功能建议

我正在使用PHP和&amp ;;构建一个Web应用程序。 MySQL的。 用户配置文件使用选择查询显示MySQL数据,如下所示:

  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'

$ select_id 变量是使用URL中的?id = 定义的,如下所示:
http://localhost/public_html/profile/profile.php?id = 1 < / code>

我也在考虑将Web应用程序变成手机应用程序。 我没有太多创建原生应用程序的经验,因为我更像是一名网页设计师。 我之前使用过Adobe PhoneGap(作弊有点,我知道)。

我的问题:有没有办法在Adobe PhoneGap应用程序中使用与我在PHP中的爆炸URL类似的方法显示用户配置文件?
例如:我的PhoneGap应用程序主页上会有一个搜索栏 屏幕,用户可以在其中搜索用户名。 当他们点击搜索按钮时,他们将被重定向到配置文件视图(类似于我网站上的 profile.php 页面)。 然后,PhoneGap配置文件页面将显示相应用户的SQL数据。

我不确定这是否可行,但如果是,请告诉我怎么做 它?

另外 - 我如何在我的本地应用程序上显示服务器端存储的数据?

我对所有人都很新 这个 - 我18岁,自学了我的个人项目。 感谢所有帮助!

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

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)
    点赞 评论

相关推荐 更多相似问题