Jump to content

I found it ,but[showing array in phpmysql]


claro

Recommended Posts

I can get the values of my array now, but when I put it in my queries, it fail. .Can you guys help me..

if (isset($_POST['submit']))
{
$n=0;
foreach ($_POST['course'] as $course) {
$bigar[$n][1] = $course;
$n++;
}
$n=0;
foreach ($_POST['program'] as $program) {
$bigar[$n][2] = $program;
$n++;
}
foreach ($bigar as $part) 
{
$course =  $part[1];
$program = $part[2];
//echo $course;
//echo $program;
$stud = mysql_query ("SELECT * FROM vw_report_instructor WHERE user_Program = '$program' AND course_Id = '$course' ") or die (mysql_error());	

if (mysql_num_rows($stud))
{
   while ($row = mysql_fetch_array ($stud))
          {
echo "<tr><td>".$row['user_Fname']." ".$row['user_Lname']."</td>";
echo "<td>".$row['course_Title']."</td>";
echo "<td>".$row['se_Yearlevel']."</td>";
echo "<td>".$row['user_Program']."</td></tr>";
           }
}
else
{	
echo "<table><br/><br/>";
echo "<p style = 'text-indent: 29em;'>no match found</p>";
echo "</table>";
}
}

Link to comment
https://forums.phpfreaks.com/topic/249728-i-found-it-butshowing-array-in-phpmysql/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.