Re: Mysql Query Help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



<?php
	$pkg_id1= $_POST["pkg_id"];
	echo $cp_id= $_POST["cp_id"];
	$id_total =count($pkg_id1);
	$search_string=@$_POST['search_string'];
	
$i = 0; 
     	while ($i < $id_total)
       	{
		$txt_pkg= "pgk_dis_".$pkg_id1[$i];
		$txt_pkg= $_POST[$txt_pkg];
		
		if($txt_pkg==''|| $txt_pkg=='0')
		{
			next;	
		}
		else
		{
		
		//echo"<br>select pkg_status from pkg_master where
pkg_id='$pkg_id1[$i]'";
		$query_status = pg_exec($db,"select pkg_status from
pkg_master where pkg_id='$pkg_id1[$i]'");
		if(pg_result($query_status,0,"pkg_status")=='1')
		{
			next;
		}
		else
		{

			
			####################### Updating the
pkg_cp_discount table #####################
		//	echo"<br>select cp_id, pkg_id from
pkg_cp_discount where cp_id= '$cp_id'and pkg_id=
'$pkg_id1[$i]'";

			$query_count = pg_exec($db,"select cp_id, pkg_id
from pkg_cp_discount where cp_id= '$cp_id'and pkg_id=
'$pkg_id1[$i]'");
			$total_count = pg_numrows($query_count);

			if($total_count =='0')
			{
		//		echo "<br>insert into pkg_cp_discount
(pkg_price,cp_id, pkg_id) values('$txt_pkg',
'$cp_id','$pkg_id1[$i]')";
				$query = pg_exec($db,"insert into pkg_cp_discount
(pkg_price,cp_id, pkg_id) values('$txt_pkg',
'$cp_id','$pkg_id1[$i]')");
			}
			else
			{
		//		echo "<br>update pkg_cp_discount set
pkg_price='$txt_pkg', cp_id='$cp_id' where
pkg_id='$pkg_id1[$i]'";	
				$query_update = pg_exec($db,"update
pkg_cp_discount set pkg_price='$txt_pkg',
cp_id='$cp_id' where pkg_id='$pkg_id1[$i]'");
			}
		}
		}

		$i++;
		
	}


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


------------------------ Yahoo! Groups Sponsor --------------------~--> 
<font face=arial size=-1><a href="http://us.ard.yahoo.com/SIG=12hmci67k/M=362335.6886445.7839731.1510227/D=groups/S=1705006764:TM/Y=YAHOO/EXP=1124958074/A=2894361/R=0/SIG=13jmebhbo/*http://www.networkforgood.org/topics/education/digitaldivide/?source=YAHOO&cmpgn=GRP&RTP=http://groups.yahoo.com/";>In low income neighborhoods, 84% do not own computers. At Network for Good, help bridge the Digital Divide!</a>.</font>
--------------------------------------------------------------------~-> 

PHP Data object relational mapping generator - http://www.meta-language.net/ 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php-objects/

<*> To unsubscribe from this group, send an email to:
    php-objects-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 




[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux