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.

Empfohlene Antworten

Veröffentlicht

Zu meinem/r Problem/Frage:

Ich habe jetzt meine Datenbank fertig und würde für meine Application gerne eine Suchfunktion basteln.

Mit cfform hab ich die Eingabefelder gebastelt und frage hinterher die DB, ob der gesuchte Begriff mit den Einträgen in der DB übereinstimmt.

Soweit kommt keine Fehlermeldung mehr, dass mit der Syntax etwas nicht stimmt, oder etwas nicht definiert sei. Jedoch erhalte ich auch kein Ergebnis meiner Suche, die Seite aktualisiert lediglich neu.


<cfform method = "post" name = "form">

<table border="0">

<tr><td>Genre:</td><td><cfinput type = "text" name = "genre" size="21"></td></tr>

<tr><td>Filmtitel</td><td><cfinput type = "text" size="22" name = "filmtitel"></td></tr>

<tr><td>Darsteller/in:</td><td><cfinput type = "text" size="22" name = "darsteller"></td></tr>


<tr></tr><tr></tr><tr></tr><tr></tr>

<tr><td><input type = "submit" name = "suchen" value = "Suche"></td></tr></table>

</cfform>


<cfquery name = "suche" datasource = "#application.datasource#">

	SELECT * from filme 

	WHERE fi_genre = 'genre' OR fi_name = 'filmtitel' OR fi_darsteller = 'darsteller'

</cfquery>


<cfoutput query = "suche">

...

</cfoutput>

Ich denke mal, dass der Fehler bei der output query liegen wird.

1. als erstes solltest du angeben, welches DBMS du verwendest. Ich würde jetzt raten Mysql, aber das wär was wichtiges zu wissen.

2. Eine Suche würde ich nicht mit fixem spalte1 = 'wert' schreiben, sondern per like (Mysql / TSQL). Vorallem bei Freitexteingabe, würdest du Dropdowns verwenden wäre das was anderes, aber dann wärs auch keine "suche" mehr sondern eine Auswahl.

Erstelle ein Konto oder melde dich an, um einen Kommentar zu schreiben.

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.