gpt4 book ai didi

php - 如何显示记录插入成功?

转载 作者:行者123 更新时间:2023-11-29 12:04:27 24 4
gpt4 key购买 nike

<?php
$id=$_SESSION['id'];
//$date1=date("Y-m-d");
//echo $date1;
$work=$_POST['postinput0'];
//echo $work;
$project_name=$_POST['postinput1'];
$skills=$_POST['postinput2'];
$description=$_POST['postinput3'];
$file1=$_POST['file1'];
$budget=$_POST['postinput4'];
//$radio=$_POST['radio'];
$sql = "INSERT INTO Job_post
(u_id,job_category,project_name,job_sub_category,project_description,image,budget)
VALUES('$id','$work','$project_name','$skills', '$description','$file1','$budget')";
if(mysql_query( $sql, $conn ))
{
echo "successfully";
}
else
{
echo "not successfully inserted";
}




?>

在提交按钮之前显示消息。我不想要>请帮助我。

提交按钮后显示消息......我的代码中有任何错误

最佳答案

<?php
if(isset($_POST['submit']))
{
$id=$_SESSION['id'];
//$date1=date("Y-m-d");
//echo $date1;
$work=$_POST['postinput0'];
//echo $work;
$project_name=$_POST['postinput1'];
$skills=$_POST['postinput2'];
$description=$_POST['postinput3'];
$file1=$_POST['file1'];
$budget=$_POST['postinput4'];
//$radio=$_POST['radio'];
$sql = "INSERT INTO Job_post (u_id,job_category,project_name,job_sub_category,project_description,image,budget) VALUES('$id','$work','$project_name','$skills', '$description','$file1','$budget')";
$query = mysql_query( $sql, $conn );
if(isset($query))
{
echo "successfully";
}
else
{
echo "not successfully inserted";
}
}
?>

关于php - 如何显示记录插入成功?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31781006/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com