0

HELLO. THIS IS MY CODE.. WHY HAS THAT ERRORS..I HAS TRY MANY SOLUTIONS, BUT IT CANT WORK... PLS HELP ME IMMEDIATELY.. TQ
"Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in C:\AppServ\www\integombmds\updateCurriculumCorrect.php on line 190"


BELOW IS MY CODE:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
<!--
.style101 {color: #000000; font-weight: bold; }
.style108 {font-family: Arial, Helvetica, sans-serif; color: #000000; font-weight: bold; }
.style109 {font-family: Arial, Helvetica, sans-serif;
	color: #000000;
	font-size: 12px;
}
.style116 {color: #FF0000;
	font-size: 13px;
	font-family: Arial, Helvetica, sans-serif;
	font-weight: bold;
}
.style117 {font-size: 11px;
	color: #666666;
	font-family: Geneva, Arial, Helvetica, sans-serif;
}
.style118 {font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
	color: #FF0000;
}
.style119 {color: #5F6973}
.style121 {color: #5C6874}
.style122 {color: #5C6C7B}
.style123 {color: #5D6D7C}
.style19 {font-family: Verdana, Arial, Helvetica, sans-serif}
.style3 {font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 12px;
}
.style31 {color: #FFFFCC}
.style67 {color: #FFFFFF; font-weight: bold; }
.style70 {color: #000000}
.style71 {font-size: 12px}
.style72 {font-family: Arial, Helvetica, sans-serif}
.style77 {font-size: 15px;
	color: #FF0000;
	font-weight: bold;
	font-family: Arial, Helvetica, sans-serif;
}
.style85 {font-size: 10px;
	font-family: Arial, Helvetica, sans-serif;
}
.style86 {font-size: 10px;
	color: #000000;
	font-family: Arial, Helvetica, sans-serif;
}
.style90 {color: #666666}
.style93 {color: #FFFFFF;
	background: #FFFFFF;
}
a:link {
	color: #FFFFFF;
	text-decoration: none;
}
a:visited {
	text-decoration: none;
	color: #F1F1F1;
}
a:hover {
	text-decoration: none;
	color: #FFFFFF;
}
a:active {
	text-decoration: none;
}
-->
</style>
<script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
</head>

<body>
<table width="749" height="32" border="0" align="center">
  <tr>
    <td height="28" bordercolor="#3366CC" bgcolor="#FFFFFF"><a href="index.php"><img src="images/home.JPG" width="90" height="22" /></a></td>
    <td bordercolor="#3366CC" bgcolor="#FFFFFF"><a href="userManual.php"><img src="images/um.JPG" width="90" height="22" /></a></td>
    <td bordercolor="#0066CC" bgcolor="#FFFFFF"><div align="center" class="style67"><a href="contactUs.php"><img src="images/contact.JPG" width="90" height="22" /></a></div></td>
    <td width="492" bordercolor="#0000CC"><span class="style93"></span></td>
  </tr>
</table>
<table width="735" height="582" border="0" align="center" bgcolor="#F1F1F1">
  <tr>
    <td height="162" colspan="5" bgcolor="#F1F1F1"><div align="center">
      <script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','733','height','160','src','images/sbpi banner2','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','scale','exactfit','movie','images/sbpi banner2' ); //end AC code
        </script>
      <noscript>
        <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="733" height="160">
          <param name="movie" value="images/sbpi banner2.swf" />
          <param name="quality" value="high" />
          <param name="SCALE" value="exactfit" />
          <embed src="images/sbpi banner2.swf" width="733" height="160" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" scale="exactfit"></embed>
        </object>
        </noscript>
    </div></td>
  </tr>
  <tr>
    <td width="179" height="414"><table width="179" border="0" align="right" cellpadding="0" cellspacing="0" bordercolor="#0000FF" bgcolor="#0000FF">
      <tr>
        <td height="21" bgcolor="#F1F1F1" class="style62 style72 style71"><img src="images/manage.JPG" width="179" height="20" /></td>
      </tr>
      <tr>
        <td width="179" height="19" bgcolor="#F1F1F1" class="style62 style72 style71"><span class="style90"><a href="updateStaffProfileTrue.php">&nbsp;&nbsp;&nbsp;&nbsp;<img src="images/forMenu.JPG" width="13" height="12" /></a><span class="style70">Profile Account</span></span></td>
      </tr>
      <tr>
        <td height="19" bgcolor="#F1F1F1" class="style62 style72 style71"><a href="updateStudentProfileTrue.php">&nbsp;&nbsp;&nbsp;&nbsp;<img src="images/forMenu.JPG" alt="" width="13" height="12" /><span class="style70">Students Profile</span></a></td>
      </tr>
      <tr>
        <td height="21" bgcolor="#F1F1F1" class="style62 style72 style71"><img src="images/evaCurr.JPG" width="179" height="20" /></td>
      </tr>
      <tr>
        <td height="19" bgcolor="#F1F1F1" class="style72 style71 style62"><a href="addCurriculumContribution.php">&nbsp;&nbsp;&nbsp;</a><a href="updateStaffProfileTrue.php"><img src="images/forMenu.JPG" alt="" width="13" height="12" /></a><a href="searchStudentCurriculum.php"><span class="style70">Merit Evaluation</span></a></td>
      </tr>
      <tr>
        <td height="20" bgcolor="#F1F1F1" class="style62 style72 style71"><img src="images/evaCocurr.JPG" width="179" height="20" /></td>
      </tr>
      <tr>
        <td height="20" bgcolor="#F1F1F1" class="style62 style72 style71"><a href="addUniformedBodiesCategory.php">&nbsp;&nbsp;&nbsp;<span class="style70"></span></a><a href="updateStaffProfileTrue.php"><img src="images/forMenu.JPG" alt="" width="13" height="12" /></a><a href="searchStudentCocurriculum.php"><span class="style70">Merit Evaluation</span></a><a href="addUniformedBodiesCategory.php"></a></td>
      </tr>
      <tr>
        <td height="20" bgcolor="#F1F1F1" class="style71 style72 style62"><img src="images/evaMis.JPG" width="179" height="20" /></td>
      </tr>
      <tr>
        <td height="20" bgcolor="#F1F1F1" class="style62 style72 style71"><a href="addWelfareContribution.php" class="style70">&nbsp;&nbsp; </a><a href="updateStaffProfileTrue.php"><img src="images/forMenu.JPG" alt="" width="13" height="12" /></a><a href="searchMisconduct.php" class="style70">Demerit Evaluation</a></td>
      </tr>
      <tr>
        <td height="20" bgcolor="#F1F1F1" class="style71 style72 style62"><img src="images/behaviorCert.JPG" width="179" height="20" /></td>
      </tr>
      <tr>
        <td height="19" bgcolor="#F1F1F1" class="style62 style72 style71"><a href="addSpiritualityContribution.php" class="style70">&nbsp;&nbsp;&nbsp;</a><a href="updateStaffProfileTrue.php"><img src="images/forMenu.JPG" alt="" width="13" height="12" /></a><span class="style70">Print Certificate</span></td>
      </tr>
      <tr>
        <td height="18" bgcolor="#F1F1F1" class="style62 style72 style71"><img src="images/statRep.JPG" width="179" height="20" /></td>
      </tr>
      <tr>
        <td height="22" bgcolor="#F1F1F1" class="style62 style72 style71"><a href="addMisconductCategory.php"><span class="style70">&nbsp;&nbsp;&nbsp;</span></a><a href="updateStaffProfileTrue.php"><img src="images/forMenu.JPG" alt="" width="13" height="12" /></a>View Statistic</td>
      </tr>
      <tr>
        <td height="19" bgcolor="#F1F1F1" class="style62 style72 style71"><a href="updateStaffProfileTrue.php">&nbsp;&nbsp; <img src="images/forMenu.JPG" alt="" width="13" height="12" /></a><a href="addMisconductBehaviors.php"><span class="style70">P</span></a><span class="style70">rint report</span></td>
      </tr>
      <tr>
        <td height="19" bgcolor="#F1F1F1" class="style62 style72 style71">&nbsp;</td>
      </tr>
      <tr>
        <td height="19" bgcolor="#F1F1F1" class="style62 style72 style71">&nbsp;</td>
      </tr>
      <tr>
        <td height="19" bgcolor="#F1F1F1" class="style62 style72 style71">&nbsp;</td>
      </tr>
      <tr>
        <td height="19" bgcolor="#F1F1F1" class="style62 style72 style71">&nbsp;</td>
      </tr>
      <tr>
        <td height="19" bgcolor="#F1F1F1" class="style62 style72 style71">&nbsp;</td>
      </tr>
      <tr>
        <td height="19" bgcolor="#F1F1F1" class="style62 style72 style71">&nbsp;</td>
      </tr>
      <tr>
        <td height="19" bgcolor="#F1F1F1" class="style62 style72 style71">&nbsp;</td>
      </tr>
    </table></td>
    <td width="546" colspan="4"><table width="547" border="0">
      <tr>
        <td><span class="style77">Search Curriculum Evaluation </span></td>
      </tr>
    </table>
        <table width="550" height="377" border="1" align="center" bordercolor="#F1F1F1" bgcolor="#F1F1F1">
          <tr>
            <td width="540" height="371" bordercolor="#F1F1F1" bgcolor="#F1F1F1"><?php


$host=$_POST['hostelName'];
//$c=$_POST['contribution'];
$yr=$_POST['year'];


include("C:/AppServ/www/integombmds/inc/dbconn.inc");
$conn = mysql_connect("$hostname", "$noID", "$kataLaluan");
mysql_select_db($dbname,$conn);

	
$result = mysql_query("SELECT p.icNo, p.hostelName, p.year, r.cevaluationId, r.cc, r.contribution, r.c1, r.cp, r.position, r.p1, r.cdc, r.disciplinecharacter, r.d1, r.cw, r.w1, r.welfare, r.cs, r.spirituality, r.s1, r.ctp,r.gc FROM students p, curriculum r where p.icNo=r.icNo AND p.hostelName LIKE '%$host%' AND p.year LIKE '%$yr%' ORDER BY p.year"); 
//p.name,p.icNo,p.classroom, p.classTeacher, p.hostelName, p.currentAddress, p.temporaryAddress, p.gender, p.year, p.email, p.phoneNo,r.cevaluationId, r.icNo, r.cc, r.contribution, r.c1, r.cp, r.position, r.p1, r.cdc, r.disciplinecharacter, r.d1, r.dw, r.w1, r.welfare, r.cs, r.s1 and  r.spirituality FROM curriculum r,students p where p.icNo=r.icNo AND p.hostelName LIKE '%$host%' AND p.year LIKE '%$yr%' ORDER BY r.icNo

$num = mysql_num_rows($result);

?>
              <table width="536" border="0" align="center" cellpadding="1" cellspacing="1" bordercolor="#FFFFFF" bgcolor="#FFFFFF">
                    <? if($num==0){?>
                    <tr>
                      <th width="520" height="20" bordercolor="#FFFFFF" bgcolor="#F1F1F1" scope="row"> <label><span class="style118">No existing record in a database. To check another,<span class="style119"><strong> Cl</strong></span><span class="style121"><a href="selectReportStaff.php" class="style70"><span class="style123">i</span><span class="style122">ck here</span></a></span></span></label></th>
                    </tr>
                    <? } ?>
                  </table>
                <? if($num>0){ ?>
                  <table width="535" border="0" align="center" bordercolor="#FFFFFF" bgcolor="#F1F1F1">
                    <tr>
                      <td colspan="4" bgcolor="#F1F1F1"><span class="style116">Searches Report</span></td>
                    </tr>
                    <tr>
                      <td width="300" bgcolor="#DBE0E3"><div align="left" class="style71"><span class="style108 style72">Name</span></div></td>
                      <td width="158" bgcolor="#DBE0E3"><div align="left" class="style71"><span class="style108 style72">Curriculum Type</span></div></td>
                      <td width="31" bgcolor="#DBE0E3"><span class="style108 style72 style71">Year</span></td>
                      <td width="28" bgcolor="#DBE0E3"><div align="left" class="style71"><span class="style108 style72">View</span></div></td>
                    </tr>
                    <tr>
                      <?php
while($row = mysql_fetch_array($result))
{
?>
                      <td bordercolor="#CCCCCC" bgcolor="#F1F1F1"><span class="style101 style72 style71"><strong><?php echo $row['name'] ?></strong></span></td>
                      <td bordercolor="#CCCCCC" bgcolor="#F1F1F1"><span class="style101 style72 style71"><strong><?php echo $row['choice'] ?></strong></span></td>
                      <td bordercolor="#CCCCCC" bgcolor="#F1F1F1" class="style109"><strong><?php echo $row['year'] ?></strong></td>
                      <td bordercolor="#CCCCCC" bgcolor="#F1F1F1"><div align="center"><span class="style101 style72 style71"><strong><strong><a href="meritCurriculumFullReport.php?idT=<?php echo $row['icNo']; ?>" class="style3"><img src="images/lihatProfil.png" alt="Modify Record" width="19" height="14" /></a></strong></strong></span></div></td>
                    </tr>
                    <?php }}?>
              </table></td></tr>
      </table></td>
  </tr>
</table>
<table width="747" border="0" align="center" bordercolor="#F1F1F1">
  <tr>
    <td width="741" bgcolor="#F1F1F1"><div align="right">
      <hr />
      <div align="right"><span class="style86 style87"><img src="images/phone.JPG" width="19" height="14" /></span> <span class="style85 style87">03-61863050 <img src="images/fax.JPG" width="19" height="14" /> 03-61858472 <img src="images/email.JPG" width="19" height="14" />webmastermds@yahoo.com&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="style117">All Rights Reserved © INTEGOMB MDS 2011</span></div>
    </div></td>
  </tr>
</table>
</body>
</html>

Edited by peter_budo: Keep It Clear - Do wrap your programming code blocks within [code] ... [/code] tags

2
Contributors
1
Reply
2
Views
6 Years
Discussion Span
Last Post by cwarn23
0

Please follow the rules as posted on daniweb otherwise in future you may have to suffer the consequences such as point deduction or banning. So please keep your code tidy by placing it in the appropriate code tags and it isn't nice when long sentences are purely in caps. So try not to break any more rules in future.

Our Web Development forum category encompasses everything related to building a website from the ground up. Topics include serverside scripting, clientside scripting, databases, and web / graphic design. When posting programming code, encase it in [ code], [ code=syntax], or [ icode] bbcode tags. Please only link to your website if it is necessary to demonstrate how something isn't working.
Our PHP forum is the place for Q&A-style discussions related to this popular development language. LAMP programmers will appreciate our separate Apache forum, within the Networking sub-category of the Hardware and Software category, and MySQL forum, also within the Web Development category.

As per the question you have asked it is in the following syntax that you need to correct:

$result = mysql_query($sql) or die(mysql_error());

Notice the "or die(mysql_error());" after the mysql_query() function. This will reviel the true error which is a sql syntax error for your mysql query input ($sql). By fixing the $sql variable or the string you manually inputed you will solve the entire problem. So do "or die(mysql_error());" after each mysql_query()" and tell us the new error.

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.