php.de

Zurück   php.de > Webentwicklung > PHP Einsteiger > PHP Tipps 2004

 
 
LinkBack Themen-Optionen Thema bewerten
Alt 22.10.2004, 10:40  
Gast
 
Beiträge: n/a
Standard [Erledigt] DB classen

Hallo Leute,
Ich muss anhand meines Pflichtspraktikums eine interanet-seite erstellen (Datenbank handling unabhängig von Datenbanken).
Es geht um DB-Abfragen und Formulare, ich habe aber erst seit zwei Wochen angefangen PHP zu lernen.
Ich würde ganz gerne wissen, welche Klassen, die ich dafür brauche und die Herangehensweise. Ich brauche nur den ersten Schritt
Ich weiss, dass es viel verlangt ist, aber ich habe gerade keine andere Möglichkeit.
Danke und Grüße
 
Sponsor Mitteilung
PHP Code Flüsterer

Registriert seit: 21.08.2005
Beiträge: 4682
PHP-Kenntnisse:
Fortgeschritten

Alt 22.10.2004, 10:46  
Gast
 
Beiträge: n/a
Standard

was möchtest du denn ganz genau machen? also ich handle meine datenbankgeschichten und auch formularkrams ohne irgendwelche klassen.
das is ja noch alles ganz gut auch so zu bewerkstelligen .

mir fällt auch spontan nur eine db klasse von pear ein, guckst du hier:
http://pear.php.net/packages.php?cat...tname=Database

ansonsten rück n paar mehr infos raus.
 
Alt 22.10.2004, 10:55  
Gast
 
Beiträge: n/a
Standard

was ist denn eine interanet seite? ..

whatever: es gibt paar pear-packages die genau das tun .. wobei man dazu vielleicht
sagen sollte, dass die formulare selber gar keine rolle spielen, ist nur die frage wie muss
man die anfrage für datenbankA formulieren und wie für datenbankB .. das is ja eigentlich
der ganze spaß dabei.
 
Alt 22.10.2004, 11:47  
Gast
 
Beiträge: n/a
Standard

Datenabfragen in Form von Tabellen auf einer Intranet-Seite !!!!!!
Das folgende Beispiel ist für eine Abfrage. Wie kann ich eine Klasse davon schreiben. Kann ich überhaupt eine PEAR-DB Klasse in meinem Skript integriere.
Berücksichtige bitte mein Unwissen.




<?php
$RootDirectory = TRUE;
include ("common.php");
?>

<html>
<head>
<meta http-equiv="Content-Language" content="en" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<LINK href="<?php echo $Style;?>" media="screen" rel=STYLESHEET type=text/css>
<title><?php echo "$status";?> --- Composition</title>
</head>
<body>

<?php
echo "$Header";
$ActualScreen = "Query Composition";

?>
<table>
<td width="732" class="db">Home > <?php echo"$ActualScreen";?> > </td>
</table>

<?php

session_start();

$_SESSION['CalledScript'] = 'query_composition';

$Table = "Table";
$TblVisible = "off";
$TblName1 ="composition A";
$TblName2 ="ts_prep B";
$TblName3 ="qs_prep C";

$SortVisible = "1256";
$SortSelected = "2";
$DisplayVisible = "12";
$DisplaySelected = "12";

$SortLength = strlen($SortVisible);
$DisplayLength = strlen($DisplayVisible);
$SelectLength = $DisplayLength;

$Desc[1] = "SH no.";
$Name[1] ="A.SHNAME";
$Visible[1] = "on";

$Desc[2] = "Preparation Name";
$Name[2] ="A.E_PRNAMEB";
$Visible[2] = "on";

$Desc[3] = "MD Doc No.";
$Name[3] ="A.A_DOCNO";
$Visible[3] = "on";

$Desc[4] = "MD Doc Title";
$Name[4] ="A.A_DOCTITLE";
$Visible[4] = "on";

$Desc[5] = "Item no.";
$Name[5] ="A.STNR";
$Visible[5] = "on";

$Desc[6] = "Item description";
$Name[6] ="A.STNAMEB";
$Visible[6] = "on";

$Desc[7] = "TS Doc No.";
$Name[7] ="B.A_DOCNO";
$Visible[7] = "on";

$Desc[8] = "TS Doc Title";
$Name[8] ="B.A_DOCTITLE";
$Visible[8] = "on";

$Desc[9] = "QS Doc No.";
$Name[9] ="C.A_DOCNO";
$Visible[9] = "on";

$Desc[10] = "QS Doc Title";
$Name[10] ="C.A_DOCTITLE";
$Visible[10] = "on";

$maxdisplay = 10;

