从一个表中选择并使用选择标记表单将其插入另一个表中

编程入门 行业动态 更新时间:2024-10-28 20:17:19
本文介绍了从一个表中选择并使用选择标记表单将其插入另一个表中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我的网站上有两张桌子。 blog_cat和blog_post_seo我想从blog_cat中选择一个列(catTile)并将其数据插入到blog_post_seo表列(catTitle)中, 这是我尝试的 < select name =catTitle> $ catsql =SELECT catID,catTitle from blog_cats ORDER BY catTitle; $ catres = mysql_query($ catsql); while($ catrow = mysql_fetch_assoc($ catres)) { echo< option value ='。 $ catrow [ CATID]。 >中。 $ catrow ['catTitle']。 < / option>; } ?> < / select>

I have two tables in my site. blog_cat, and blog_post_seo I want to select from blog_cat a column (catTile) and insert it data into blog_post_seo table column (catTitle), this what i try <select name="catTitle"> $catsql = "SELECT catID, catTitle FROM blog_cats ORDER BY catTitle"; $catres = mysql_query($catsql); while($catrow= mysql_fetch_assoc($catres)) { echo "<option value='" . $catrow['catID']. "'>" . $catrow['catTitle'] . "</option>"; } ?> </select>

推荐答案

catsql =SELECT catID,catTitle FROM blog_cats ORDER BY catTitle; catsql = "SELECT catID, catTitle FROM blog_cats ORDER BY catTitle";

catres = mysql_query( catres = mysql_query(

catsql); while( catsql); while(

更多推荐

从一个表中选择并使用选择标记表单将其插入另一个表中

本文发布于:2023-08-05 20:39:05,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1307938.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:将其   表单   标记

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!