in the $admission_id few numbers are available as array,i got those array numbers one by one by using explode function.after that i put those numbers one by one to a query using for loop.that i wanted to know the way i put into a query is correct. specially the variable which i mansion in red color

$admission_no = explode("~",$admission_id);

        for ($i=0;$i<=$x;$i++)
        {
            $query = "select amount_id from payment where admission_no='".[COLOR="Red"]$admission_no[$i][/COLOR]."'";
            $result1=mysql_query($query1);
for ($i=0;$i<=$x;$i++)
 {
	$query = mysql_query("select amount_id from payment where admission_no='$admission_no[$i]'") or die (mysql_error());
 }

You do not need to concatenate the query/variable. Just put single quotes around the variable you're inputting

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.