2011-05-08 58 views
-2

如何用相应的数据填充多个文本输入字段,只执行一次php-mysql查询脚本? 例如jquery php json示例

<form name="video" action="mysql.php" method="post" enctype="multipart/form-data" target="videofrm"> 
       <p> 
        <label for="url">url/gallery:</label><input class="text" type="text" id="url" name="url"/> 
        <input id="favorite" class="text" type="checkbox" name="favorite" value="true"/> 
        <label for="favorite" class="noneFloat">favorite</label> 
       </p> 
       <p> 
        <input id="thumb" type="file" name="thumb"/> 
       </p> 
       <p> 
        <label for="title">title:</label><input class="text" type="text" id="title" name="title"/> 
       </p> 
       <p> 
        <label for="desc">description:</label><input class="text" type="text" id="desc" name="description"/> 
       </p> 
       <p> 
        <label for="country">country:</label><input class="text" type="text" id="country" name="country"/> 
       </p> 
       <p> 
        <label for="categories">categories:</label><input class="text" type="text" id="categories" name="category"/> 
       </p> 
       <input type="button" value="fetch" id="fetch"/> 
       <input type="reset" value="clear"/> 
      </form> 

我需要填充与输入文本字段:

select url,title,desc,country,category 
from video where url='something'; 

首先,我需要知道如何使返回JSON数据类型写这种PHP脚本,事后如何填充文本输入字段,使用jQuery,并返回数据。

`非常感谢

+0

这需要大量的澄清才能负责。你问如何填充数据库值的文本输入? – 2011-05-08 12:11:15

+0

什么部分不清楚给你?它说php-mysql查询脚本,这当然不是来自我的日记伙计。当然这是一个有问题的数据库。 – 2011-05-08 12:17:14

+0

你知道任何PHP或JavaScript吗?如果没有,阅读一些教程将是一个好的开始。我们不会只为你做你的工作...... – 2011-05-08 12:46:49

回答

3

你提的问题是非常广泛的,看起来有点像“请写出我的代码”请求(虽然它不一定是一个)。尽量避免这种印象,并提及你已经尝试/研究的内容,以避免投降。

一些指针:

+0

非常感谢。这就是我需要的一切,快速的方向。毕竟,我们都是不同的,有自己的表达方式。因为我们正在编写应用程序来处理这种复杂的判断,所以我们不应该忘记将它集成到我们自己的想法中。 – 2011-05-08 13:07:52