Advertisement
Guest User

Untitled

a guest
Jul 1st, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.54 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. $row=mysqli_fetch_array($result);
  28. {
  29. $arrnews[] = $row;
  30. }
  31. mysqli_close($link);
  32. echo '<table border="1" cellpadding="10">
  33. <tr>
  34. <th>Category<th>
  35. <th>Headline</th>
  36. <th>Writer</th>
  37. <th>Source</th>
  38. <th>Date</th>
  39. <th>Story</th>
  40. </tr>';
  41.  
  42. while ($row = mysqli_fetch_array($result)) {
  43. echo "<tr>
  44. <td>" . $row['Category'] . "</td>
  45. <td>" . $row['Headline'] . "</td>
  46. <td>" . $row['Writer'] . "</td>
  47. <td>" . $row['Source'] . "</td>
  48. <td>" . $row['Datesubmitted'] . "</td>
  49. <td>" . $row['Story'] . "</td>
  50. </tr>";
  51.  
  52. }
  53.  
  54. echo '</table>';
  55.  
  56. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement