| | | | |
| | |
| Gast
Beiträge: n/a
| Hi. Ich habe bei meinem Skript ein kleines Problem. Hier erstmal das Skript: PHP Code: $query = mysql_query("SELECT * FROM `cp_user` as `u` INNER JOIN `cp_script_squad` as `s` ON `u`.`squad_id` = `s`.`squad_id` WHERE `s`.`status`='on'");
$i=0;
while($daten = mysql_fetch_array($query))
{
$squad[$i]["squad_id"] = $daten["squad_id"];
$squad[$i]["name"] = $daten["name"];
$squad[$i]["description"] = $daten["description"];
$squad[$i]["icon"] = $daten["icon"];
$squad[$i]["status"] = $daten["status"];
$member[$i]["user_id"] = $daten["user_id"];
$member[$i]["nickname"] = $daten["nickname"];
$member[$i]["rank"] = $daten["task"];
$member[$i]["activity"] = $daten["activity"];
$member[$i]["email"] = $daten["email"];
$i++;
}
$smarty->assign("member",$member);
$smarty->assign("squad",$squad);
Code: {section name=id loop=$squad}
<h2>{if $squad[id].icon}[img]data/squad/{$squad[id].icon}[/img]{/if} {$squad[id].name}</h2>
<table width="100%" border>
<tr>
<td align="center"><u>{#nickname#}</u></td>
<td align="center"><u>{#rank#}</u></td>
<td align="center"><u>{#activity#}</u></td>
<td align="center"><u>{#email#}</u></td>
<td align="center"><u>{#details#}</u></td>
</tr>
{section name=id2 loop=$member}
<tr>
<td>{$member[id2].nickname}</td>
<td>{$member[id2].rank}</td>
<td align="center">{if $member[id2].activity == "active"}<font color="#008000">{#active#}</font>{else}<font color="#ff0000">{#inactive#}</font>{/if}</td>
<td>{$member[id2].email}</td>
<td align="center">{#details#}</td>
</tr>
{sectionelse}
</table>
<table>
{#info_nomember#}
{/section}
{/section}
http://basti.by.clanserver4u.de/sons...codes.de/1.jpg Das stimmt natürlich komplett nicht. Denn es gibt derzeit 2 user in der Datenbank. Beide haben eine unterschiedliche squad_id. Und es gibt derzeit 2 Squads (squad#1 und squad#2). Aber die user werden weder richtig angezeigt, noch dem richtigen Squad zugeordnet. Kann mir da jemand weiterhelfen ? Ich sitz an dem Problem jetzt schon seit 2 Wochen Theoretisch wollte ich noch einbauen, dass der User in mehreren Squads seien kann... also noch eine Tabelle dazu, welche id, user_id, squad_id und Aufgabe eines Users managed. Könnte mir bei dem ganzen Problem jemand weiterhelfen ? |
| | |
| PHP Code Flüsterer Registriert seit: 21.08.2005 Beiträge: 4682 PHP-Kenntnisse: Fortgeschritten | |
| Themen-Optionen | |
| Thema bewerten | |
|
|
Ähnliche Themen | ||||
| Thema | Autor | Forum | Antworten | Letzter Beitrag |
| Smarty + MySQL = immer falsche Ausgabe | m0use` | PHP Tipps 2006 | 44 | 21.11.2008 20:30 |
| Smarty Problem: | Kein Genie | PHP Tipps 2008 | 4 | 22.05.2008 20:50 |
| Smarty: Templatedateien werden nicht aktualisiert! | DER_Brain | PHP Tipps 2008 | 9 | 24.04.2008 22:40 |
| Problem mit Smarty | ccfirefox | HTML, Usability und Barrierefreiheit | 1 | 25.10.2007 16:19 |
| Startup Skript | m_haussner | Datenbanken | 3 | 10.10.2007 20:56 |
| Smarty + Oop Problem | Komandar | PHP Tipps 2006 | 5 | 25.07.2006 14:36 |
| .htpasswd (im geschützten Ordner!) per skript ändern! | Funky_ | PHP Tipps 2006 | 8 | 22.07.2006 18:03 |
| datensätze defekt oder problem mit dem einlesen? | Ministry | Datenbanken | 4 | 06.07.2006 18:42 |
| problem mit javascript und smarty | snatch-ic | HTML, Usability und Barrierefreiheit | 2 | 08.06.2006 22:11 |
| [Erledigt] Seltsames Problem mit Smarty | PHP-Fortgeschrittene | 3 | 28.07.2005 00:42 | |
| [Erledigt] File download > kleines Problem | PHP Tipps 2005 | 3 | 11.05.2005 23:11 | |
| Smarty Problem (Template Laden) | JanM | PHP Tipps 2005 | 5 | 11.05.2005 16:36 |
| Javascript - CountUP Skript zählt falsch.. | Chr!s | HTML, Usability und Barrierefreiheit | 0 | 28.03.2005 14:32 |
| inclue_path problem mit smarty und pear | PHP Tipps 2005 | 4 | 21.02.2005 15:44 | |
| Smarty - Problem bei include | PHP Tipps 2005 | 16 | 07.02.2005 12:51 | |
| Besucher kamen über folgende Suchanfragen bei Google auf diese Seite |
| smarty php, smarty und php, smarty \{php}\, php smarty, php smarty news script, html {section name=id loop=}, smarty problem php, php smarty probleme, problem php smarty, smarty email, smarty ranking aus tabelle lesen, php smartydownload, smarty fehler beim laden des template, php squad script download, smarty tipps, smarty id probleme, smarty tipps und tricks, smarty registerglobals, where squad_id in(\.$squad_id.\), smarty in php |

Dieser Inhalt ist unter einer Creative Commons-Lizenz lizenziert.