myspecial.php
<?php
include("mySQLOpen.php");
/**
* Simple helper to debug to the console
*
* @param Array, String $data
* @return String
*/
//function ShowParentFam($callerId,$onlyNames)
////include("mySQLOpen.php");
//openConnection();
//mysql_select_db("myBible");
$callerParentId = $_SERVER['QUERY_STRING'];
{ }
$iParent=0;
$aParent=array();
mysql_select_db("myBible.schrift");
// mysqli::select_db mysqli_select_db
openConnection();
// Wessen Kind?
$abfrage = "SELECT DISTINCT(id) FROM schrift";
debug_to_console( 'ShowParentFam abfrage: '.$abfrage );
$ergebnis = mysql_query($abfrage) or die("ERROR: $abfrage <br>".mysql_error());
While($row = mysql_fetch_object($ergebnis))
{
$array = explode("|", $row->id);
$aParent=array_merge($aParent,$array);
//$iPos = StrPos($row->id,"|",0);
//$Parent = substr($row->id,7,$iPos-7);
//$aParent[$iParent]=$Parent;
$iParent+=1;
}
if($iParent>0)
{
$aParent = array_unique($aParent);
foreach ($aParent as $value)
{
// Erster:Buchstabe, dann Zahlen
if(ctype_alpha(substr($value,0,1)) and is_numeric(substr($value,1))
// Es darf nicht die eigene ID sein
and ($value != $callerId)
// Es darf keine Notiz sein
and (substr($value,0,1) <> "N"))
{
if($onlyNames)
{
if($iParent>0)
{
echo "<br>";
}
$iParent--;
echo showMenue($value, '','','','','','',false);
}
else
{
ShowFam($value);
}
}
}
<?php
function openConnection()
{ $verbindung = mysql_connect("localhost","root","#2014Jul09");
mysql_select_db("myBible");
mysql_query("SET NAMES 'utf8'");
}
?>
}
function debug_to_console( $data )
{
if ( is_array( $data ) )
{
$output = "<script>console.log( 'Debug Objects: " . implode( ',', $data) . "' );</script>";
}
else
{
$output = "<script>console.log( 'Debug Objects: ".mysql_real_escape_string($data)."' );</script>";
}
}
echo $output;
mysqli_close($verbindung);
?>