Hi all,
I am storing check box values with comma separated into db like this , the code given below
<?php
include 'database.php';
$servicec = addslashes(serialize($a1));
$servicet = addslashes(serialize($b1));
$services = addslashes(serialize($c1));
$query1 = "insert into autoalto_contractor( service_category,service_type,services) values ('".$servicec."',
'".$servicet."','".$services."')";
but while retrieving from the db i am not able to display it properly the code is given below
<?php
session_start();
include('database.php');
$result = mysql_query("SELECT * FROM autoalto_contractor" );
while($row = mysql_fetch_array($result))
{
?>
<tr>
<td width="5%"></td>
<td><?echo $row['service_category'];?></td>
<td><?echo $row['service_type'];?></td>
<td><?echo $row['services'];?></td>
</tr>
<tr>
<td width="5%"></td>
<td colspan="4" style="background-repeat: repeat-x;" background="images/dot.jpg" height="0" width="300"></td>
</tr>
<?
}
mysql_close();
?>
its giving the o/p like this
a:3:{i:0;s:18:"vehicle Inspection";i:1;s:14:"batteryservice";i:2;s:10:"oil canhge}
i want only vehicle inspection , battery service like this...........can anybody help me pls...........i am trying this from long time.