selectbefehl macht probl.
hi@all!
ich hab da einen code, der im ergebnis ein css ist und auch (als php) in den einzelnen seiten eingesetzt ist >>> funzt so auch, wie das hier steht!!!!!!!!!!!!!!!!!!!!
... aber: kaum erzeuge ich die werte in einer tabelle der db, (tabelle heisst 'css') und will sie dort aus den spalten auslesen, komm ich nicht weiter, schon beim testen.
also: z.b.: hab ich den wert background-color (spalte: 'bgcol') als zahl (ohne #) per phpmyadmin online eingetragen eintrage so klappt es nicht
wieso bitte nicht, ich nehm an am 'select'-befehl' liegt's.???
ich hab da einen code, der im ergebnis ein css ist und auch (als php) in den einzelnen seiten eingesetzt ist >>> funzt so auch, wie das hier steht!!!!!!!!!!!!!!!!!!!!
|
|
PHP-Quelltext |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
<? include ("connect.php");
echo ("body {
background-image:url('images/');
background-color : #314477;
font-family : Verdana;
font-size :8pt;
}
BODY {SCROLLBAR-ARROW-COLOR:#ffffff; SCROLLBAR-BASE-COLOR: #314477; scrollbar-highlight-color :#ffffff;; scrollbar-shadow-color :#ffffff;}
A:link { color: #ffffff; text-decoration: none; background:#; }
A:visited {color : #ffffff; text-decoration:none ; background:#; }
A:hover {color: #ffffff; text-decoration: underline overline ; background:#; }
A:active {color: #ffffff; text-decoration: underline overline ; background:#; }
table.frame {width: 87%; height: 420px;
border-style: solid; border-width: 1px;
border-color: #FFFFCC #FFFFCC;
}
td.frame{padding-left: 6mm; padding-right:6mm; padding-bottom:6mm; padding-top:6mm}
td.frame{ font-size: 8pt;
text-align: justify
}
td.frame{vertical-align:text-top}
td.frame{
color: #314477;
background-color : #FFFFCC;
}
p {font-size: 8pt;}");?>
|
... aber: kaum erzeuge ich die werte in einer tabelle der db, (tabelle heisst 'css') und will sie dort aus den spalten auslesen, komm ich nicht weiter, schon beim testen.
also: z.b.: hab ich den wert background-color (spalte: 'bgcol') als zahl (ohne #) per phpmyadmin online eingetragen eintrage so klappt es nicht

|
|
PHP-Quelltext |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
<? include ("connect.php");
echo ("body {
background-image:url('images/');
background-color : #["$check = "SELECT bgcol FROM css";
$result = mysql_query($check);
if (mysql_num_rows($result))
{
while($row=mysql_fetch_array($result))
{
$name = $row[bgcol];
print(($name));
}
}"];
font-family : Verdana;
font-size :8pt;
}
BODY {SCROLLBAR-ARROW-COLOR:#ffffff; SCROLLBAR-BASE-COLOR: #314477; scrollbar-highlight-color :#ffffff;; scrollbar-shadow-color :#ffffff;}
A:link { color: #ffffff; text-decoration: none; background:#; }
A:visited {color : #ffffff; text-decoration:none ; background:#; }
A:hover {color: #ffffff; text-decoration: underline overline ; background:#; }
A:active {color: #ffffff; text-decoration: underline overline ; background:#; }
table.frame {width: 87%; height: 420px;
border-style: solid; border-width: 1px;
border-color: #FFFFCC #FFFFCC;
}
td.frame{padding-left: 6mm; padding-right:6mm; padding-bottom:6mm; padding-top:6mm}
td.frame{ font-size: 8pt;
text-align: justify
}
td.frame{vertical-align:text-top}
td.frame{
color: #314477;
background-color : #FFFFCC;
}
p {font-size: 8pt;}");?>
|
wieso bitte nicht, ich nehm an am 'select'-befehl' liegt's.???
Im Leben gibt man nur Briefe auf, sonst nix!
www.realtype.org
www.realtype.org
|
|
PHP-Quelltext |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
<? include ("connect.php");
echo "body {
background-image:url('images/');
background-color : #";
$check = "SELECT bgcol FROM css";
$result = mysql_query($check);
if (mysql_num_rows($result))
{
while($row=mysql_fetch_array($result))
{
$name = $row['bgcol'].";";
echo $name;
}
}
echo "font-family: Verdana;
font-size :8pt;
}
BODY {SCROLLBAR-ARROW-COLOR:#ffffff; SCROLLBAR-BASE-COLOR: #314477; scrollbar-highlight-color :#ffffff;; scrollbar-shadow-color :#ffffff;}
A:link { color: #ffffff; text-decoration: none; background:#; }
A:visited {color : #ffffff; text-decoration:none ; background:#; }
A:hover {color: #ffffff; text-decoration: underline overline ; background:#; }
A:active {color: #ffffff; text-decoration: underline overline ; background:#; }
table.frame {width: 87%; height: 420px;
border-style: solid; border-width: 1px;
border-color: #FFFFCC #FFFFCC;
}
td.frame{padding-left: 6mm; padding-right:6mm; padding-bottom:6mm; padding-top:6mm}
td.frame{ font-size: 8pt;
text-align: justify
}
td.frame{vertical-align:text-top}
td.frame{
color: #314477;
background-color : #FFFFCC;
}
p {font-size: 8pt;}";?>
|
Probiers mal so

mfg
Dieser Beitrag wurde bereits 2 mal editiert, zuletzt von »csgod« (11. Februar 2004, 15:59)
sorry
sofort ausprobiert >>> klappt leider nicht, gibts noch eine 2. möglichkeit???
sofort ausprobiert >>> klappt leider nicht, gibts noch eine 2. möglichkeit???
Im Leben gibt man nur Briefe auf, sonst nix!
www.realtype.org
www.realtype.org
Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »webmastersworld« (11. Februar 2004, 16:01)
keine fehlermeldung, css-werte werden nur nicht generiert (seite bleibt weiss, standardschrift statt verdana etc.)!
ich hab diesen code von hier copied-pasted und auf den server gespielt.
ich hab diesen code von hier copied-pasted und auf den server gespielt.
Im Leben gibt man nur Briefe auf, sonst nix!
www.realtype.org
www.realtype.org
ich kann es nur immer und immer wieder sagen: testet eure scripte ohne die werte sonst wo einzutragen
wenn in der spalte bgcol etwas drinsteht, dann gib es doch einfach mal auf einer leeren seite aus. dann siehst du was da drin steht und verarbeitest es weiter
was sagt den der quellcode? steht was hinter background-color: #??
du musst immer wieder testen wenn was nicht klappt. das geht schneller als hier rum zu tippen und zu warten bis einer antwortet
wenn in der spalte bgcol etwas drinsteht, dann gib es doch einfach mal auf einer leeren seite aus. dann siehst du was da drin steht und verarbeitest es weiter
was sagt den der quellcode? steht was hinter background-color: #??
du musst immer wieder testen wenn was nicht klappt. das geht schneller als hier rum zu tippen und zu warten bis einer antwortet
der code wurde von mir folgend geändert:
an der seitenausgabe hat sich nix geändert, also das css wird abgebrochen und generiert auf der seite nicht mehr, also seite bleibt weiss statt (db-wert) 800000 (dunkles rot), standardschrift statt verdana etc. >> also alles wie oben schon beschrieben.
Hi CRUSHER!!
du hast schon recht, aber ich stehe wirklich an, mir fällt kein test mehr ein; wenn ich die 800000 hier eintrage, klappt das ganze ja, anders wenn ich diesen wert auslesen will??????
|
|
PHP-Quelltext |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
<? include ("connect.php");
echo "body {
background-image:url('images/');
background-color : #";
$check = "SELECT bgcol FROM css";
$result = mysql_query($check);
if (mysql_num_rows($result))
{
while($row=mysql_fetch_array($result))
{
$name = $row['bgcol'].";";
echo $name;
}
}
echo mysql_error();
font-family: Verdana;
font-size :8pt;
}
BODY {SCROLLBAR-ARROW-COLOR:#ffffff; SCROLLBAR-BASE-COLOR: #314477; scrollbar-highlight-color :#ffffff;; scrollbar-shadow-color :#ffffff;}
A:link { color: #ffffff; text-decoration: none; background:#; }
A:visited {color : #ffffff; text-decoration:none ; background:#; }
A:hover {color: #ffffff; text-decoration: underline overline ; background:#; }
A:active {color: #ffffff; text-decoration: underline overline ; background:#; }
table.frame {width: 87%; height: 420px;
border-style: solid; border-width: 1px;
border-color: #FFFFCC #FFFFCC;
}
td.frame{padding-left: 6mm; padding-right:6mm; padding-bottom:6mm; padding-top:6mm}
td.frame{ font-size: 8pt;
text-align: justify
}
td.frame{vertical-align:text-top}
td.frame{
color: #314477;
background-color : #FFFFCC;
}
p {font-size: 8pt;}");?>
|
an der seitenausgabe hat sich nix geändert, also das css wird abgebrochen und generiert auf der seite nicht mehr, also seite bleibt weiss statt (db-wert) 800000 (dunkles rot), standardschrift statt verdana etc. >> also alles wie oben schon beschrieben.
Hi CRUSHER!!
du hast schon recht, aber ich stehe wirklich an, mir fällt kein test mehr ein; wenn ich die 800000 hier eintrage, klappt das ganze ja, anders wenn ich diesen wert auslesen will??????
Im Leben gibt man nur Briefe auf, sonst nix!
www.realtype.org
www.realtype.org
Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »webmastersworld« (11. Februar 2004, 17:06)
|
|
PHP-Quelltext |
1 2 3 4 5 6 7 |
if (mysql_num_rows($result))
{
while($row=mysql_fetch_array($result))
{
$name = $row['bgcol'].";";
echo $name;
}
|
übrigens total unnötig.
einfach mysql_result($result, 0, bgcol)
damit kriegst du das auch raus....
ich lege dir schwerstens ans herz dir ein php buch und ein sql buch zu kaufen. ...
@csgod:
so hab ichs jetzt drinnen stehen, aber hilft nix
|
|
PHP-Quelltext |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
<? include ("connect.php");
echo "body {
background-image:url('images/');
background-color : #";
$check = "SELECT bgcol FROM css";
$result = mysql_query($check);
if (mysql_num_rows($result))
{
while($row=mysql_fetch_array($result))
{
$name = $row['bgcol'].";";
echo $name;
}
}
echo"
font-family: Verdana;
font-size :8pt;
}
BODY {SCROLLBAR-ARROW-COLOR:#ffffff; SCROLLBAR-BASE-COLOR: #314477; scrollbar-highlight-color :#ffffff;; scrollbar-shadow-color :#ffffff;}
A:link { color: #ffffff; text-decoration: none; background:#; }
A:visited {color : #ffffff; text-decoration:none ; background:#; }
A:hover {color: #ffffff; text-decoration: underline overline ; background:#; }
A:active {color: #ffffff; text-decoration: underline overline ; background:#; }
table.frame {width: 87%; height: 420px;
border-style: solid; border-width: 1px;
border-color: #FFFFCC #FFFFCC;
}
td.frame{padding-left: 6mm; padding-right:6mm; padding-bottom:6mm; padding-top:6mm}
td.frame{ font-size: 8pt;
text-align: justify
}
td.frame{vertical-align:text-top}
td.frame{
color: #314477;
background-color : #FFFFCC;
}
p {font-size: 8pt;}");?>
|
so hab ichs jetzt drinnen stehen, aber hilft nix
Im Leben gibt man nur Briefe auf, sonst nix!
www.realtype.org
www.realtype.org
Dieser Beitrag wurde bereits 3 mal editiert, zuletzt von »webmastersworld« (11. Februar 2004, 17:22)
|
|
PHP-Quelltext |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
<? include ("connect.php");
echo "body {
background-image:url('images/');
background-color : #";
$check = "SELECT bgcol FROM css";
$result = mysql_query($check);
if (mysql_num_rows($result))
{
while($row=mysql_fetch_array($result))
{
$name = $row['bgcol'].";";
echo $name;
}
}
echo "font-family: Verdana;
font-size :8pt;
}
BODY {SCROLLBAR-ARROW-COLOR:#ffffff; SCROLLBAR-BASE-COLOR: #314477; scrollbar-highlight-color :#ffffff;; scrollbar-shadow-color :#ffffff;}
A:link { color: #ffffff; text-decoration: none; background:#; }
A:visited {color : #ffffff; text-decoration:none ; background:#; }
A:hover {color: #ffffff; text-decoration: underline overline ; background:#; }
A:active {color: #ffffff; text-decoration: underline overline ; background:#; }
table.frame {width: 87%; height: 420px;
border-style: solid; border-width: 1px;
border-color: #FFFFCC #FFFFCC;
}
td.frame{padding-left: 6mm; padding-right:6mm; padding-bottom:6mm; padding-top:6mm}
td.frame{ font-size: 8pt;
text-align: justify
}
td.frame{vertical-align:text-top}
td.frame{
color: #314477;
background-color : #FFFFCC;
}
p {font-size: 8pt;}";?>
|
Unten war noch ein ")" zuviel..
Probiers jetzt mal und dann poste doch bitte endlich mal die Ausgabe der css Datei mit :L
mfg
Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »csgod« (11. Februar 2004, 17:28)
Zitat
... poste doch bitte endlich mal die Ausgabe der css Datei mit :L
sorry csgod, ich wusste nicht, was du genau damit meinst.
jetzt aber hat es geklappt
HURRAYdanke csgod (nomen omen esto
), ich hab zwar gedacht, dass ich da was verbockt hab, aber wie es dazu kam, dass unser beider schreibweise von echodeine schreibweise: echo "...";
meine schreibweise: echo("...");
durcheinanderkam ist mir unerklärlich, ich nehme an, es lag am 2. echo-command, nach dem select-befehl, mal sehen, ob ich jetzt alle werte auslesen kann und dann noch schreiben, viel zu tun heute ;-)
Im Leben gibt man nur Briefe auf, sonst nix!
www.realtype.org
www.realtype.org
Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »webmastersworld« (11. Februar 2004, 17:43)
Ähnliche Themen
-
PHP »-
ohne include gehts, mit nicht?
(16. Januar 2006, 15:27)
-
PHP »-
mehrer tabellen durchsuchen - N°2
(30. September 2005, 22:44)
-
PHP »-
html verbieten?
(1. Juni 2005, 19:19)
-
PHP »-
stylex.php macht schon wieder probl.
(26. September 2004, 21:41)
-
PHP »-
kann ich auch dir kopieren?
(18. September 2004, 13:12)



