<?
define("DB_HOST", "hostname");
define("DB_USER", "user");
define("DB_PASS", "pass");
define("DB_TABLE", "tabelle");
#sql1 erste db-verbindung
$sql1 = mysql_pconnect(DB_HOST, DB_USER, DB_PASS);
#sql2 erste db-verbindung
$sql2 = mysql_pconnect(DB_HOST, DB_USER, DB_PASS);
$q1="SELECT id, typ FROM ".DB_TABLE." GROUP BY typ ORDER BY typ";
mysql_query($q1, $sql1);
while($res = mysql_fetch_object($sql1)){
$q2= "SELECT * FROM ".DB_TABLE." WHERE typ='".$res->typ."'";
mysql_query($q2, $sql2);
echo '<table>';
echo '<tr>';
echo '<td colspan="5"><? echo $res->typ; ?></td>';
echo '</tr>';
echo '<tr>';
echo '<td rowspan="<? echo mysql_num_rows($sql2); ?>">Bild</td>';
echo '</tr>';
while($row = mysql_fetch_object($sql2)){
echo '<tr>';
echo '<td><? echo $row->Bezeichnung; ?></td>';
echo '<td><? echo $row->Watt; ?></td>';
echo '<td><? echo $row->Sockel; ?></td>';
echo '<td><? echo $row->Bestellnummer; ?></td>';
echo '</tr>';
}
}
?>
<?
#sql1 erste db-verbindung
#sql2 zweite db-verbindung
# $table - > DB-Tabelle
$q1="SELECT id, typ FROM ".$table." GROUP BY typ ORDER BY typ";
mysql_query($q1, $sql1);
while($res = mysql_fetch_object($sql1)){
$q2= "SELECT * FROM ".$table." WHERE typ='".$res->typ."'";
mysql_query($q2, $sql2);
echo '<table>';
echo '<tr>';
echo '<td colspan="5">Typ</td>';
echo '</tr>';
echo '<tr>';
echo '<td rowspan="<? echo mysql_num_rows($sql2); ?>">Bild</td>';
echo '</tr>';
while($row = mysql_fetch_object($sql2)){
echo '<tr>';
echo '<td><? echo $row->Bezeichnung; ?></td>';
echo '<td><? echo $row->Watt; ?></td>';
echo '<td><? echo $row->Sockel; ?></td>';
echo '<td><? echo $row->Bestellnummer; ?></td>';
echo '</tr>';
}
}
?>
<?php
$sql1 = mysql_connect ($mysql_server, $mysql_user, $mysql_password) or die ("Keine Verbindung zum Server");
mysql_select_db ($mysql_database) or die ("Keine Verbindung zur Datenbank");
$sql2 = mysql_connect ($mysql_server, $mysql_user, $mysql_password) or die ("Keine Verbindung zum Server");
mysql_select_db ($mysql_database) or die ("Keine Verbindung zur Datenbank");
# $table - > DB-Tabelle
$q1="SELECT id, typ FROM tabelle1 GROUP BY typ ORDER BY typ";
mysql_query($q1, $sql1);
while($res = mysql_fetch_object($sql1)){
$q2= "SELECT * FROM tabelle1 WHERE typ='".$res->typ."'";
mysql_query($q2, $sql2);
echo '<table>';
echo '<tr>';
echo '<td colspan="5">Typ</td>';
echo '</tr>';
echo '<tr>';
echo '<td rowspan="<? echo mysql_num_rows($sql2); ?>">Bild</td>';
echo '</tr>';
while($row = mysql_fetch_object($sql2)){
echo '<tr>';
echo '<td><? echo $row["Bezeichnung"]; ?></td>';
echo '<td><? echo $row["Watt"]; ?></td>';
echo '<td><? echo $row["Sockel"]; ?></td>';
echo '<td><? echo $row["Bestellnummer"]; ?></td>';
echo '</tr>';
}
}
?>
<?php
$sql = mysql_connect ($mysql_server, $mysql_user, $mysql_password) or die ("Keine Verbindung zum Server");
mysql_select_db ($mysql_database) or die ("Keine Verbindung zur Datenbank");
$q1="SELECT id, typ FROM tabelle1 GROUP BY typ ORDER BY typ";
$res_id= mysql_query($q1, $sql);
while($res = mysql_fetch_object($res_id)){
$q2= "SELECT * FROM tabelle1 WHERE typ='".$res->typ."'";
$res_id2 = mysql_query($q2, $sql);
echo '<table>';
echo '<tr>';
echo '<td colspan="5"><? echo $res->typ; ?></td>';
echo '</tr>';
echo '<tr>';
echo '<td rowspan="<? echo mysql_num_rows($res_id2); ?>">Bild</td>';
echo '</tr>';
while($row = mysql_fetch_object($res_id2)){
echo '<tr>';
echo '<td><? echo $row->Bezeichnung; ?></td>';
echo '<td><? echo $row->Watt; ?></td>';
echo '<td><? echo $row->Sockel; ?></td>';
echo '<td><? echo $row->Bestellnummer; ?></td>';
echo '</tr>';
}
}
?>
<?php include ("variables.php");
$sql = mysql_connect ($mysql_server, $mysql_user, $mysql_password) or die ("Keine Verbindung zum Server");
mysql_select_db ($mysql_database) or die ("Keine Verbindung zur Datenbank");
$q1="SELECT id, Typ FROM tabelle1 GROUP BY Typ ORDER BY Typ";
$res_id= mysql_query($q1, $sql);
while($res = mysql_fetch_object($res_id)){
$q2= "SELECT bild, Typ, Bezeichnung, Watt, Sockel, Bestellnummer FROM tabelle1 WHERE Typ='".$res->Typ."'";
$res_id2 = mysql_query($q2, $sql);
echo '<table>';
echo '<tr>';
echo '<td colspan="5"><? echo $res["Typ"]; ?></td>';
echo '</tr>';
echo '<tr>';
echo '<td rowspan="<? echo mysql_num_rows($res2); ?>">Bild</td>';
echo '</tr>';
while($row = mysql_fetch_object($res_id2)){
echo '<tr>';
echo '<td><? echo $row["Bezeichnung"]; ?></td>';
echo '<td><? echo $row["Watt"]; ?></td>';
echo '<td><? echo $row["Sockel"]; ?></td>';
echo '<td><? echo $row["Bestellnummer"]; ?></td>';
echo '</tr>';
echo '</table>';
}
}
?>
TranceAddict Forums (www.tranceaddict.com/forums)
- Europe - Germany
-- Der PC-Problem Thread
Pages (164): « 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 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 [69] 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 »
quote: |
Originally posted by McP68 I need help!! Also wir haben hier eine Lagerliste mit 6 Spalten.. bild, typ, bezeichnung, watt, sockel, bestellnummer die tabelle soll so aussehen, dass es nach dem typ gruppiert ist (oben drüber). ... und dann halt die nächste tabelle ach und ist mit SQL zu lösen!!!!! PLZ HELPP |
PHP:
kann mir jemand ne internetseite basteln?
quote: |
Originally posted by Stiffmaster kann mir jemand ne internetseite bastelt? |
quote: |
Originally posted by Tom Paris
So, Stylesheetformatierungen machste aber alleine , ja? |
quote: |
Originally posted by McP68 ich danke dir, gleich mal probieren, nachdem ich hier rumhänge |
quote: |
Originally posted by Tom Paris Hab noch ne kleine Korrektur gemacht... |
quote: |
Originally posted by dEEkAy besprechen wir später |
quote: |
Originally posted by Stiffmaster kann mir jemand ne internetseite basteln? |
quote: |
Originally posted by McP68 und in sql1 und sql2 kommt rein? Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in C:\apachefriends\xampp\htdocs\lagerliste\index.php on line 29 Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in C:\apachefriends\xampp\htdocs\lagerliste\index.php on line 30 das is die zeile mysql_query($q1, $sql1); while($res = mysql_fetch_object($sql1)){ |
quote: |
Originally posted by Tom Paris na die verbindungsdaten solltest du schon wissen. ich dachte dass du wenigestens das kannst...oder hast du gar keine ahnung von php? |
Warning: mysql_fetch_object(): supplied resource is not a valid MySQL result resource in C:\apachefriends\xampp\htdocs\lagerliste\index.php on line 32
immernoch die erste fetch anweisung
PHP:
Hab meinen Kram mal korrigiert...Da haben sich n paar Fehlerchen eingeschlichen..
PHP:
quote: |
Originally posted by Stiffmaster kann mir jemand ne internetseite basteln? |
Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in C:\apachefriends\xampp\htdocs\lagerliste\index.php on line 30
quote: |
Originally posted by McP68 Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in C:\apachefriends\xampp\htdocs\lagerliste\index.php on line 30 |
wahrscheinlich is jetzt der objektorientierte mysql-code zusammen mit den prozedurorientierten routinen in einer php-datei gemischt... wahrscheinlich brauchen beide varianten auch einen eigenen connect...
Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in C:\apachefriends\xampp\htdocs\lagerliste\index.php on line 38
das ist die zeile:
while($row = mysql_fetch_object($res2)){
jetzt gehts zwar, aber es kommt immer nur
Bild
Bild
Bild
Bild
Bild
....usw.
PHP:
quote: |
Originally posted by McP68 jetzt gehts zwar, aber es kommt immer nur Bild Bild Bild Bild Bild ....usw. |
quote: |
Originally posted by Tom Paris is bild denn ne grafik oder wie? Im Quelltext steh ja auch noch fest "BILD" drin, dass musst Du dann natürlich anpassen. Ebenso die Bezeichner für die Felder, wenn die nicht stimmen sollten. |
quote: |
Originally posted by Bloodflower und dazu passende portraits und promo bilder? und PI5 cover-motiv? |
quote: |
Originally posted by McP68 Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in C:\apachefriends\xampp\htdocs\lagerliste\index.php on line 38 das ist die zeile: while($row = mysql_fetch_object($res2)){ |
quote: |
Originally posted by Nachtengel hihi, bloß weil flo auch eine hat |
Powered by: vBulletin
Copyright © 2000-2021, Jelsoft Enterprises Ltd.