SELFPHP: Version 5.8.2 Befehlsreferenz - Tutorial – Kochbuch – Forum für PHP Einsteiger und professionelle Entwickler

SELFPHP


Professional CronJob-Service

Suche



CronJob-Service    
bei SELFPHP mit ...



 + minütlichen Aufrufen
 + eigenem Crontab Eintrag
 + unbegrenzten CronJobs
 + Statistiken
 + Beispielaufrufen
 + Control-Bereich

Führen Sie mit den CronJobs von SELFPHP zeitgesteuert Programme auf Ihrem Server aus. Weitere Infos



:: Buchempfehlung ::

Webseiten professionell erstellen

Webseiten professionell erstellen zur Buchempfehlung
 

:: Anbieterverzeichnis ::

Globale Branchen

Informieren Sie sich über ausgewählte Unternehmen im Anbieterverzeichnis von SELFPHP  

 

:: Newsletter ::

Abonnieren Sie hier den kostenlosen SELFPHP Newsletter!

Vorname: 
Name:
E-Mail:
 
 

Zurück   PHP Forum > SELFPHP > PHP Grundlagen

PHP Grundlagen Hier kann über grundlegende Probleme oder Anfängerschwierigkeiten diskutiert werden

 
 
Themen-Optionen Ansicht
  #1  
Alt 17.12.2011, 21:43:28
Sin84 Sin84 ist offline
Anfänger
 
Registriert seit: Sep 2011
Alter: 40
Beiträge: 9
Tabelle: Eine Variable?, 2 Zeilen

Ich hoffe, ich bin hier richtig.

Und ich hoffe, dass ich mein Problem verständlich schildern kann.

Mehrere Images möchte ich in einer Tabelle in 2 Spalten anzeigen. Die Images befinden sich bisher in einer Zeile.
Da ich recht wenig Ahnung von PHP und MySQL habe, sitze ich schon seit gestern an dem scheiß Problem und komme nicht weiter.

Hier erstmal Code:

PHP-Code:
if ($z1_artikel!='0') {
print (
"<table>");
$sql2_topartikel "SELECT * FROM topartikel ORDER by top_id";
$res2_topartikel mysql_query($sql2_topartikel);
while(
$row mysql_fetch_assoc($res2_topartikel)) {
$top_id $row['top_id']; $top_artid $row['top_artid'];
$sql2_artikel "SELECT * FROM artikel WHERE art_id = '$top_artid'";
$res2_artikel mysql_query($sql2_artikel);      
while(
$row mysql_fetch_assoc($res2_artikel)) {
$art_id $row['art_id']; $art_kat $row['art_kat']; $art_nr $row['art_nr']; $art_titel $row['art_titel']; $art_img $row['art_img']; $art_imgw $row['art_imgw']; $art_imgh $row['art_imgh']; $art_datei $row['art_datei']; $art_size $row['art_size']; $art_demo $row['art_demo']; $art_descr $row['art_descr']; $art_preis1 $row['art_preis1']; $art_preis2 $row['art_preis2']; $art_preis3 $row['art_preis3']; $art_preis4 $row['art_preis4']; $art_liz1 $row['art_liz1']; $art_liz2 $row['art_liz2']; $art_liz3 $row['art_liz3']; $art_liz4 $row['art_liz4'];
if (
$art_img=='') {$image="img/noimage150.png"$breite=150$hoehe=120;}
else {
$image="artikel/".$art_img;
if (
$art_imgw>=$art_imgh) {
    
$breite "320";    $brprozent = ((110 $breite) / $art_imgw);
    
$hoehe = (($art_imgh $brprozent) / 75);    $hoehe = (ceil ($hoehe));
}
else {    
$hoehe "120";    $brprozent = ((100 $hoehe) / $art_imgh);
    
$breite = (($art_imgw $brprozent) / 100);    $breite = (ceil ($breite));
}
}
print (
"<td width=340>
<table width=340 border=0 cellpadding=0 cellspacing=0>
<tr><td colspan=2 height=130 style='border:1px solid #CCCCCC;' align=center><a href='details.php?session=$session&art=$art_id&kat=$kat&next=$next&page=$page&back=index'><img src='$image' width='$breite' height='$hoehe' border='0'></a></td></tr>
<tr><td id='space' height=2>&nbsp;</td></tr>
<tr><td><a href='details.php?session=$session&art=$art_id&kat=$kat&next=$next&page=$page&back=index'><img src='img/bt-detailsind.png' width='164' height='23' border='0'></a></td></tr>
</table>
</td>"
);
if (
$y!=3) {
print (
"<td width=9 id='space'>&nbsp;</td>");
}
}
$y++;
}
print (
"</tr>");


Wahrscheinlich sind gerade mal die ersten 8 Zeilen relevant, aber vorsichtshalber habe ich die komplette if Abfrage gepostet.

Mithilfe des Codes werden 3 Images aufgerufen, die nebeneinander angezeigt werden. Ich werde die Zahl der Images auf 4 erweitern und möchte diese dann in 2 Reihen nebeneinander anzeigen lassen. Also erste Reihe 2 Bilder. Zweite Reihe 2 Bilder.
Wenn ich echo "<tr>"; im Code einfüge, erreiche ich zumindest schon mal, dass alle Images untereinander gezeigt werden. Aber ganz so will ich das ja nicht. :)

PHP-Code:
if ($z1_artikel!='0') {
print (
"<table>");
$sql2_topartikel "SELECT * FROM topartikel ORDER by top_id";
$res2_topartikel mysql_query($sql2_topartikel);
while(
$row mysql_fetch_assoc($res2_topartikel)) {
$top_id $row['top_id']; $top_artid $row['top_artid'];
$sql2_artikel "SELECT * FROM artikel WHERE art_id = '$top_artid'";
$res2_artikel mysql_query($sql2_artikel);

echo 
"<tr>";

while(
$row mysql_fetch_assoc($res2_artikel)) { 

Hilfe. Bitte!
Mit Zitat antworten
 


Aktive Benutzer in diesem Thema: 1 (Registrierte Benutzer: 0, Gäste: 1)
 
Themen-Optionen
Ansicht

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

BB-Code ist an.
Smileys sind aus.
[IMG] Code ist aus.
HTML-Code ist aus.

Gehe zu

Ähnliche Themen
Thema Autor Forum Antworten Letzter Beitrag
Zeilen zählen und in zweiter Tabelle addieren Doc_McSky MySQLi/PDO/(MySQL) 1 07.06.2010 11:18:39
SELECT mit f_ vor variable (tabelle) wurli MySQLi/PDO/(MySQL) 2 24.10.2007 15:16:33
Tabelle einlessen in variable dalo MySQLi/PDO/(MySQL) 1 11.03.2006 17:39:26
eine tabelle per Variable in der URL verändern Gargamehl PHP Grundlagen 3 18.03.2004 17:16:38
Kann man INSERT INTO in tabelle, deren name eine variable ist ...? Ina PHP für Fortgeschrittene und Experten 8 23.01.2004 19:24:01


Alle Zeitangaben in WEZ +2. Es ist jetzt 13:12:13 Uhr.


Powered by vBulletin® Version 3.8.3 (Deutsch)
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.


© 2001-2024 E-Mail SELFPHP OHG, info@selfphp.deImpressumKontakt