不工作mysql_fetch_array也没有显示错误

getting could not connect Following given was my problem raising query section.i am under pressure totally confused.if anybody known solution please here update me .thanks
above included dp connection file also
my catcode variable like as SCA1005,SCB1001...

case childprdadd: $data = explode('~',$_GET['data']);

//hint:->value = categorie+'~'+childprd+'~'+childqty+'~'+childcolor+'~'+catcode

$category_name = $data[0];
$childprod_name = $data[1];
$child_qty = $data[2];
$child_color = $data[3];
$cat_code = $data[4];
//echo $category_name.'+'.$childprod_name.'+'.$child_qty.'+'.$child_color.'+'.$cat_code;
$split = str_split($cat_code);
$pos = $split[2];

switch($pos)
{
    case 'A':
$child1 = mysql_fetch_array(mysql_query("select * from goldsun_child1_subcategory where code = '".$cat_code."'"))or die('could not connect'.mysql_error());
$des1 = $child1['description'].'->'.$childprd_name;

mysql_query("insert into goldsun_child_product set cat_id = '".$child1['cat_id']."',sub_cat_id = '".$child1['id']."',name = '".$childprd_name."',qty = '".$childprd_qty."', description = '".$des1."',color_id = '".$child_color."',category_name = '".$category_name."',code = '".$cat_code."'");

break;

case 'B':
$child2 = mysql_fetch_array(mysql_query("select * from goldsun_child2_subcategory where code = '".$cat_code."'"));
$des2 = $child1['description'].'->'.$childprd_name;

mysql_query("insert into goldsun_child_product set cat_id = '".$child2['cat_id']."',sub_cat_id = '".$child2['sub_cat_id']."',child1_id = '".$child2['child1_id']."',name = '".$childprd_name."',qty = '".$childprd_qty."', description = '".$des2."',color_id = '".$child_color."',category_name = '".$category_name."',code = '".$cat_code."'");
break;

case 'C':
$child3 = mysql_fetch_array(mysql_query("select * from goldsun_child3_subcategory where code = '".$cat_code."'"));
$des3 = $child3['description'].'->'.$childprd_name;

mysql_query("insert into goldsun_child_product set cat_id = '".$child3['cat_id']."',sub_cat_id = '".$child3['sub_cat_id']."',child1_id = '".$child3['child1_id']."',child2_id = '".$child3['child2_id']."',name = '".$childprd_name."',qty = '".$childprd_qty."', description = '".$des3."',color_id = '".$child_color."',category_name = '".$category_name."',code = '".$cat_code."'");
break;

case 'D':
$child4 = mysql_fetch_array(mysql_query("select * from goldsun_child4_subcategory where code = '".$cat_code."'"));
$des4 = $child4['description'].'->'.$childprd_name;

mysql_query("insert into goldsun_child_product set cat_id = '".$child4['cat_id']."',sub_cat_id = '".$child4['sub_cat_id']."',child1_id = '".$child4['child1_id']."',child2_id = '".$child4['child2_id']."',child3_id = '".$child4['child3_id']."',name = '".$childprd_name."',qty = '".$childprd_qty."', description = '".$des4."',color_id = '".$child_color."',category_name = '".$category_name."',code = '".$cat_code."'");
break;

case 'E':
$child5 = mysql_fetch_array(mysql_query("select * from goldsun_child5_subcategory where code = '".$cat_code."'"));
$des5 = $child5['description'].'->'.$childprd_name;

mysql_query("insert into goldsun_child_product set cat_id = '".$child5['cat_id']."',sub_cat_id = '".$child5['sub_cat_id']."',child1_id = '".$child5['child1_id']."',child2_id = '".$child5['child2_id']."',child3_id = '".$child5['child3_id']."',child4_id = '".$child5['child4_id']."',name = '".$childprd_name."',qty = '".$childprd_qty."', description = '".$des5."',color_id = '".$child_color."',category_name = '".$category_name."',code = '".$cat_code."'");
break;

case 'T':
$cat = mysql_fetch_array(mysql_query("select * from goldsun_child_category where code = '".$cat_code."'"));
$cat_des = $cat['description'].'->'.$childprd_name;

mysql_query("insert into goldsun_child_product set cat_id = '".$cat_des['cat_id']."',name = '".$childprd_name."',qty = '".$childprd_qty."', description = '".$cat_des."',color_id = '".$child_color."',category_name = '".$category_name."',code = '".$cat_code."'");
break;

}
break;  

Are you using the new MySQL or the old MySQL? If you're using the old MySQL (which has been deprecated), check your "INSERT" command. If you're using the new MySQL (with PDO or MySQLi), try to learn it and use prepared statement.

If you're using the old version of MySQL, maybe you need:

<?php
$con = mysql_connect(server,username,password);
$bla = mysql_query($con,"INSERT into goldsun_child_product (cat_id, sub_cat_id, name, qty, blablabla) VALUES (".$child1['cat_id'].",".$child1['id'].",".$blablabla."");
$child = mysql_fetch_array($bla);
?>

If you're using the new version, try to learn MySQLi or PDO with prepared statement.