Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $servername = "localhost";
- $username = "root";
- $password = "";
- $dbname = "careers";
- try {
- $conn = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password);
- $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
- echo "Connected successfully <br />";
- var_dump($_POST);
- }
- catch(PDOException $e)
- {
- echo "Connection failed: " . $e->getMessage();
- }
- $query=$conn->prepare("insert into tagcloud (text,weight) values (?, 1) on duplicate key update weight = weight + 1");
- $query->bindParam(1, $searchedTerm);
- $searchedTerm=$_POST['word'];
- $query->execute();
- $conn = null;
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement