在mysql中插入数据 [英] inserting data in mysql

查看:86
本文介绍了在mysql中插入数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在制作一个名为在线录取的网站,

bt是否可以插入数据代码中没有错误bt不知道whtsa goig on with my code。

here是我的代码PLZ帮帮我





连接代码写在if条件上方的同一个文件中!!



 if(isset($ _ POST [ 提交]))
{
$ clgnm = $ _ POST [' clgnm ];
$ clgaddr = $ _ POST [' clgaddr'];
$ cid = $ _ POST [' cid'];
$ sid = $ _ POST [' sid'];
$ seat = $ _ POST [' seat'];

$ sql = 插入大学(ClgName,ClgAddrs,CourseId,SeatId,Seats)价值
('$ clgnm','$ clgaddr',$ cid,$ sid,$ seat)
;

echo $ sql ;
$ result = mysql_query($ sql);
die(mysql_error());
echo $ result ;
echo inserted ;


}

解决方案

_POST [ 提交]))
{


clgnm =


< blockquote> _POST [' clgnm'];


i m making one webiste named online admission,
bt am uable to insert data there is no error in code bt dont know whtsa goig on with my code.
here is my code plz help me out


connection code is written in same file above the if condition !!

if(isset($_POST["submit"]))
{
$clgnm=$_POST['clgnm'];
$clgaddr=$_POST['clgaddr'];
$cid=$_POST['cid'];
$sid=$_POST['sid'];
$seat=$_POST['seat'];

$sql="Insert into college(ClgName,ClgAddrs,CourseId,SeatId,Seats) values
('$clgnm','$clgaddr',$cid,$sid,$seat)";

echo $sql;
$result=mysql_query($sql);
or die(mysql_error());
echo $result;
echo "inserted ";


}

解决方案

_POST["submit"])) {


clgnm=


_POST['clgnm'];


这篇关于在mysql中插入数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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