数据库的同一字段中的多个值

时间:2022-03-08 02:12:23

since i am building a shopping a website how can a store the same product with different sizes as i don't want to create multiple rows..

因为我正在建立一个网站购物,如何存储不同尺寸的相同产品,因为我不想创建多行..

Column Name Data Type   Nullable
DETAIL  VARCHAR2(4000)  Yes  -   -
BRAND   VARCHAR2(4000)  Yes  -   -
IMAGE   VARCHAR2(4000)  Yes  -   -
PRICE   NUMBER  Yes  -   -
CATEGORY    VARCHAR2(4000)  Yes  -   -
PRODUCT_ID  VARCHAR2(2000)  Yes  -   -
SEARCH_ID   VARCHAR2(4000)  Yes  -   -
CLOTH_SIZE  VARCHAR2(4000)  Yes  -   -

here i want multiple clothsize values for the same column

在这里,我想要同一列的多个clothsize值

1 个解决方案

#1


0  

$json = array();
while($row = mysql_fetch_array($result))     
 {
    $json[]= array(
     'IMAGE' => $row['IMAGE'],
     'PRICE' => $row['PRICE']
    );
}

$jsonstring = json_encode($json);
echo $jsonstring;

$jsonstring - add your data base this var.

$ jsonstring - 添加你的数据库这个var。

#1


0  

$json = array();
while($row = mysql_fetch_array($result))     
 {
    $json[]= array(
     'IMAGE' => $row['IMAGE'],
     'PRICE' => $row['PRICE']
    );
}

$jsonstring = json_encode($json);
echo $jsonstring;

$jsonstring - add your data base this var.

$ jsonstring - 添加你的数据库这个var。