< >

2-tabellen-join-count-grop.php


Quell Code


<?php

/*
              $mysqli=mysqli_connect("localhost", "sebastian1012", "123456789", "sebastian1012");
              if (mysqli_connect_errno())      die ("Connect failed: " . mysqli_connect_error());     
              mysqli_set_charset($mysqli, "utf8");



//$sql = "SELECT t.name, c.catid, c.catname FROM tenses t, tensecategory c WHERE t.catid=c.catid";

$number_of_workouts = array();
$query = "SELECT *  COUNT(*)
     FROM tenses, tensecategory
     WHERE `(SELECT catid from tenses) = (SELECT catid from tensecategory)
     GROUP BY t.name";

$result = mysqli_query($mysqli, $query)  or die ("MySQL-Error: " . mysqli_error($mysqli));
print_r(mysqli_fetch_all($result));
*/

/*
$result = $mysqli->query($sql);

$tenseinfo = [];
foreach ($result as $row) {
    if (!isset($tenseinfo[$row['catid']])) {
        $tenseinfo[$row['catid']] = ['catname' => $row['catname'], 'tenses' => [$row['name']]];
    } else {
        $tenseinfo[$row['catid']]['tenses'][] = $row['name'];
    }
}
*/

echo "<pre>";
print_r($tenseinfo);
echo "</pre>";





?>

Add Comment

* Required information
1000
Powered by Commentics

Comments (1)

Gravatar
Admin
Sascha65says...

Die Canvas Balken Uhr ist ja mal Fett