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 metadata提取的PDF元数据,如何转换为一个Excel
  • ¥15 关于arduino编程toCharArray()函数的使用
  • ¥100 vc++混合CEF采用CLR方式编译报错
  • ¥15 coze 的插件输入飞书多维表格 app_token 后一直显示错误,如何解决?
  • ¥15 vite+vue3+plyr播放本地public文件夹下视频无法加载
  • ¥15 c#逐行读取txt文本,但是每一行里面数据之间空格数量不同
  • ¥50 如何openEuler 22.03上安装配置drbd
  • ¥20 ING91680C BLE5.3 芯片怎么实现串口收发数据
  • ¥15 无线连接树莓派,无法执行update,如何解决?(相关搜索:软件下载)
  • ¥15 Windows11, backspace, enter, space键失灵