When serialize()ing an array containing the data of the last created blogpost there was no error at first.
But if the data were fetched from the database and the script tried to unserialize() them the following error occured:
So why is this?
Lets say you have an array with 3 indizes containing 2 strings and one integer.
As you can see the single quote in the second array-element is escaped by a backslash.
If you now serialize the data you get the following string
If this string is now written to the database the backslashes disappears and the field contains the following data:
As the considerate reader might have discovered the length of the highlighted string was first 25 characters and is after inserting into the database 24 characters long.
So if PHP tries to unserialize the string it thinks it has to read 25 characters but there are only 24. This throws the above error.
So how can you circumvent this?
So the backslashes are removed before serializing the data and added afterwards to prevent database malfunctions or errors.
Nachdem Michelle mich darauf aufmerksam gemacht hat, dass im Seitenmenü die doppelte Anzahl an Seiten zB bei den Kategorien angezeigt werden als eigentlich vorhanden sein sollten hab ich mich auf Fehlersuche gemacht.
Nachdem ich ein fehlendes DISTINCT zuerst für den Verantwortlichen gehalten habe bin ich nach einiger Zeit draufgekommen, dass beim Portieren der Software der Inhalt 2 mal eingefügt wurde.
Ich hatte also eine 2spaltige Tabelle mit mehreren Tausend Einträgen und diese waren je 2 mal vorhanden. Was also tun? Manuell kann man das vergessen. Mit normalen Abfragen is mir auch nix eingefallen und siehe da das Glasgoogle hat geholfen und folgendes zu Tage gebracht: Doppelte Einträge löschen (ganz unten)
Es wird ein UNIQUE Index auf die gewähljten Felder gelegt und da er UNIQUE ist, sind keine doppelten Einträge erlaubt.
Ignore ist dabei das Stichwort: Dadurch werden doppelte Einträge einfach gelöscht. Sache gelöst. Juhu :D
Mhm, hab grad meine ersten (bewussten) DOM-Schritte gemacht. Schon ziemlich mächtig das Zeug. Trotzdem is Javascript ned wirklich meine Sprache...Naja das was ich wollte geht ja mal. Bald zu sehen in PotaBlog 2.0 :)
Bwah, derzeit arbeite ich grad am Release 2.0 von PotaBlog. Da sich einige Dinge grundlegend verändern, ist es ein weitaus größerer Aufwand, als erwartet.
Bin gerade 3 Stunden gesessen und hab nur Texte aus Templates in Variablen kopiert und diese Texte ins Englische übersetzt -_-
Wenn man mittels setcookie() mit PHP ein Cookie auf einem Apache-Server unter Windows für Firefox oder IE 7 senden will, der auf localhost läuft, so ist folgende Syntax von nöten:
Folgendes weiß dazu das manual
Somit muss man den Wert Domain anstatt wie es sich gehört auf localhost auf false setzen.
Das hat mich wieder nerven gekostet....