Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $link = mysqli_connect(
- 'localhost', /* The host to connect to */
- 'root', /* The user to connect as */
- '', /* The password to use */
- 'test'); /* The default database to query */
- if (!$link) {
- printf("Can't connect to MySQL Server. Errorcode: %s\n", mysqli_connect_error());
- exit;
- }
- $stmt=$link->prepare("SELECT column FROM `tablename`);
- if (!$stmt->execute()){
- echo "Error executing prepared statement<br />";
- die();
- }
- $stmt->bind_result($selectResult);
- while($stmt->fetch())
- echo $selectResult.'<br/>';
- $stmt->close();
- $link->close();
Advertisement
Add Comment
Please, Sign In to add comment