<html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Available Scholarships NAME View</title> </head> <body> <?php include("my_database_connection_File.php"); mysql_connect($host,$username,$password); @mysql_select_db($database) or die( "Unable to select database"); $query="SELECT * FROM scholarship ORDER BY name ASC"; $result=mysql_query($query); $num=mysql_numrows($result); mysql_close(); ?> <table bgcolor="#CCCCCC" width="100%" border="0" cellspacing="2" cellpadding="2"> <tr> <td><font face="Arial, Helvetica, sans-serif"><ul>Scholarship Name</ul></font></td> </tr> <?php $i=0; while ($i < $num) { $id=mysql_result($result,$i,"scholarship_id"); $f1=mysql_result($result,$i,"name"); $f2=mysql_result($result,$i,"updated"); $f3=mysql_result($result,$i,"awarded"); $f4=mysql_result($result,$i,"due_date"); $f5=mysql_result($result,$i,"intro"); $f6=mysql_result($result,$i,"requirement"); $f7=mysql_result($result,$i,"decision"); $f8=mysql_result($result,$i,"contact"); $f9=mysql_result($result,$i,"gpa"); $f10=mysql_result($result,$i,"ethnic_req"); $f11=mysql_result($result,$i,"school_req"); $f12=mysql_result($result,$i,"special_req"); $f13=mysql_result($result,$i,"need"); $f14=mysql_result($result,$i,"renewable"); $f15=mysql_result($result,$i,"audit"); $f16=mysql_result($result,$i,"updated"); ?> <tr> <td valign="top"><font face="Arial, Helvetica, sans-serif"><a href="scholar_get_view_page.php?num"><?php echo $f1; ?></a></font></td> </tr> <?php $i++; } ?> </table> </body> </html>
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Single Scholarship View </title> </head> <body> <?php include("my_database_connection_File.php"); mysql_connect($host,$username,$password); @mysql_select_db($database) or die( "Unable to select database"); $query="SELECT * FROM scholarship ORDER BY name ASC"; $result=mysql_query($query); $num=mysql_numrows($result); mysql_close(); ?> <table bgcolor="#D2FFFF" width="100%" border="0" cellspacing="2" cellpadding="2"> <?php $i=0; while ($i < $num) { $id=mysql_result($result,$i,"scholarship_id"); $f1=mysql_result($result,$i,"name"); $f2=mysql_result($result,$i,"amount"); $f3=mysql_result($result,$i,"awarded"); $f4=mysql_result($result,$i,"due_date"); $f5=mysql_result($result,$i,"intro"); $f6=mysql_result($result,$i,"requirement"); $f7=mysql_result($result,$i,"decision"); $f8=mysql_result($result,$i,"contact"); $f9=mysql_result($result,$i,"gpa"); $f10=mysql_result($result,$i,"ethnic_req"); $f11=mysql_result($result,$i,"school_req"); $f12=mysql_result($result,$i,"special_req"); $f13=mysql_result($result,$i,"need"); $f14=mysql_result($result,$i,"renewable"); $f15=mysql_result($result,$i,"audit"); $f16=mysql_result($result,$i,"updated"); ?> <tr> <td valign="top"><font face="Arial, Helvetica, sans-serif"><b><?php echo $f1; ?></b> <br /> <br /> <b>Amount:</b> <?php echo $f2; ?> <br /> <br /> <b>Awarded:</b> <?php echo $f3; ?> <br /> <br /> <b>Due By:</b> <?php echo $f4; ?> <br /><br /> <?php echo $f5; ?> <br /> <br /> <b>Requirements:</b> <br /><br /><?php echo $f6; ?> <br /> <br /> <b>Decisions:</b> <?php echo $f7; ?> <br /> <br /> <b>Contact:</b> <br /><?php echo $f8; ?> <br /> <b>Ethnic Requirment:</b><?php echo $f10; ?>, <b>School Requirment:</b><?php echo $f11; ?>, <b>Special Requirement:</b><?php echo $f12; ?>, <b>Financial Need:</b><?php echo $f13; ?>, <b>Renewable:</b><?php echo $f14; ?> <br /> <br /> <b>Last Updated:</b><?php echo $f16; ?> </font> <br /> <!-- THIS IS THE SEPORATION BREAK FOR EACH RECORD --> <hr size="10" /> </td> <?php $i++; } ?> </table> </body> </html>
| Subject | Written By | Posted |
|---|---|---|
| Dynamically linking to mysql results record - using while mysql_result loop | Gerald Taber | 11/29/2012 12:47AM |
| Please do not double-post | Peter Brawley | 11/29/2012 10:19AM |
Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.