Ok I have a problem, in my table i list topics like this :
This And that
One and Two
Hello and good bye
Now those are populated in a drop down box with this code :
<?
$sql="SELECT categoryb FROM categoryb ORDER by categoryb ASC";
$result=mysql_query($sql);
$options="";
while ($row=mysql_fetch_array($result)) {
//$id=$row["id"];
$categoryb=$row["categoryb"];
$selected = ($categoryb == $_GET['categoryb']) ? ' selected="selected"' : '';
$options.="<OPTION VALUE=\"$categoryb\">".$categoryb;
}
?>
<SELECT NAME=subcat>
<OPTION VALUE=0>Choose
<?=$options?>
</SELECT>
Now when i chose on of those subcat, the subcat has white spaces in it, and I want to add into the database
between each word.
Example : This And That
Example 2 : One And Two
I am not putting in the like i want it too
Now I tried these right before the insert but not working :
$subcat = str_replace ( ' ', ' ', $subcat );
$subcat = str_replace ( '', ' ', $subcat );
Even did this :
$num = ' ';
$subcat = "$subcat";
$subcat = ereg_replace('!\s+!', $num, $subcat);
Not having no luck at all.