php如何根据格式写入数据库并读出来???
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><title>无标题文档</title></head><style>body{ margin:0px; padding:0px; font-size:12px;}input{ float:left; margin-right:5px; width:100px; height:18px; line-height:18px; border:1px solid #f00;}.form{ margin:50px auto 0px; width:600px; overflow:hidden;}.form div{ margin-bottom:10px; clear:both; overflow:hidden;}.btn{ width:50px; height:22px; text-align:center; line-height:22px;}</style><body><div class="form"><form id="form" name="form" action="" method="post" enctype="multipart/form-data"><div><input type="text" name="postdb[sku_name][1_50]" value="" /><input type="text" name="postdb[sku_sku][1_50]" value="" /><input type="text" name="postdb[sku_price][1_50]" value="" /><input type="text" name="postdb[sku_shopid][1_50]" value="" /><input type="text" name="postdb[sku_storage][1_50]" value="" /></div><div><input type="text" name="postdb[sku_name][1_55]" value="" /><input type="text" name="postdb[sku_sku][1_55]" value="" /><input type="text" name="postdb[sku_price][1_55]" value="" /><input type="text" name="postdb[sku_shopid][1_55]" value="" /><input type="text" name="postdb[sku_storage][1_55]" value="" /></div><div><input type="text" name="postdb[sku_name][7_60]" value="" /><input type="text" name="postdb[sku_sku][7_60]" value="" /><input type="text" name="postdb[sku_price][7_60]" value="" /><input type="text" name="postdb[sku_shopid][7_60]" value="" /><input type="text" name="postdb[sku_storage][7_60]" value="" /></div><div><input type="text" name="postdb[sku_name][7_65]" value="" /><input type="text" name="postdb[sku_sku][7_65]" value="" /><input type="text" name="postdb[sku_price][7_65]" value="" /><input type="text" name="postdb[sku_shopid][7_65]" value="" /><input type="text" name="postdb[sku_storage][7_65]" value="" /></div><input type="submit" name="submit" class="btn" value="提交" /></form></div>当:postdb[sku_name][1_50]=黑色 postdb[sku_sku][1_50]=M postdb[sku_price][1_50]=100 postdb[sku_shopid][1_50]=1000 postdb[sku_storage][1_50]=mj1 postdb[sku_name][1_55]=黄色 postdb[sku_sku][1_55]=X postdb[sku_price][1_55]=77 postdb[sku_shopid][1_55]=1000 postdb[sku_storage][1_55]=mj2postdb[sku_name][7_60]=绿色 postdb[sku_sku][7_60]=L postdb[sku_price][7_60]=55 postdb[sku_shopid][7_60]=1000 postdb[sku_storage][7_60]=mj3 postdb[sku_name][7_65]=红色 postdb[sku_sku][7_65]=S postdb[sku_price][7_65]=90 postdb[sku_shopid][7_65]=1000 postdb[sku_storage][7_65]=mj4时,在php文件中如何写入数据库 shopinfo 字段里 格式是这样的,(目前我只提取4条做为参考,但是可能有N条!)黑色/M/100/1000/mj1/@@@ 黄色/X/77/1000/mj2/@@@ 绿色/L/55/1000/mj3/@@@ 红色/S/90/1000/mj4/@@@然后在前台调出数据时又怎么分别调出来,比如: $rs[name] =黑色 $rs[sku] =M $rs[price] =100 $rs[shopid] =1000 $rs[storage] =mj1$rs[name] =黄色 $rs[sku] =X $rs[price] =77 $rs[shopid] =1000 $rs[storage] =mj2$rs[name] =绿色 $rs[sku] =L $rs[price] =66 $rs[shopid] =1000 $rs[storage] =mj3$rs[name] =红色 $rs[sku] =S $rs[price] =90 $rs[shopid] =1000 $rs[storage] =mj4 我写的只有4条,但是不只是这4条,可能有N条</body></html>
foreach($_POST['postdb']['sku_name'] as $k=>$v){ $arr[$v][]='/'.$_POST['postdb']['sku_sku'][$k].'/'.$_POST['postdb']['sku_price'][$k].'/'.$_POST['postdb']['sku_shopid'][$k].'/'.$_POST['postdb']['sku_storage'][$k].'/';}foreach($arr as $k=>$v){ $t[]=$k.'@@@'.implode('@@@',$v);}echo join('###',$t);