Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $servername = "localhost";
- $username = "root";
- $password = "root";
- $dbname = "myDB";
- $conn = new mysqli($servername, $username, $password, $dbname);
- if ($conn->connect_error) {
- die("Connection failed: " . $conn->connect_error);
- }
- $sql = "SELECT id, firstname, lastname FROM tablenamehere ORDER BY id DESC LIMIT 500";
- $result = $conn->query($sql);
- if ($result->num_rows > 0) {
- while($row = $result->fetch_assoc()) {
- echo "<p>". $row["firstname"]. " " . $row["lastname"] . "</p>";
- }
- } else {
- echo "0 results";
- }
- $conn->close();
- $sql = "SELECT id, firstname, lastname FROM tablenamehere ORDER BY id DESC LIMIT 500";
- $result = $conn->query($sql);
- <html>
- <body>
- <a href="test1.php?a=newtable">Register Now!</a>
- </body>
- </html>
- <?php
- session_start();
- ?>
- <?php
- if(isset($_GET['a'])){
- $_SESSION['link']=$_GET['a'];
- }
- echo "the veriable is " . $_SESSION['link'] . "<br>";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement