Skip to content

Instantly share code, notes, and snippets.

<?php
try
{
$pdo = new PDO('mysql:host=localhost;dbname=ijdb', 'ijdbuser', 'mypassword');
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$pdo->exec('SET NAMES "utf8"');
}
catch (PDOException $e)
{
$error = 'Unable to connect to the database server.';
<?php
class classname {
function __construct($param) {
echo "Конструктор вызван с параметром " . $param . "<br />";
}
}
$a = new classname("Первый");
<form action="?edit" method="post">
<div>
<label for="name">Name: <input type="text" name="name"
id="name" value="Joan Smith"></label>
</div>
<div>
<label for="email">Email: <input type="text" name="email"
id="email" value="[email protected]"></label>
</div>
<div>
SELECT joke.id, joketext, email, category.name, author.name
FROM joke
INNER JOIN author ON authorid = author.id
INNER JOIN jokecategory ON joke.id = jokeid
INNER JOIN category ON categoryid = category.id
{
"joke": [
{
"id": 1,
"joketext": "Цыплята ...",
"jokedate": "2014-01-12",
"authorId": "1"
},
{
"id": 2,
<?php
header('Location: http://www.mail-plus.ru/balance.pdf');
?>
<html ng-app>
<head>
<title>AngularJs Post Example: DevZone.co.in </title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js"></script>
<style>
#dv1{
border:1px solid #DBDCE9; margin-left:auto;
margin-right:auto;width:220px;
border-radius:7px;padding: 25px;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Form Example</title>
</head>
<body>
<form action="name.php" method="post">
<div><label for="name">Name:
<input type="text" name="name" id="name"></label>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Form Example</title>
</head>
<body>
<form action="" method="post">
<div><label for="firstname">Enter ID:
<input type="text" name="id" id="firstname"></label>
<?php
try
{
$pdo = new PDO('mysql:host=localhost;dbname=ijdb', 'ijdbuser', 'mypassword');
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$pdo->exec('SET NAMES "utf8"');
}
catch (PDOException $e)
{
$output = 'Unable to connect to the database server.';