Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $Headline=$_POST["Headline"];
- $Category=$_POST["Category"];
- $Writer=$_POST["Writer"];
- $Source=$_POST["Source"];
- $Story=$_POST["Story"];
- $Daresubmitted=$_POST["Datesubmitted"];
- $host = "localhost";
- $user = "root";
- $pass = "";
- $db = "addarticle";
- $link = mysqli_connect($host, $user, $pass, $db);
- $query = "SELECT * FROM addarticle WHERE Headline LIKE '%$Headline%'";
- $result = mysqli_query($link, $query) or die(mysqli_error($link));
- mysqli_close($link);
- $row=mysqli_fetch_array($result);
- {
- $arrnews[] = $row;
- }
- echo "<table border='1' bordercolor='black' cellpadding='10' width='600' >";
- echo"<tr>";
- echo"<th>";
- echo "Category";
- echo "</th>";
- echo"<th>";
- echo "Headline";
- echo "</th>";
- echo"<th>";
- echo "Writer";
- echo "</th>";
- echo"<th>";
- echo "Source";
- echo "</th>";
- echo"<th>";
- echo "Date Submitted";
- echo "</th>";
- echo"<th>";
- echo "Story";
- echo "</th>";
- echo"</tr>";
- for($empCount=0;$empCount < count($arrnews);$empCount++)
- {
- $Category = $arrnews[$empCount]['Category'];
- $Headline = $arrnews[$empCount]['Headline'];
- $Writer = $arrnews[$empCount]['Writer'];
- $Source = $arrnews[$empCount]['Source'];
- $Datesubmitted = $arrnews[$empCount]['Datesubmitted'];
- $Story = $arrnews[$empCount]['Story'];
- echo "<tr>";
- echo "<td> $Category</td>";
- echo "<td> $Headline</td>";
- echo "<td> $Writer</td>";
- echo "<td> $Source</td>";
- echo "<td> $Datesubmitted</td>";
- echo "<td> $Story</td>";
- echo "</tr>";
- echo"</table>";
- ?>
- <?php
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement