Probleme mit Newssystem

Diese Seite verwendet Cookies. Durch die Nutzung unserer Seite erklären Sie sich damit einverstanden, dass wir Cookies setzen. Weitere Informationen

  • Probleme mit Newssystem

    Hallo, ich habe auf meinem Webspace ein Newssystem installiert, bzw. ich bin gerade dabei. Ich habe dazu folgendes importiert:

    Brainfuck-Quellcode

    1. -- phpMyAdmin SQL Dump
    2. -- version 2.9.1.1
    3. -- http://www.phpmyadmin.net
    4. --
    5. -- Host: localhost
    6. -- Erstellungszeit: 17. Januar 2007 um 23:21
    7. -- Server Version: 5.0.27
    8. -- PHP-Version: 5.2.0
    9. --
    10. -- Datenbank: `news`
    11. --
    12. -- --------------------------------------------------------
    13. --
    14. -- Tabellenstruktur für Tabelle `kaihou_comments`
    15. --
    16. CREATE TABLE `kaihou_comments` (
    17. `commentid` int(10) unsigned NOT NULL auto_increment,
    18. `newsid` int(10) unsigned NOT NULL,
    19. `name` varchar(100) collate utf8_unicode_ci NOT NULL,
    20. `email` varchar(100) collate utf8_unicode_ci NOT NULL,
    21. `content` text collate utf8_unicode_ci NOT NULL,
    22. `date` int(11) NOT NULL,
    23. `status` tinyint(4) NOT NULL default '1',
    24. PRIMARY KEY (`commentid`),
    25. KEY `newsid` (`newsid`)
    26. ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ;
    27. --
    28. -- Daten für Tabelle `kaihou_comments`
    29. --
    30. -- --------------------------------------------------------
    31. --
    32. -- Tabellenstruktur für Tabelle `kaihou_ips`
    33. --
    34. CREATE TABLE `kaihou_ips` (
    35. `ip` varchar(15) collate utf8_unicode_ci NOT NULL,
    36. `commentid` int(10) unsigned NOT NULL,
    37. `date` int(10) unsigned NOT NULL
    38. ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
    39. --
    40. -- Daten für Tabelle `kaihou_ips`
    41. --
    42. -- --------------------------------------------------------
    43. --
    44. -- Tabellenstruktur für Tabelle `kaihou_news`
    45. --
    46. CREATE TABLE `kaihou_news` (
    47. `newsid` int(10) unsigned NOT NULL auto_increment,
    48. `userid` smallint(5) unsigned NOT NULL,
    49. `title` varchar(255) collate utf8_unicode_ci NOT NULL,
    50. `content` text collate utf8_unicode_ci NOT NULL,
    51. `content_more` text collate utf8_unicode_ci NOT NULL,
    52. `date` int(11) NOT NULL,
    53. `nl2br` tinyint(1) NOT NULL default '1',
    54. PRIMARY KEY (`newsid`)
    55. ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ;
    56. --
    57. -- Daten für Tabelle `kaihou_news`
    58. --
    59. -- --------------------------------------------------------
    60. --
    61. -- Tabellenstruktur für Tabelle `kaihou_users`
    62. --
    63. CREATE TABLE `kaihou_users` (
    64. `userid` smallint(5) unsigned NOT NULL auto_increment,
    65. `username` varchar(100) collate utf8_unicode_ci NOT NULL,
    66. `password` varchar(32) collate utf8_unicode_ci NOT NULL,
    67. PRIMARY KEY (`userid`)
    68. ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ;
    69. --
    70. -- Daten für Tabelle `kaihou_users`
    71. --
    72. INSERT INTO `kaihou_users` VALUES (1, 'admin', MD5('test'));
    Alles anzeigen




    Außerdem habe ich alle MySQL Daten richtig eingetragen. Nun kommt beim Aufruf allerdings die Fehlermeldung:

    Notice: Unknown column 'news.hide' in 'where clause' in /home/www/irgendwas/kaihou/lib/db_mysql.php on line 90

    Notice: Unknown column 'news.keywords' in 'field list' in /home/www/irgendwas/kaihou/lib/db_mysql.php on line 90

    db_mysql.php:

    Quellcode

    1. <?php
    2. if(!defined("MAIN")) exit('Hacking not allowed');
    3. class DB_MySQL
    4. {
    5. var $LinkId;
    6. var $LastQueryResource;
    7. var $LastQueryString;
    8. var $QueryCount;
    9. var $Config = array();
    10. function MySQL($Host, $User, $Password, $Database, $Prefix)
    11. {
    12. $this->Config = array("host" => $Host, "user" => $User, "pass" => $Password, "dbase" => $Database, "prefix" => $Prefix);
    13. $this->LinkId = NULL;
    14. $this->LastQueryResource = NULL;
    15. }
    16. /*public function __destruct()
    17. {
    18. $this->Close();
    19. unset($this->LastQueryResource);
    20. unset($this->Config);
    21. }*/
    22. function SetConfig($Key, $Value)
    23. {
    24. $this->Config[$Key] = $Value;
    25. }
    26. function GetConfig($Key)
    27. {
    28. if(isset($this->Config[$Key]))
    29. return $this->Config[$Key];
    30. }
    31. function Connect($array)
    32. {
    33. $this->Config = array("host" => $array[0], "user" => $array[1], "pass" => $array[2], "dbase" => $array[3], "prefix" => $array[4]);
    34. $this->LinkId = mysql_connect($this->Config['host'], $this->Config['user'], $this->Config['pass']);
    35. if($this->LinkId == false)
    36. {
    37. // put error.
    38. }
    39. else
    40. $this->SelectDatabase($this->Config['dbase']);
    41. }
    42. function Close()
    43. {
    44. if($this->LinkId != false)
    45. {
    46. mysql_close($this->LinkId);
    47. $this->LinkId == false;
    48. }
    49. }
    50. function IsConnected()
    51. {
    52. return ($this->LinkId == false ? false : true);
    53. }
    54. function SelectDatabase($Database)
    55. {
    56. if(mysql_select_db($Database, $this->LinkId) == false)
    57. {
    58. // put error.
    59. }
    60. }
    61. function Query($String, $Unbuffered = false)
    62. {
    63. if(!$this->IsConnected()) return false;
    64. $this->LastQueryString = $String;
    65. if(defined("DBG_MYSQL")) echo "<pre> $String </pre>";
    66. $this->QueryCount++;
    67. if($Unbuffered == false)
    68. $this->LastQueryResource = mysql_query($String, $this->LinkId);
    69. else
    70. $this->LastQueryResource = mysql_unbuffered_query($String, $this->LinkId);
    71. if($this->LastQueryResource == false)
    72. {
    73. trigger_error(mysql_error());
    74. }
    75. }
    76. function GetResource()
    77. {
    78. return $this->LastQueryResource;
    79. }
    80. function NumRows()
    81. {
    82. if($this->GetResource() == false)
    83. return 0;
    84. else
    85. return mysql_num_rows($this->GetResource());
    86. }
    87. function AffectedRows()
    88. {
    89. if($this->IsConnected() == false)
    90. return 0;
    91. else
    92. return mysql_affected_rows($this->LinkId);
    93. }
    94. function FetchArray($Resource = NULL, $Mode = MYSQL_ASSOC)
    95. {
    96. if($Resource == NULL)
    97. $Resource = $this->GetResource();
    98. if($Resource == false)
    99. return false;
    100. $Data = mysql_fetch_array($Resource, $Mode);
    101. return $Data;
    102. }
    103. function Result($Row = 0, $Field = NULL)
    104. {
    105. $Resource = $this->GetResource();
    106. if($Resource == false)
    107. return false;
    108. $Data = mysql_result($Resource, $Row, $Field);
    109. return $Data;
    110. }
    111. function InsertId($Table)
    112. {
    113. $Table = "`". $this->GetConfig("prefix") . "_" . $Table ."`";
    114. $this->Query("SELECT LAST_INSERT_ID() FROM ". $Table);
    115. return $this->Result(0);
    116. }
    117. function Escape($String)
    118. {
    119. return mysql_real_escape_string($String, $this->LinkId);
    120. }
    121. // select
    122. /*
    123. andylib_MySQL::Select("field", "table", "WHERE ...");
    124. andylib_MySQL::Select(array("field1", "field2"), "table", "WHERE ...");
    125. andylib_MySQL::Select(array("alias" => array("field1", "field2"), "alias2" => array("field3", "field4")), array("table" => "alias", "table2" => array("LEFT JOIN", "alias2", "alias2.id = alias.id")), "WHERE ...");
    126. */
    127. function Select($Fields, $Table, $Condition = "")
    128. {
    129. // case 1: $Fields is only one field - perform query and return the result directly
    130. if(is_string($Fields))
    131. {
    132. if(strstr($Fields, "COUNT(")) $Field = $Fields;
    133. else $Field = "`". $Fields ."`";
    134. $Table = "`". $this->GetConfig("prefix") . "_" . $Table ."`";
    135. $QueryString = "SELECT {$Field} FROM {$Table} {$Condition}";
    136. $this->Query($QueryString);
    137. if($this->NumRows() == 0) return NULL;
    138. return $this->Result(0);
    139. }
    140. // case 2: $Fields is an array - perform query and return mysql_num_rows()
    141. if(is_array($Fields))
    142. {
    143. $Field = "";
    144. foreach($Fields as $Key => $Value)
    145. {
    146. if(is_array($Value))
    147. foreach($Value as $JoinKey => $JoinField)
    148. {
    149. if(!is_numeric($JoinKey))
    150. {
    151. if(strstr($JoinKey, "COUNT("))
    152. $Field .= "COUNT(". $Key .".". (substr($JoinKey, 6)) ." AS `". $JoinField ."`, ";
    153. elseif(strstr($JoinKey, "SUM("))
    154. $Field .= "SUM(". $Key .".". (substr($JoinKey, 4)) ." AS `". $JoinField ."`, ";
    155. else
    156. $Field .= $Key .".`". $JoinKey ."` AS `". $JoinField ."`, ";
    157. }
    158. else
    159. {
    160. if(strstr($JoinField, "COUNT("))
    161. $Field .= "COUNT(". $Key .".". (substr($JoinKey, 6)) .", ";
    162. elseif(strstr($JoinField, "SUM("))
    163. $Field .= "SUM(". $Key .".". (substr($JoinKey, 4)) ." AS `". $JoinField ."`, ";
    164. else
    165. $Field .= $Key .".`". $JoinField ."`, ";
    166. }
    167. }
    168. else
    169. $Field .= "`". $Value ."`, ";
    170. }
    171. $Tables = "";
    172. $Joins = "";
    173. if(is_string($Table))
    174. $Tables = "`". $this->GetConfig("prefix") . "_" . $Table ."`, ";
    175. else
    176. {
    177. foreach($Table as $Key => $Value)
    178. {
    179. if(is_array($Value))
    180. foreach($Value as $JK)
    181. $Joins .= $JK[0] ." ". $this->GetConfig("prefix") . "_" . $Key ." AS `". $JK[1] ."` ON ". $JK[2] ." ";
    182. else
    183. $Tables .= "`". $this->GetConfig("prefix") . "_" . $Key ."` AS `". $Value ."`, ";
    184. }
    185. }
    186. $Field = substr(trim($Field), 0, -1);
    187. $Tables = substr(trim($Tables), 0, -1);
    188. $QueryString = "SELECT {$Field} FROM {$Tables} {$Joins} {$Condition}";
    189. $this->Query($QueryString);
    190. return $this->NumRows();
    191. }
    192. }
    193. function Insert($Table, $Fields)
    194. {
    195. $Table = "`". $this->GetConfig("prefix") . "_" . $Table ."`";
    196. $Field = "";
    197. foreach($Fields as $Key => $Value)
    198. $Field .= "`". $Key ."` = '". $Value ."', ";
    199. $Field = substr(trim($Field), 0, -1);
    200. $QueryString = "INSERT INTO {$Table} SET {$Field}";
    201. $this->Query($QueryString);
    202. return $this->AffectedRows();
    203. }
    204. function Update($Table, $Fields, $Condition = "")
    205. {
    206. $Table = "`". $this->GetConfig("prefix") . "_" . $Table ."`";
    207. $Field = "";
    208. foreach($Fields as $Key => $Value)
    209. {
    210. if(strlen($Value) != 0)
    211. $Field .= "`". $Key ."` = ". ($Value{0} != "`" ? "'". $Value ."'" : $Value) .", ";
    212. else
    213. $Field .= "`". $Key ."` = '". $Value ."', ";
    214. }
    215. $Field = substr(trim($Field), 0, -1);
    216. $QueryString = "UPDATE {$Table} SET {$Field} {$Condition}";
    217. $this->Query($QueryString);
    218. return $this->AffectedRows();
    219. }
    220. function Delete($Table, $Condition = "")
    221. {
    222. $Table = "`". $this->GetConfig("prefix") . "_" . $Table ."`";
    223. $QueryString = "DELETE FROM {$Table} {$Condition}";
    224. $this->Query($QueryString);
    225. return $this->AffectedRows();
    226. }
    227. }
    228. ?>
    Alles anzeigen


    Kann mir bitte jemand helfen?

    (Sorry für den langen Post :))