Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $pubname = $_POST["pname"];
- $servername ="localhost";
- $username="root";
- $password="jit123";
- $dbname="1jt14cs007db4";
- $conn= new mysqli($servername,$username,$password,$dbname);
- if($conn->connect_error)
- {
- die("CONN failed :" . $conn->connect_error);
- }
- else
- {
- //echo "Before Update"
- $sqlquery="select * from publisher where name='".$pubname."';";
- $result = $conn->query($sqlquery);
- if($result->num_rows>0)
- {
- echo "<table align=\"center\"border=1> <tr> <th> Publisher ID </th> <th>Name</th><th>City</th><th>Country</th></tr>";
- while($row=$result->fetch_assoc())
- {
- echo "<tr><td>$row[publisherid]</td><td>$row[name]</td><td>$row[city]</td><td>$row[country]</td></tr>";
- }
- echo "</table>";
- }
- else echo "empty set";
- //$updateQuery = "update catalog set price=price+price*0.1 where publisherid in(select publisherid from publisher where name=‘".$pubname."‘);"
- }
- $conn->close();
- ?>
Add Comment
Please, Sign In to add comment