$i = 0;
$j = 0;
$widthSum = 400;
$width1 = 200;
$width2 = 200;
$width3 = 70;
$width4 = 20;
$action1 = "preparation.php";
$action2 = "query_pharmacopoeia.php";
$action3 = "clear_frame.html";
$action4 = "query_list761.php";
$action5 = "query_packspec.php";
?>

<form name="input" action="<?php echo $action1?>" method="get" target ="display">

<fieldset>
<legend>
Select
</legend>

<?php
include ("logo.php");
?>
</table>
<table border="0" width="<?php if ($SelectLength < 9) { echo $width1+$width2;} else {echo ($width1+$width2)*2;} ?>" bgcolor="#b0d0f0">
<?php for ($k = 1; $k < $maxdisplay+1; $k++) { ?>
<?php if ($Visible[$k] <> "") {
?>
<tr valign="top" align="left">
<td width="<?php echo $width1;?>" bgcolor="#d0e0ff" class="tab2">
<?php echo $Desc[$k].":";?></td>
<td width="<?php echo $width2;?>" bgcolor="#d0e0ff" class="tab2">
<input type="text" name="Content<?php echo $k;?>" style="width:<?php echo $width2."px ";?>"></td>
</tr>
<?php }
} ?>

<?php for ($j = 1; $j < $maxdisplay+1; $j++) {?>
<input type="hidden" name="<?php echo "Desc$j";?>" value="<?php echo "$Desc[$j]" ?>">
<input type="hidden" name="<?php echo "Name$j";?>" value="<?php echo "$Name[$j]"?>">
<?php } ?>
<input type="hidden" name="TblName1" value="<?php echo $TblName1;?>">
<input type="hidden" name="TblName2" value="<?php echo $TblName2;?>">
<input type="hidden" name="TblName3" value="<?php echo $TblName3;?>">
<input type="hidden" name="maxdisplay" value="<?php echo $maxdisplay;?>">

</table>
</fieldset>

<fieldset>
<legend>
Sort
</legend>
<table border="0" width="<?php echo $width;?>" bgcolor="#b0d0f0">
<tr valign="top" align="left">
<?php
$i = 0;
for ($j = 1; $j < $SortLength+1; $j++) {
$a = substr ($SortVisible, $j-1, 1);
if (ord($a) > ord("J")) {$a = "2".chr (ord($a) - 27);} else {if (ord($a) > ord("9")) {$a = "1".chr (ord($a) - 17);}}
?>
<td width="<?php echo $width3;?>" bgcolor="#d0e0ff" class="tab2">
<?php echo $Desc[$a].":";?></td>
<td width="<?php echo $width4;?>" bgcolor="#d0e0ff" class="tab2"> <input type="radio" <?php if ($a == $SortSelected) {echo " checked";} ?> name="Sort" value="<?php echo "$Name[$a]"?>"></td>
<?php $i++; If ($i > 7) {$i=0; ?></tr><tr valign="top" align="left"><?php } ?>
<?php } ?>
</tr>
</table>
</fieldset>

<fieldset>
<legend>
Display
</legend>
<table border="0" width="<?php echo $width;?>" bgcolor="#b0d0f0">
<tr valign="top" align="left">
<?php
$i = 0;
for ($j = 1; $j < $DisplayLength+1; $j++) {
$a = substr ($DisplayVisible, $j-1, 1);
if (strstr($DisplaySelected, $a)) {$b = TRUE;} else {$b = False;}
if (ord($a) > ord("J")) {$a = "2".chr (ord($a) - 27);} else {if (ord($a) > ord("9")) {$a = "1".chr (ord($a) - 17);}}
?>
<td width="<?php echo $width3;?>" bgcolor="#d0e0ff" class="tab2">
<?php echo $Desc[$a].":";?></td>
<td width="<?php echo $width4;?>" bgcolor="#d0e0ff" class="tab2"> <input type="checkbox" name="displ<?php echo $a?>" <?php if ($b) {echo " checked";} ?> ></td>
<?php $i++; If ($i > 7) {$i=0; ?></tr><tr valign="top" align="left"><?php } ?>
<?php } ?>
</tr>
</table>
</fieldset>

<form name="input" method="get" target ="display">
<fieldset>
<legend>

</legend>

<table border="0" width="<?php echo $width2;?>" bgcolor="#b0d0f0">
<tr valign="top" align="left">
<td width="<?php echo $width3;?>" bgcolor="#d0e0ff" class="tab2">
<input type="submit" value="Submit">
</td>
</form>

