0

hey i am trying to execute a query statement here is my code below

$sel="SELECT course_name,course_code FROM courses WHERE course_name='$diff'";
					
					if ($result2=mysql_query($sel))
						{echo"nice";
					   }
					   else
					   {
					   echo "shit";
					   }
					while ($row2 = mysql_fetch_row($result2))
				{ 
					echo"row[0] : row[1] <br>";
					}

please note that the $diff variable is an array
while there is a result cause is shows nice on the screen i am just getting nothing in row[] i tried counting the results and found out it is 0 even though i am getting nice for the $result2
can some one offer some assistance on this matter
thanks

3
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by jstrain@gpc.edu
0

how to select rows with array?

first you implode that array $diff. after you select row with each variable which is in array. then count.

Edited by muralikalpana: n/a

0

i want to do a query with each variable that is in the Diff array and just give me a result of each query that is what i am trying to achieve

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.