Advertisement
Guest User

Untitled

a guest
Jul 1st, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.94 KB | None | 0 0
  1. <?php
  2.  
  3.  
  4. $Headline=$_POST["Headline"];
  5. $Category=$_POST["Category"];
  6. $Writer=$_POST["Writer"];
  7. $Source=$_POST["Source"];
  8. $Story=$_POST["Story"];
  9. $Daresubmitted=$_POST["Datesubmitted"];
  10.  
  11.  
  12.  
  13. $host = "localhost";
  14. $user = "root";
  15. $pass = "";
  16. $db = "addarticle";
  17.  
  18.  
  19.  
  20. $link = mysqli_connect($host, $user, $pass, $db);
  21.  
  22.  
  23. $query = "SELECT * FROM addarticle WHERE Headline LIKE '%$Headline%'";
  24.  
  25. $result = mysqli_query($link, $query) or die(mysqli_error($link));
  26.  
  27. mysqli_close($link);
  28. $row=mysqli_fetch_array($result);
  29. {
  30. $arrnews[] = $row;
  31. }
  32.  
  33.  
  34. echo "<table border='1' bordercolor='black' cellpadding='10' width='600' >";
  35. echo"<tr>";
  36. echo"<th>";
  37. echo "Category";
  38. echo "</th>";
  39.  
  40. echo"<th>";
  41. echo "Headline";
  42. echo "</th>";
  43.  
  44. echo"<th>";
  45. echo "Writer";
  46. echo "</th>";
  47.  
  48. echo"<th>";
  49. echo "Source";
  50. echo "</th>";
  51.  
  52. echo"<th>";
  53. echo "Date Submitted";
  54. echo "</th>";
  55.  
  56. echo"<th>";
  57. echo "Story";
  58. echo "</th>";
  59. echo"</tr>";
  60.  
  61.  
  62. for($empCount=0;$empCount < count($arrnews);$empCount++)
  63. {
  64.  
  65. $Category = $arrnews[$empCount]['Category'];
  66. $Headline = $arrnews[$empCount]['Headline'];
  67. $Writer = $arrnews[$empCount]['Writer'];
  68. $Source = $arrnews[$empCount]['Source'];
  69. $Datesubmitted = $arrnews[$empCount]['Datesubmitted'];
  70. $Story = $arrnews[$empCount]['Story'];
  71.  
  72. echo "<tr>";
  73.  
  74. echo "<td> $Category</td>";
  75. echo "<td> $Headline</td>";
  76. echo "<td> $Writer</td>";
  77. echo "<td> $Source</td>";
  78. echo "<td> $Datesubmitted</td>";
  79. echo "<td> $Story</td>";
  80.  
  81.  
  82. echo "</tr>";
  83. echo"</table>";
  84. ?>
  85. <?php
  86. }
  87. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement