Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Get Users Comment From Mysql using Php
- <?php
- // Insert Comments into Database that user provides
- $comm = mysql_real_escape_string($_POST['addComment']);
- $pID4 = filter_input(INPUT_GET, 'pID', FILTER_SANITIZE_NUMBER_INT);
- $cID = mysql_real_escape_string($_POST['courseInfoDD']);
- $username = "###";
- $password = "####";
- $pdo4 = new PDO('mysql:host=localhost;dbname=###', $username, $password);
- $pdo4->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );
- $sth3 = $pdo3->prepare('
- INSERT INTO Comment (info, pID, cID)
- VALUES(:info, :pID, :cID)
- ');
- $sth3->execute(array(
- ':info' => $comm, ':pID' => $pID3, ':cID' => $cID
- ));
- ?>
- <input type='text' id='addComment' name='addComment' tabindex='3' value='Enter comment' />
- $sth3 = $pdo3->prepare('
- INSERT INTO Comment (info, pID, cID)
- VALUES($comm, $pID3, $cID)
- ');
- $sth3 = $pdo3->prepare('
- INSERT INTO Comment (info, pID, cID)
- VALUES(:comm, :pID3, :cID)
- ');
- $sth3 = $pdo3->prepare('
- INSERT INTO Comment (info, pID, cID)
- VALUES(:info, :pID, :cID)
- ');
- $sth3->execute(array(
- ':info' => $comm, ':pID' => $pID3, ':cID' => $cID
- ));
- $sth3 = $pdo3->prepare("
- INSERT INTO Comment (info, pID, cID)
- VALUES('$comm', '$pID3', '$cID')
- ");
Add Comment
Please, Sign In to add comment