Posted by Caonex Tue 13th Mar 2007 16:04 - Syntax is PHP - 14 viewsRun this post in the PHP shell
Download | New Post | Modify | Hide line numbers
PHP parser reported no syntax errors in this post!
Description:
Fill.php is called to display the table from database....it

  1. $link = mysql_connect('mysql283.secureserver.net', 'caonex', 'caonex2007')
  2.    or die('Could not connect: ' . mysql_error());
  3. //echo 'Connected successfully';
  4. mysql_select_db('caonex') or die('Could not select database');
  5. $selected = $_GET['Type'];
  6. // Performing SQL query
  7. if ($_GET['Type'] != ""){
  8. $query = "SELECT `Paid` ,`Id` , `FirstName` , `LastName` , `Guest` , `Parish` , `Type` , `ReceptionAdults` , `ReceptionChildren` , `LucheonTotal` , `LuncheonTotalChildren` , `TotalDue` ,  `Address` , `City` , `State` , `Zip` , `Phone`
  9. FROM Conference Where `Type`='".$selected."' ORDER BY Id";
  10. }
  11. else {
  12. $query = 'SELECT `Paid` ,`Id` , `FirstName` , `LastName` , `Guest` , `Parish` , `Type` , `ReceptionAdults` , `ReceptionChildren` , `LucheonTotal` , `LuncheonTotalChildren` , `TotalDue` ,  `Address` , `City` , `State` , `Zip` , `Phone`
  13. FROM Conference ORDER BY Id ';
  14. }
  15. $result = mysql_query($query) or die('Query failed: ' . mysql_error());
  16.  
  17.  
  18.  
  19. echo "\n";
  20. echo "
  21. \n";
  22. $color = 0;
  23. while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
  24.     if($color == 0){
  25.            echo "\t
  26. \n";
  27.            $color = 1;
  28.        }
  29.        else{
  30.            $color = 0;
  31.            echo "\t
  32. \n";
  33.        }
  34.            echo "\t\t
  35. \n";
  36.        echo "\t\t
  37. \n";
  38.        foreach ($line as $col_value) {
  39.         echo "\t\t
  40. \n";
  41.        }
  42.  
  43.        echo "\t
  44. \n";
  45. }
  46. echo "
  47. Paid # First Name Last Name Guest Parish Type PR Adults PR Children Luncheon Adults Luncheon Children Total Phone City State Zip Phone
    \"javascript: req('Delete.php?Id=".$line['Id']."','Delete')\"  name=\"Delete\" type=\"button\" value=\"Delete\"/> \"javascript: req('Paid2.php?Id=".$line['Id']."','Paid')\"  name=\"Paid\" type=\"button\" value=\"Paid\"/> $col_value
    \n"
    ;
  48.  
  49.  
  50. // Free resultset
  51. mysql_free_result($result);
  52.  
  53. // Closing connection
  54. mysql_close($link);
  55.  
  56.  
  57. ?>

PermaLink to this entry https://pastebin.co.uk/11822
Posted by Caonex Tue 13th Mar 2007 16:04 - Syntax is PHP - 14 viewsRun this post in the PHP shell
Download | New Post | Modify | Hide line numbers

 

Comments: 0