<form name="input" action="<?php echo $action2?>" method="get" target ="query">
<td width="<?php echo $width3;?>" bgcolor="#d0e0ff" class="tab2">
<input type="submit" value="-> Pharmacopoeia">
</td>
</form>

<form name="input" action="<?php echo $action5?>" method="get" target ="query">
<td width="<?php echo $width3;?>" bgcolor="#d0e0ff" class="tab2">
<input type="submit" value="-> PackSpec">
</td>
</tr>
</form>

<form name="input" action="<?php echo $action4?>" method="get" target ="query">
<tr valign="top" align="left">
<td width="<?php echo $width3;?>" bgcolor="#d0e0ff" class="tab2">
<input type="submit" value="-> List 761">
</td>
</form>

<form name="input" action="<?php echo $action3?>" method="get" target ="display">
<td width="<?php echo $width3;?>" bgcolor="#d0e0ff" class="tab2">
<input type="submit" value="Clear">
</td>
</tr>
</table>
</form>
</fieldset>


<form name="input" method="get" target ="display">
<fieldset>
<legend>
Links
</legend>

<table border="0" width="<?php echo $widthSum+70;?>" bgcolor="#d0e0ff">
<tr valign="top" align="left">
<TD ALIGN=center width="20">
<IMG SRC=<?php echo $Src."vwicnsr5.gif"?> BORDER=0 HEIGHT=12 WIDTH=12 ALT="64%">
</TD>
<TD class="ColumnMisc">
<span class="FieldText">
<a href="http://149.234.6.150/APPS/BE/PlanetOne/PXI/P1PXI_AppsPublish.nsf/p1sys_Document/5A02723BB8170DCCC1256E8B00560AF7?OpenDocument&0002 " target ="display">IMS S.PBA00385 (Drug Products: Assignment to Lead Sites)
</a>
</span>
</TD>
</tr>
<tr valign="top" align="left">
<TD ALIGN=center width="20">
<IMG SRC=<?php echo $Src."vwicnsr5.gif"?> BORDER=0 HEIGHT=12 WIDTH=12 ALT="64%">
</TD>
<TD class="ColumnMisc">
<span class="FieldText">
<a href="http://149.234.6.150/APPS/BE/PlanetOne/PXI/P1PXI_AppsPublish.nsf/p1sys_Document/EF282899A0A92D43C1256D4100355F47?OpenDocument&0002 " target ="display">IMS S.PBA00384 (Active pharmaceutical ingredients, pharmaceutical excipients: Assignment to Lead Sites)
</a>
</span>
</TD>
</tr>
<tr valign="top" align="left">
<TD ALIGN=center width="20">
<IMG SRC=<?php echo $Src."vwicnsr5.gif"?> BORDER=0 HEIGHT=12 WIDTH=12 ALT="64%">
</TD>
<TD class="ColumnMisc">
<span class="FieldText">
<a href="releasenotes.html" target ="display">Release Notes IoP Test Version 0.9, dated Sep 30, 2004
</a>
</span>
</TD>
</tr>

<?php
</table>
</fieldset>
</form>

<?php
echo "$Contact";
?>

</body>
</html>
 
Alt 22.10.2004, 14:34  
Gast
 
Beiträge: n/a
Standard

sorry, aber ich glaub du erwartest hier was falsches .. das was du da gepostet hast
ist ja schön und recht .. enthält aber keine einzige db abfrage ..

pear kann man überall integrieren, hängt halt nur einiges an arbeit mit zusammen und
man muss sich auf den stil einlassen & wird deshalb nicht immer seinen stiefel durchsetzen
können.
 
 


Themen-Optionen
Thema bewerten
Thema bewerten:

Forumregeln
Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are an
Gehe zu

Ähnliche Themen
Thema Autor Forum Antworten Letzter Beitrag
2 classen verbinden notyyy PHP Tipps 2008 7 28.08.2007 14:03
OOP allgemeine frage zu classen notyyy PHP Tipps 2007 2 11.02.2007 22:07
[Erledigt] a name andre farbe als a href mit css ohne classen HTML, Usability und Barrierefreiheit 2 07.09.2004 12:07
LAYOUT mit classen definieren PHP-Fortgeschrittene 4 05.09.2004 19:47
Hilfe beim Documentieren von Classen PHP Tipps 2004 5 27.07.2004 23:18


Alle Zeitangaben in WEZ +2. Es ist jetzt 02:22 Uhr.




Powered by vBulletin® Version 3.7.2 (Deutsch)
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
Aprilia-Forum, Aquaristik-Forum, Liebeskummer-Forum, Zierfisch-Forum, Geizkragen-Forum

Creative Commons License
Dieser Inhalt ist unter einer Creative Commons-Lizenz lizenziert.