Hi evryone....
i need you help in this coding....
i named this page search0.php.... .
this is my code....
i would like to assign the code at line 3 until line 5 to one attribute or variable....so that, when i want to call the 3 attribute,i just need to call one variable.....is it possible? how is it?
plz help me anyone...
i need you help in this coding....
i named this page search0.php.... .
this is my code....
Code:
<?php include("dbconn.php"); $dateday = $_POST['dateday']; $datemonth = $_POST['datemonth']; $dateyear = $_POST['dateyear']; $sql= "SELECT * FROM staffactivity WHERE dateday = '$dateday' AND datemonth = '$datemonth' AND dateyear = '$dateyear'"; $query = mysql_query($sql) or die ("Error: " . mysql_error()); $row = mysql_num_rows($query); if($row == 0){ echo "No record found"; } else{ $r = mysql_fetch_assoc($query); //$studentid= $r['studentid']; //$studentnumber= $r['studentnumber']; //$studentname= $r['studentname']; //$studentpassword= $r['studentpassword']; ?> <html> <body> <form name="form4" method="post" action="process0.php"> <table border="2" width="100" height="100"> <?php $sqlGet= "SELECT * FROM staffactivity WHERE dateday = '$dateday' AND datemonth = '$datemonth' AND dateyear = '$dateyear'"; $queryGet = mysql_query($sqlGet) or die("Error: " . mysql_error()); while($rGet = mysql_fetch_assoc($queryGet)) { //echo "<table border='0'>"; echo "<tr>"; echo "<td class='fonttable'>".$rGet['dateday']; echo " "; echo $rGet['datemonth']; echo " "; echo $rGet['dateyear']."</td>"; echo "<td class='fonttable'>".$rGet['task2']."</td>"; echo "<td class='fonttable'>".$rGet['note2']."</td>"; echo "</tr>"; } ?> </table> <input type="submit" name="Update" value="Update"> <input type="submit" name="Delete" value="Delete"> </form> </body> </html> <?php } mysql_close($dbconn); ?>
i would like to assign the code at line 3 until line 5 to one attribute or variable....so that, when i want to call the 3 attribute,i just need to call one variable.....is it possible? how is it?
plz help me anyone...
Comment