无法在php中保存表中的记录 [英] Unable to save record in table in php

查看:55
本文介绍了无法在php中保存表中的记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将记录保存在表格中,但无法这样做。保存/更新进度表中的记录后,当我从组合框中选择负责人并单击通知时,它会假设将Responsible person和Progressid保存在improvement_plan表中。目前在improvement_plan表中没有保存记录。请提出建议。非常感谢。



< html>

< head>

< script>

$(function(){

$(#tabs)。tabs();

});

< / script>

< / head>

< body>

Hi, am trying to save record in table but unable to do so. After saving/updating record in progress table, and when i select the Responsible person from the combobox and click Notify, it suppose to save Responsible person and Progressid in improvement_plan table. Currently no record is being save in improvement_plan table. Please kindly advise. Thanks a lot.

<html>
<head>
<script>
$(function() {
$( "#tabs" ).tabs();
});
</script>
</head>
<body>



第二部分:



session_start();

error_reporting(E_ALL ^ E_NOTICE);

$ _SESSION ['Userid']; //它将打印用户标识值

$ _SESSION ['Username']; //它将打印用户标识值

$ _SESSION ['Usersecurity']; //它将打印用户标识值



$ connection = mysql_connect(localhost,user,)或死掉(数据库连接失败!
);

$ result = mysql_select_db(pqa)或死亡(数据库无法选择!);

$ Picid = 0;

if(isset($ _ GET ['Picid'])){

$ _SESSION ['Picid'] = $ _ GET ['Picid'];

$ Picid = $ _ SESSION ['Picid'];



$ query =选择Userid,Position,Year,Kra,Kpi,Measure,Target,来自general_ipd的Picid,其中Userid ='。$ _ SESSION ['Userid' ]。'和Picid ='。$ Picid。';

$ result = mysql_query($ query)或die(mysql_error());

if ($ row = mysql_fetch_array($ result))

{

echo< input type ='hidden'name ='hidden'value ='。$ row [ 'Userid']。'>
;

echo< input type ='hidden'name ='hidden'value ='。$ row ['Position']。 '>
;

echoYear:< input type ='text'name ='Year'value ='。$ row ['Year']。'readonly> ;
;

echoKRA:< input type ='text'name ='KRA'value ='。$ row ['Kra']。'readonly>
;

echoKPI:< input type ='text'name ='KPI'value ='。$ row ['Kpi']。'readonly>
;

echo测量:<输入类型='文字'名称='测量'值='。$ row ['Measure']。'readonly>;

echoT arget:< input type ='text'name ='Target'value ='。$ row ['Target']。'readonly>
;

echo< input type ='hidden'name ='hidden'value ='。$ Picid。'>
;

$ _SESSION ['Year'] = $ row ['Year'] ;

$ _SESSION ['Kra'] = $ row ['Kra'];

$ _SESSION ['Kpi'] = $ row ['Kpi']; < br $>
$ _SESSION ['Measure'] = $ row ['Measure'];

$ _SESSION ['Target'] = $ row ['Target'];

}

}

?>






SECTION II:


session_start();
error_reporting(E_ALL ^ E_NOTICE);
$_SESSION['Userid']; // it will print the userid value
$_SESSION['Username']; // it will print the userid value
$_SESSION['Usersecurity']; // it will print the userid value

$connection = mysql_connect("localhost","user","") or die("Database connection failed!
");
$result=mysql_select_db("pqa") or die("Database could not be selected!");
$Picid=0;
if (isset($_GET['Picid'])) {
$_SESSION['Picid']=$_GET['Picid'];
$Picid=$_SESSION['Picid'];

$query="Select Userid,Position,Year,Kra,Kpi,Measure,Target,Picid from general_ipd where Userid='".$_SESSION['Userid']."' and Picid= '".$Picid."'";
$result=mysql_query($query)or die(mysql_error());
if($row=mysql_fetch_array($result))
{
echo "<input type='hidden' name='hidden' value='".$row['Userid']."'>
";
echo "<input type='hidden' name='hidden' value='".$row['Position']."'>
";
echo "Year:<input type='text' name='Year' value='".$row['Year']."'readonly>
";
echo "KRA:<input type='text' name='KRA' value='".$row['Kra']."'readonly>
";
echo "KPI:<input type='text' name='KPI' value='".$row['Kpi']."'readonly>
";
echo "Measure:<input type='text' name='Measure' value='".$row['Measure']."'readonly>";
echo "Target:<input type='text' name='Target' value='".$row['Target']."'readonly>
";
echo "<input type='hidden' name='hidden' value='".$Picid."'>
";
$_SESSION['Year']=$row['Year'];
$_SESSION['Kra']=$row['Kra'];
$_SESSION['Kpi']=$row['Kpi'];
$_SESSION['Measure']=$row['Measure'];
$_SESSION['Target']=$row['Target'];
}
}
?>













1.Target






error_reporting(E_ALL ^ E_NOTICE);

$ conn = mysql_connect(localhost,user,);

mysql_select_db(p,$ conn);

if(isset( $ _POST ['update'])){



mysql_query(UPDATE progress set Quanprogress2 ='。$ _POST [Quanprogress2]。''
WHERE Picid ='。$ Picid。');

$ message =记录修改成功;

}

$ result = mysql_query(SELECT * FROM progress WHERE Picid ='。$ Picid。');

$ row = mysql_fetch_array($ result);

?>

1.Target

3。改进计划

团队负责人:< input type =textname =Positionvalue =>

Team Leader:<input type="text" name="Position" value="" >

Tiada数据。

Tiada data.



< input type =hiddenname =Picid>


<input type="hidden" name="Picid">





< / body>




< input type =submitname =submitvalue =Submitclass =btnSubmit>


< input type =submitname =updatevalue =Updateclass =btnSubmit>


< / form>< / html>



</body>


<input type="submit" name="submit" value="Submit" class="btnSubmit">

<input type="submit" name="update" value="Update" class="btnSubmit">

</form></html>

推荐答案

(function() {
(function() {


(#tabs)。tabs();

});

< / script> ;

< / head>

< body>

( "#tabs" ).tabs();
});
</script>
</head>
<body>


第二部分:



session_start();

error_reporting(E_ALL ^ E_NOTICE);

SECTION II:


session_start();
error_reporting(E_ALL ^ E_NOTICE);


_SESSION ['Userid']; //它将打印用户id值
_SESSION['Userid']; // it will print the userid value


这篇关于无法在php中保存表中的记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