我的网站上有两张桌子。 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(
更多推荐
从一个表中选择并使用选择标记表单将其插入另一个表中
发布评论