douzi2778 2018-05-25 15:43
浏览 54

创建交互式数据表以从MySQLi数据库中提取数据[关闭]

Not really a coding problem just a pointer in the right direction would be amazing (please be patient with me, i'm still new to coding and this may seem like a really obvious answer to some).

I know that I need to learn how to use JQuery and AJAX to display data, however nearly all tutorials I've seen online don't interact with a MySQL database. Instead the tutor is interacting with a XML data sheet with all their data in it. Of course looking at JavaScript with fresh eyes has really confused me on what i need to focus to learn next. I know JQuery is used to present data and AJAX is used to interact with data. So do I need to convert database results, acquired in PHP, into XML documents to then be manipulated through AJAX and Jquery?

I want to know this because i'm trying to create a reactive drop down list for a PC-part picker. i.e. Selecting a CPU from a drop down list, then once the CPU is selected, when it comes to selecting a motherboard, a database query is used to find motherboards compatible with that CPU for example.... So far all of my data on CPU's, Motherboards and GPU's are all in my MySQL database hence why i'm asking this question.

Again any help to point me in the right direction would be fantastic and greatly appreciated.

  • 写回答

1条回答 默认 最新

  • duandang2123 2018-05-25 16:06
    关注

    I believe you need some clarification, from the front end (javascript, jQuery Ajax, etc...) you don't interact with the DataBase directly, you use server-side scripts, could be PHP, JavaScript, Java, C++, or any language on the server side, with it you query the database... from the front end you call this scripts and receive from them a response that you display, this response is returned in different formats that you decide when codding the server side script or that you could get from the documantation of an API if is the case.

    [front end]--Request-->[server]
         [server script]--Query-->[DataBase]
         [server script]<--Response--[DataBase]
    [front end]<--Response--[server]
    

    The response could be XML, string, an object, json, even HTML code, that is up to the server side script, whatever you code in it!

    This also may help Ajax

    Hope this help you get started.

    评论

报告相同问题?

悬赏问题

  • ¥15 目详情-五一模拟赛详情页
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 unity第一人称射击小游戏,有demo,在原脚本的基础上进行修改以达到要求
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?
  • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b