Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

dekrementieren

Empfohlene Antworten

Veröffentlicht

Hallo,

ich will eine Suche & Biete Seite machen. Habe da nur ein Problem. Ich will bei der Ausgabe die aktuellen Datensätze zuerst stehen haben. Ich hab jedoch die aktuellen Datensätze ganz hinten. Naja guckt euch einfach mal den Quelltext an, vielleicht kann mir jemand helfen. Ich muss in 6er Schritten dekrementieren. Da fällt mir keine logik momentan ein :-)

Gruß

debitux


<?php


// AUSGEBEN DER DATEN...


include "func/glvar.php";

include "func/connect.php";


echo " 

<h1>Suche und Biete</h1><br>

<p>

<form method=\"post\" action=\"http://".$webserver."?links=text/ausgabe.php\">

<input type=\"submit\" name=\"button\" value=\"Suche\">

<input type=\"submit\" name=\"button\" value=\"Biete\">

</form>

";


// Ich hab das nicht anders hinbekommen da die Formdaten verloren gehen...

if($button=="Biete")

{

	$sel="tbl_biete";

}

elseif($button=="Suche")

{

	$sel="tbl_suche";

}

elseif($hilfs=="Biete")

{

	$button="Biete";

	$sel="tbl_biete";

}

elseif($hilfs=="Suche")

{

	$button="Suche";

	$sel="tbl_suche";

}

else

{

	$button="Suche";

	$sel="tbl_suche";

}


$selex=explode("tbl_", $sel);


mysql_select_db($daba);

$result = mysql_query("SELECT * FROM $sel");


for($i=0;$i<mysql_num_rows($result);$i++)

{

$ergebnis[$i]=mysql_fetch_array($result);

}



$gesamt = (count($ergebnis)+1)/6;

echo $button; 

for($i=0;$i<$gesamt;$i++)

{

echo "  <a href=$PHPSELF?links=text/ausgabe.php&index=$i&hilfs=$button>".$i."</a>";

}


echo "<br>";


$x = $index*6;

echo $x." - ".($x+5)." Datensätze<br>";	


For($j=$x;$j<(($index*6)+6);$j++)

{

	if($ergebnis[$j][name])

        {

		echo "

		<table class=tabledata>

		<hr>

 		".$j."

		<tr>	

 		 <td colspan=4 class=eintrag>Eintrag vom ".$ergebnis[$j][datum]."</td>

		</tr>

		<tr>

 		 <td class=eintragdata>Name: </td>

 		 <td align=center>".$ergebnis[$j][name]."</td>

 		 <td class=eintragdata>Amt: </td>

 		 <td align=center>".$ergebnis[$j][amt]."</td> 

 		</tr>

		<tr>

 		 <td class=eintragdata>Vorname: </td>

 		 <td align=center>".$ergebnis[$j][vname]."</td>

 		 <td class=eintragdata>Tel.: </td>

 		 <td align=center>".$ergebnis[$j][telefon]."</td>

		</tr>

		<tr>

 		 <td align=center colspan=4 class=eintragdata>Artikel: </td>

		</tr>

		<tr> 

 		 <td align=center colspan=4>".$ergebnis[$j][$selex[1]]."</td>

		</tr>

		</table>

		";

		echo $sel;

	}

}

echo "  <br><br>

	<a href=http://".$webserver."?links=text/eingabe.php>Zur Eingabemaske</a><br>

        <a href=http://".$webserver."?links=text/admin.php>Zur Adminseite</a>";


mysql_close($link);

?>

</p>

Ich blödi hab einfach den sql String geändert :-) Aber würde mich trotzdem mal interessieren wie ich eine Gesamtdatensatzanzahl dekrementieren kann in 6er Schritten.

Ich kann dem ganzen nicht ganz folgen :-(

Wenn du die neusten Datensätze zuerst haben möchtest, kann st in die query ein "ORDER by ..." einbauen und dann ist das erledigt.

Was ist denn nun mit dem um 6 dekrementieren gemein? Was willst du denn verringern?

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.