Heim  >  Artikel  >  Backend-Entwicklung  >  求帮忙,php+mysql解决办法

求帮忙,php+mysql解决办法

WBOY
WBOYOriginal
2016-06-13 10:11:22867Durchsuche

求帮忙,php+mysql

PHP code
<!--Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--><?php $con = mysql_connect(SAE_MYSQL_HOST_M.':'.SAE_MYSQL_PORT,SAE_MYSQL_USER,SAE_MYSQL_PASS);mysql_select_db("app_zqstudysae", $con);$sql = "insert into imgstore values('for','测试')";mysql_query($sql,$con);?>



imgstore 表是这样子的.
imgname varchar(10000) utf8_general_ci 否 无  
introduce text utf8_general_ci 否 无


为什么只能插入名字for,introduce没有插入到数据库中?




------解决方案--------------------
insert into imgstore(imgname,introduce) values('for','测试')";
------解决方案--------------------
insert into imgstore(imgname,introduce) SELECT 'for','测试'
------解决方案--------------------
探讨
PHP code

$con = mysql_connect(SAE_MYSQL_HOST_M.':'.SAE_MYSQL_PORT,SAE_MYSQL_USER,SAE_MYSQL_PASS);
mysql_select_db("app_zqstudysae", $con);

$sql = "insert into imgstore values('for','测试')";
my……

------解决方案--------------------
mysql_query($sql,$con) or die(mysql_error());

如有错误,请贴出错误信息。
Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn