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.

Multiple Formular und SQL Abfrage

Empfohlene Antworten

Veröffentlicht

Hallo !

Ich habe ein formular erstellt indem man eine Mehrfachauswahl treffen kann, diese sollen nun überprüft und abgearbeitet werden und ausgegeben werden. Bei EINER Auswahl funkt es jedoch nicht bei einer Mehrauswahl. Hier meine Script Teile :

:

:

<u><b>Kundenauswahl</b></u><form NAME="myform" ACTION="wahla.asp">

<select NAME="inkat" Size="5" multiple>

<option Value="1">--- Kategorieauswahl ---

<%Do while not (RS.EOF)%>

<option Value="<%=RS("CustomerName")%>"><%=RS("CustomerName")%>

<% RS.MoveNext %>

<% Loop %>

</select>

<p>

<input NAME="SUBMIT" TYPE="SUBMIT" value="Anzeigen">

<input NAME="Reset" TYPE="RESET">

</form>

.

.

.

.

<%

Set Conn = Server.CreateObject("ADODB.Connection")

Conn.Open "itcatalog"

sql = "SELECT distinct CustomerName, CustomerCountry, CustomerPlace FROM tCustomers WHERE CustomerName='"&Request.QueryString("inkat")&"'"

Set RS = Conn.Execute(sql)

%>

<center>

.

.

.

<% if rs.eof and rs.bof then %>

Keine Datensätze vorhanden

<BR>

<% else

RS.MoveFirst %>

<table border= 2>

<tr> <td><b><u>Customer</b></u>

</td>

<td><b><u>Country</b></u>

</td>

<td><b><u>Place</b></u>

</td>

</tr>

<%Do while not (RS.EOF)%>

<tr> <td align="left"><%=RS("CustomerName")%>

</td>

<td><%=RS("CustomerCountry")%>

</td>

<td align="right">

<%=RS("CustomerPlace")%>

<td align="middle">

<% RS.MoveNext %>

<% Loop %>

</td>

</td>

</tr>

</table>

<% end if %>

.

.

.

Hallo,

Entscheidend ist, daß der Name der Variablen im <select>-Tag mit eckigen Klammern endet, damit ein Array erzeugt wird. Das Script erhält dann diese Variable $avar als Array und kann die Werte dieses Arrays aufzählen.

Gruß Jaraz

Hallo !

Kannst du mir das genauer erklären....

du musst aus: <select NAME="inkat" Size="5" multiple>

<select NAME="inkat[]" Size="5" multiple> machen.

Nun bekommst du ein array mit dem Namen inkat und den Werten die du bei den Options angeklickt hast.

In Asp kannst du nun irgendwie auf die Array Elemente zugreifen.(Keine Ahnung wie, kann kein ASP). :marine

In PHP so:


for($i=0;$i<count($inkat);$i++){

    echo $inkat[$i]."<br>";

}

Gruß Jaraz

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.