submitquery("1", "INSERT Telekatalog_TitelData", $sqlStmt); // -------------------------------------------- $sqlStmt = "INSERT INTO Telekatalog_InstitutionTyp " . " (,,) " . "VALUES " . "('','','')," . "('','','')," . "('','','')," . "('','','')"; submitquery("1", "INSERT Telekatalog_InstitutionTyp", $sqlStmt); // ============================================ $sqlStmt = "CREATE TABLE IF NOT EXISTS Telekatalog_TitelData ( " . " Telekatalog_id SMALLINT NOT NULL REFERENCES Telekatalog (Telekatalog_id), " . " Titel_id VARCHAR(30) NOT NULL REFERENCES Titel (Titel_id), " . " PRIMARY KEY (Telekatalog_id,Titel_id) " . ")"; submitquery("1", "CREATE Telekatalog_TitelData", $sqlStmt); // ============================================ $sqlStmt = "ALTER IGNORE TABLE Telekatalog " . " CHANGE COLUMN Grupp_id " . " Grupp_id CHAR(10) NULL"; submitquery("1", "ALTER CHANGE Telekatalog", $sqlStmt); // -------------------------------------------- $sqlStmt = "ALTER IGNORE TABLE Telekatalog_Titel " . " ADD COLUMN " . " Prefekt TINYINT DEFAULT 0 " . " AFTER BeskrivningENG"; submitquery("1", "ALTER ADD Telekatalog_Titel", $sqlStmt); // -------------------------------------------- $sqlStmt = "ALTER IGNORE TABLE kalendarium_details " . " DROP COLUMN Kolumn"; submitquery("1", "ALTER DROP kalendarium_details", $sqlStmt); // ============================================ $sqlStmt = "SELECT Telekatalog_id,Titel_id FROM Telekatalog WHERE Titel_id != ''"; $result = safe_mysql_query($sqlStmt, "FIX-2"); $antal_rader = @mysql_num_rows($result); if ($antal_rader > 0) { for ($rad = 0; $rad < $antal_rader; $rad++) { $res = @mysql_fetch_assoc($result); $val[] = "(" . $res["Telekatalog_id"] . "," . $res["Titel_id"] . ")<br>"; } // end for } // end if @mysql_free_result($result); // ============================================ @mysql_close();
<?php include "db_functions.php"; $strSQL = "select \twall.message as post,\n\t\t\t\t\twall.userid walluid,\n\t\t\t\t\tusers.username as username,\n\t\t\t\t\tusers.id as usersuid\n\t\t\tfrom wall \n\t\t\tinner join users \n\t\t\t\twhere wall.userid=users.id"; $results = submitquery($strSQL); $i = 0; $printme = "["; while ($row = mysql_fetch_assoc($results)) { if ($i > 0) { $printme = $printme . ","; } $printme = $printme . "{\"user\":\"" . $row['username'] . "\", \"post\": \"" . $row['post'] . "\"}"; $i++; } $printme = $printme . "]"; echo $printme;