background preloader

PHP

Facebook Twitter

Forumsarchiv / 2002 / November / sort() - Die deutschen Umlaute (ÄÖÜ)??? Sort() - Die deutschen Umlaute (ÄÖÜ)??? Markus 17. 11. 2002, 13:21 Hallo, problem: Ein Array wird mit sort() Sortiert. Die einzelnen Elemente enthalten aber (manchmal) ein "ö" (Das bei späterer Ausgabe ja ein ö wird). Diese Elemente (mit Umlauten am Anfang) werden aber nicht richtig sortiert. Die Sortierten Umlaute sind immer vor allen anderen buchstaben´(noch vor A). An was liegt das??? GrussMarkus zeige Thread in Listen-Ansicht Andreas Korthaus 17. 11. 2002, 13:40 > Hallo,> > problem: Ein Array wird mit sort() Sortiert. Am bestenb baust Du das einrfach nur in eine Userspezifische Sort-Funktion ein, mit dann brauchst Du den array nichtmal zu verändern. Unter If you want to sort an array according to your locale do the following:(de_DE as example) setlocale("LC_ALL","de_DE");usort($arraytobesorted, 'strcoll'); GrüßeAndreas.

Sorting Arrays. Natcasesort. Doppelte Einträge im Array löschen - PHP-Kurs.com - PHP programmieren lernen. Newsgroups.derkeiler.com/pdf/Archive/De/de.comp.lang.java/2007-11/msg00032.pdf. Forumsarchiv / 2006 / August / Doubletten aus Array entfernen. JAVASCRIPT Doubletten aus Array entfernen Sebastian 28. 08. 2006, 12:44JAVASCRIPT Doubletten aus Array entfernen Sven Rautenberg 28. 08. 2006, 13:03JAVASCRIPT Doubletten aus Array entfernen molily 28. 08. 2006, 14:18JAVASCRIPT Doubletten aus Array entfernen Sebastian 28. 08. 2006, 14:59JAVASCRIPT Doubletten aus Array entfernen wahsaga 28. 08. 2006, 15:16JAVASCRIPT Doubletten aus Array entfernen Struppi 28. 08. 2006, 16:35JAVASCRIPT Doubletten aus Array entfernen Sebastian 28. 08. 2006, 17:17 Doubletten aus Array entfernen Sebastian 28. 08. 2006, 12:44 Hy, Ich habe hier eine Funktion gebastelt, die aus einem Array Doubletten herausfiltern soll, die durch das mehrmalige Ausführen der Funktion test() an einem bestimmten Element entstehen. var elemente = new Array(); function test(element){ elemente.push(element.id); elemente.sort(); for ( i = 0; i < elemente.length; i++){ while (elemente[i] == elemente[i-1])elemente.splice(i,1); Ein solches Array würde ohne sort() z.B. so aussehen: Schön und gut !

8 Experts Break Down the Pros and Cons of Coding With PHP. The Web Development Series is supported by Rackspace, the better way to do hosting. Learn more about Rackspace's hosting solutions here. We've been asking a panel of experts for advice and insights about PHP over the past several weeks. In recent posts, our "PHP masters" gave helpful hints for beginners as well as some pointers for intermediate and advanced coders.

For the last post in this series, we've turned to the same experts with some more general questions: What makes PHP a good language? What are some of PHP's drawbacks? And what are the best apps or cleverest hacks you've seen made with and/or for PHP? Here are their answers; we'd also love to get your thoughts in the comments. 1. Naramore is a SourceForge employee and founded PHPWomen.org. She told us in an e-mail, "One of PHP's biggest strengths is also one of its limitations. When it comes to PHP done right, Naramore says she's a big fan of Sebastian Bergmann's testing framework, PHPUnit, which was written in and for PHP. 2. 3. PHP function to escape MySQL regexp syntax. Forumsarchiv / 2004 / Juni / Bestimmtes Array-Element löschen. Die deutschsprachige Ressource für PHP und MySQL- Artikel.

Jetzt machen wir uns an eine Stichwortsuche. Dazu müssen wir zB ein String an ein PHP Skript übergeben. Ich habe mal die Suche gleich mit in die main.php eingebaut. Wichtig ist eigendlich hierbei nur diese zusätzliche Card: Der Inhalt des Textfeldes "suchtext" wird in der URL an die main.php übergeben. Dieses funktioniert auch bei Checkboxen usw. In der main.php steht ganz zu Beginn eine Abfrage, ob die Variable $suchtext initialisiert wurde. ( bei der Übergabe an ein PHP Skript wird die Variable suchtext in der URL automatisch zu einer Variable $suchtext ) Denn wird eine Datenbankabfrage gestellt und je nach Ergebnis wird die Rückgabe gestaltet: Ich hoffe das ist alles nicht zu verwirrend, aber ich denke, das das alles noch recht einfach gehalten ist.

Dazu machen wir wieder eine neue Card "editor". Die Ausgabe mit den gefunden Begriffen wird sich wie folgt ändern: Wie Sie bereits sehen, zeigt der Link zum Editieren auf eine separate Datei. Wichtig ist nur folgender Ausschnitt: wml Seite 1: Tutorial - Blätterfunktion mit PHP & mySQL - PHPWelt.de. Suchabfrage starten Voraussetzung ist eine Datenbank mit genügend Inhalt.

Als erstes fragen wir ab ob eine Seitenzahl gesetzt ist: Fehlt die Variable $pagenum oder ist sie leer so wird sie auf 1 gesetzt. if(! Isset($pagenum) or $pagenum==0 or empty($pagenum)): $pagenum = 1; endif; Nun legen wir in der Variablen $perpage noch die Anzahl der Elemente fest, die pro Seite angezeigt werden sollen.

In diesen Beispiel sind es 5 Elemente pro Seite. Nachdem die Vorarbeit geleistet ist, fehlt nur noch das obere und untere Limit, das wir wie folgt definieren: $limitlower =($pagenum-1)*$perpage+1; $limitupper =$pagenum * $perpage; Jetzt folgt der mySQL Teil: Wir brauchen 2 mySQL Resultate. $sql = "select SPALTE1,SPALTE2 from TABELLE limit ". $limitlower-1 = errechnet den Startwert für die Ausgabe der Daten $perpage bestimmt die Anzahl der Daten, in unseren Fall also die obigen 5 $sql_hits = "select count(*) as hits from TABELLE; $r_sql_hits = mysql_query($sql_hits,$db); $r_sql = mysql_query($sql,$db); ?

DSP: Datenbank, MySQL und PHP. Date: 19. Juni 2005 Diese Anleitung, die sich gleichermaßen an Anfänger wie allgemein Interessierte in Sachen Datenbanken, SQL und PHP richtet, versucht schrittweise und spielerisch in die Geheimnisse der dynamischen Informationsverarbeitung im WWW einzuführen. Von der Datenbank-Theorie und -Praxis (am Beispiel MySQL) über die webfreundliche Scriptsprache PHP (inklusive Themen wie Datenbank-Anbindung und Objektorientierung) bis hin zu XML wird auf leicht verständliche Art beschrieben, welche Möglichkeiten moderne Technologien bieten, Webseiten dynamisch zu gestalten. Nicht fehlen dürfen dabei natürlich die zahlreichen Beispiele und und Hinweise; so gibt es u.a. auch ein Kapitel, das sich mit der Behandlung und Vermeidung von Fehlern beschäftigt.

Die aktuelle Version sowie verschiedene Formate zum Herunterladen befinden sich unter DSP - Datenbank SQL PHP Copyright (c) 2000 by Christoph Reeg (dsp@reeg.net). Der Schattenbaum - Claudia Unkelbach - Tutorials, PHP, Seife. Php suche in mysql datenbank - Forumarchiv - phpforum.de das deutsche PHP-Forum. Hier finden Sie alles über PHP, MySQL, ASP, JSP,Linux, Apache ... Sie befinden sich hier im Forenarchiv von phpforum.de wenn Sie direkt ins Forum möchten, klicken Sie bitte hier. Zur Startseite kommen Sie hier. Hallo ich bin noch php Anfänger und hab hier eine newbie frage: Ich hab eine Sql-Datenbank in der ich Namen und weitere Informationen zu dem Namen gespeichert habe. Jetzt möchte ich gerne mit php ein Suchscript schreiben was, wenn man den Namen eingibt, alle Infos zu dem User ausgibt.

Weiter als so komme ich nicht: Code: In Zwischenablage kopieren (nur IE) ???? Antworten [doc]mysql_error[/doc] hm ... ich hab jetzt die zeile: $sql = mysql_query("SELECT * " . " FROM `$tabelle` where keyworld like `$suchen`"); in $sql = mysql_query("SELECT * FROM `$tabelle` where name like '%". geändert. Der mysql_error sag nach der änderung nichts mehr. Was hat das zu bedeuten? $sql ist ein Zeiger auf die zurückgelieferte Ergebnisliste. Ok geht ! Danke schön gutes forum ! Coppermine Photo Gallery.

Regex

[PHP-MySQL] Suche durch eine Datenbank. How to select the first/least/max row per group in SQL at Xaprb. Thu, Dec 7, 2006 in Databases Here are some common SQL problems, all of which have related solutions: how do I find the most recent log entry for each program? How do I find the most popular item from each category? How do I find the top score for each player? In general, these types of “select the extreme from each group” queries can be solved with the same techniques. I’ll explain how to do that in this article, including the harder problem of selecting the top N entries, not just the top 1.

This topic is related to numbering rows, which I just wrote about (see my articles about MySQL-specific and generic techniques to assign a number to each row in a group). Selecting the one maximum row from each group Let’s say I want to select the most recent log entry for each program, or the most recent changes in an audit table, or something of the sort. There are a few common solutions to this problem. One common solution is a so-called self-join. Select the top N rows from each group Yuck! 25 Essential PHP Functions. This is a list of 25 interesting PHP functions that are useful in a variety of situations. Please do not make changes to the actual set of functions without first discussing them on the talk page.

Function list[edit] Following is the raw list of 25, in alphabetical order: Ceil()[edit] float ceil (float value) Rounds up the supplied float value to the next integer and returns the result. Usage[edit] Practical applications[edit] Can be used to check if a number divides evenly with another - for example: See also[edit] Floor() - Rounds down the supplied float value to the next integer and returns the result. Count()[edit] int count (mixed var) Returns an integer value of the number of elements in the supplied variable - generally an array, as anything else will return 1. Usage[edit] Practical applications[edit] Handling every element of an array - for example: Bear in mind that this could be done without count() using the foreach case structure anyway. Die()[edit] void die ([string status]) Usage[edit] <? <? I’m sorry, but PHP sucks! » Jonas Maurus’ maurus.net. Tim Bray says: “based on my limited experience [...] all the PHP code I’ve seen in that experience has been messy, unmaintainable crap.

Spaghetti SQL wrapped in spaghetti PHP wrapped in spaghetti HTML, replicated in slightly-varying form in dozens of places”. Right off the bat: there are things to like about PHP. I will list those first, to get them out of the way. I think this is important so that I don’t get mail that basically says: “yeah, but X”. “PHP makes it easy to get things done for a beginner” This statement is absolutely, positively, true.

Unfortunately, that’s where the fun ends. This is why it sucks. Conclusion I maintain that of all the dynamically-typed (or freedom) languages PHP has the most-approachable syntax especially for developers coming from the typical statically-typed languages. That said, I am a huge advocate for choosing “the right tool for the job” and that, of course, means that you might want to choose PHP under the right circumstances. Have fun! Changelog. Best PHP Scripts | PHP Social Networking.