Commit 67ccb534 authored by Antonios Angelakis's avatar Antonios Angelakis

Finish figures and listings

parent 97787d6f
......@@ -4,6 +4,7 @@
author="Admin" inputFile="titlos.in" outputFile="titlos.out">
<Keyword code="alg.geometry"/>
<ProblemStatement>
Problem statement and description.
</ProblemStatement>
......@@ -17,15 +18,15 @@
</OutputFormat>
<ProblemConstraints>
$1 \le m \le 100$, $-100 \le x_i \le 100, 0 &lt; y_i \le 100$
$1 \le m \le 100$, $-100 \le x_i \le 100, 0 &lt; y_i \le 100$
</ProblemConstraints>
<Sample rank="1">
<SampleIn>
3
1 2 3
4 5 6
7 8 9
<SampleIn>
3
1 2 3
4 5 6
7 8 9
</SampleIn>
<SampleOut>
6
......@@ -38,7 +39,10 @@ $1 \le m \le 100$, $-100 \le x_i \le 100, 0 &lt; y_i \le 100$
<Import guid="std.testlib.1.1" type="checker" />
<Checker name="ch" src="check.dpr" style="testlib"/>
<TestRange from="1" to="42"><In src="tests/%0n"/><Out use="sol"/></TestRange>
<TestRange from="1" to="42">
<In src="tests/%0n"/>
<Out use="sol"/>
</TestRange>
</Problem>
</CATS>
<?php
// Connecting to a MySQL database
$user = "root";
$pass = "root";
$dsn = "mysql:host=localhost;dbname=test";
$charset = "utf8";
$dsn = "mysql:host=localhost;dbname=test;charset=$charset";
$dbh = new PDO('mysql:host=localhost;dbname=test;charset=$charset', $user, $pass);
?>
<?php
$db = new PDO($dsn, $user, $pass);
$query = "SELECT * FROM foo WHERE bar = " . $db->quote($zip);
// Executing a simple query
$val = 42;
$query = "SELECT * FROM foo WHERE bar = " . $db->quote($val);
$result = $db->query($query);
while($row = $result->fetch(PDO::FETCH_ASSOC)) {
print_r($row);
}
?>
<?php
$stmt = $dbh->prepare("INSERT INTO REGISTRY (name, value) VALUES (:name, :value)");
// Sequential executions of a prepared statement
$query = "INSERT INTO REGISTRY (name, value)
VALUES (:name, :value)";
$stmt = $db->prepare($query);
$stmt->bindParam(':name', $name);
$stmt->bindParam(':value', $value);
// insert one row
// First execution
$name = 'one';
$value = 1;
$stmt->execute();
// insert another row with different values
// Second execution with different values
$name = 'two';
$value = 2;
$stmt->execute();
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment