Skip to content

Instantly share code, notes, and snippets.

Avatar
💩

Andreas Jacobsen AndreasJacobsen

💩
View GitHub Profile
View gist:b0446796c48ea933da83
<?php
$tallrekke = array(1,4,8,1,4,10,5,6,2,4,6);
/*
$mintse = 0;
foreach ($tallrekke as $tall){
if ($tall < $minste){
$minste =  $tall;
}
}
View sql_andreas.sql
CREATE TABLE competitor
(
competitorID INT PRIMARY KEY NOT NULL AUTO_INCREMENT,
name VARCHAR(40) NOT NULL,
surname VARCHAR(40) NOT NULL,
nationality VARCHAR(40) NOT NULL
);
CREATE TABLE vm.audience
(
View oblig2.sql
create table Ovelse2(
OvelseNr int(2) auto_increment,
Betegnelse varchar(20),
Dato varchar(10),
Tid varchar(5),
Sted varchar(20),
PRIMARY KEY(OvelseNr)
);
create table Publikum2(
PublikumsNr int(3) auto_increment,
View side1.php
<!DOCTYPE html>
<html>
<head >
<meta charset="UTF-8">
<title>Oblig 2</title>
</head>
<body>
<form action="" method="post">
<input type="submit" name="publikum" value="Publikum"/>
<input type="submit" name="deltaker" value="Deltaker"/>
View index.php
<!DOCTYPE html>
<html>
<head >
<meta charset="UTF-8">
<title>Oblig 2</title>
</head>
<body>
<form action="" method="post">
<input type="submit" name="publikum" value="Publikum"/>
<input type="submit" name="deltaker" value="Deltaker"/>
View side2.php
<?php
if(isset($_POST["next"])) {
$db=mysqli_connect("localhost","root","","VM");
if(!$db) {
die("Feil i knytning til databasen!");
}
else
{
echo "knyttet til databse! <br>";
}
View losningsforslag_class.php
<?php
// Copyright Dan Eig
// funksjoner
function visOvelser()
{
/** Koble til DB **/
$db = new mysqli("cube.iu.hio.no","s155722","","s155722");
if(!$db)
View side2.php
<?php
$db = new mysqli();
if(isset($_POST["next"])) {
$db = mysqli_connect("localhost", "root", "", "VM");
View side2.php
<?php
$db = new mysqli();
if(isset($_POST["next"])) {
$db = mysqli_connect("localhost", "root", "", "VM");
View side2.php
<?php
$db = new mysqli();
if(isset($_POST["next"])) {
$db = mysqli_connect("localhost", "root", "", "VM");