English 中文(简体)
装有动态信息/自动填充文本箱的卡片盒
原标题:SQL text boxes with dynamic information / auto fill text boxes

我正试图制作一个网页,把我数据库和信使信息从一张桌上连接起来,并将其放在一个文本箱中。 它收集的信息取决于进入另一箱案文的内容。 基本上来说,它是一个信息“待填”。 我很想知道这是否可行。

这里要更好地了解的是案文箱的布局:

<html>
<head>
<?php
$con = mssql_connect("abc", "123", "password");
if (!$con)
  {
  die( Could not connect:   . mssql_get_last_message());
  }

mssql_select_db("db1", $con);

$result = mssql_query("SELECT * FROM FormData");
<head>

<title>test</title>

</head>

<body>
    <h1>test</h1>

    <form action="#">

        <p>Enter ID</p>

        <input type="text" name="ID"/> 
        <input type="text" name="NAME"/> 
        <input type="text" name="LASTNAME"/> 
        <input type ="button" value="submit" onclick="check(ID)" />



    </form>
</body>

Here an ID would be entered into a text box and then once the submit button was pressed, it would fetch the rest of the information from my sql database into the next boxes. I don t even know whether this is possible, whether I can use Javascript in conjunction with this or something. I searched but couldn t find much help on the subject.

我甚至不敢肯定,如果我试图以500克马克的错误结束,因为不适当的辛迪加,我会做“如果”发言。

最佳回答

如果我正确理解你的话,你们都需要在提交表格时记录他们输入的身份证。

If the ID has not been submitted yet (either their first time hitting the page, or they failed to enter an ID) you should not perform any query and create a blank $row array like so:

$row = array("ID" => "", "NAME" => "", "LASTNAME" => "");

然后,你应利用这一阵列填表:<input category=“text” name=“NAME” Value=“<?php呼应新款;?>”/>

如果该身份证已经提交,请在您的问询中使用该IDQ。 数据WHERE ID =_$_POST[ ID]”(说明:这是一个例子。 你们需要从POST数据中逃脱,以防KQ注射。

You need to then pull this result into your $row array $row = mysql_fetch_row($result) which in turn is used by your fields to populate the value.

整个程序可以与日本宇宙航空研究开发机构一起完成,这样你就不必在你的榜样基础上提交完整一页的文件。

问题回答

暂无回答




相关问题
SQL SubQuery getting particular column

I noticed that there were some threads with similar questions, and I did look through them but did not really get a convincing answer. Here s my question: The subquery below returns a Table with 3 ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

php return a specific row from query

Is it possible in php to return a specific row of data from a mysql query? None of the fetch statements that I ve found return a 2 dimensional array to access specific rows. I want to be able to ...

Character Encodings in PHP and MySQL

Our website was developed with a meta tag set to... <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> This works fine for M-dashes and special quotes, etc. However, I ...

Pagination Strategies for Complex (slow) Datasets

What are some of the strategies being used for pagination of data sets that involve complex queries? count(*) takes ~1.5 sec so we don t want to hit the DB for every page view. Currently there are ~...

Averaging a total in mySQL

My table looks like person_id | car_id | miles ------------------------------ 1 | 1 | 100 1 | 2 | 200 2 | 3 | 1000 2 | 4 | 500 I need to ...

热门标签