Nieuw lid |
|
Hallo iedereen,
Ik heb een bestaande php-site(waarvan ik niet de originele auteur ben) van onze server gehaald voor deze lokaal te bewerken. Deze kan je hier downloaden:
http://www.medi...f6e8ebb871
Ik probeer deze site nu werkende te krijgen, in de .rar waarnaar ik hierboven gelikt heb staat een soort van installatiegids, readme_install.txt. Ik heb deze zoveel mogelijk proberen volgen maar toch krijg ik een fout.
Ik heb phpmyadmin geinstalleerd, en hier draait er een mysql server. (bij de statuspagina van phpmyadmin zie ik: 'Deze MySQL server draait inmiddels 0 dagen, 0 uren, 23 minuten en 20 seconden. Hij is gestart op 09 Jul 2009 om 16:39.' )
Nu heb ik deze website lokaal geinstalleerd en krijg ik de volgende error bij het opstarten:
Notice: A session had already been started - ignoring session_start() in C:\wamp\www\WebProcedures\config.inc.php on line 2
mtStart = $this->getMicroTime(); $this->nbQueries = 0; $this->lastResult = NULL; mysql_connect($server, $user, $pass) or die('Server connexion not possible.'); mysql_select_db($base) or die('Database connexion not possible.'); } /** Query the database. * @param $query The query. * @param $debug If true, it output the query and the resulting table. * @return The result of the query, to use with fetchNextObject(). */ function query($query, $debug = -1) { $this->nbQueries++; $this->lastResult = mysql_query($query) or $this->debugAndDie($query); $this->debug($debug, $query, $this->lastResult); return $this->lastResult; } /** Do the same as query() but do not return nor store result.\n * Should be used for INSERT, UPDATE, DELETE... * @param $query The query. * @param $debug If true, it output the query and the resulting table. */ function execute($query, $debug = -1) { $this->nbQueries++; mysql_query($query) or $this->debugAndDie($query); $this->debug($debug, $query); } /** Convenient method for mysql_fetch_object(). * @param $result The ressource returned by query(). If NULL, the last result returned by query() will be used. * @return An object representing a data row. */ function fetchNextObject($result = NULL) { if ($result == NULL) $result = $this->lastResult; if ($result == NULL || mysql_num_rows($result) < 1) return NULL; else return mysql_fetch_object($result); } /** Get the number of rows of a query. * @param $result The ressource returned by query(). If NULL, the last result returned by query() will be used. * @return The number of rows of the query (0 or more). */ function numRows($result = NULL) { if ($result == NULL) return mysql_num_rows($this->lastResult); else return mysql_num_rows($result); } /** Get the result of the query as an object. The query should return a unique row.\n * Note: no need to add "LIMIT 1" at the end of your query because * the method will add that (for optimisation purpose). * @param $query The query. * @param $debug If true, it output the query and the resulting row. * @return An object representing a data row (or NULL if result is empty). */ function queryUniqueObject($query, $debug = -1) { $query = "$query LIMIT 1"; $this->nbQueries++; $result = mysql_query($query) or $this->debugAndDie($query); $this->debug($debug, $query, $result); return mysql_fetch_object($result); } /** Get the result of the query as value. The query should return a unique cell.\n * Note: no need to add "LIMIT 1" at the end of your query because * the method will add that (for optimisation purpose). * @param $query The query. * @param $debug If true, it output the query and the resulting value. * @return A value representing a data cell (or NULL if result is empty). */ function queryUniqueValue($query, $debug = -1) { $query = "$query LIMIT 1"; $this->nbQueries++; $result = mysql_query($query) or $this->debugAndDie($query); $line = mysql_fetch_row($result); $this->debug($debug, $query, $result); return $line[0]; } /** Get the maximum value of a column in a table, with a condition. * @param $column The column where to compute the maximum. * @param $table The table where to compute the maximum. * @param $where The condition before to compute the maximum. * @return The maximum value (or NULL if result is empty). */ function maxOf($column, $table, $where) { return $this->queryUniqueValue("SELECT MAX(`$column`) FROM `$table` WHERE $where"); } /** Get the maximum value of a column in a table. * @param $column The column where to compute the maximum. * @param $table The table where to compute the maximum. * @return The maximum value (or NULL if result is empty). */ function maxOfAll($column, $table) { return $this->queryUniqueValue("SELECT MAX(`$column`) FROM `$table`"); } /** Get the count of rows in a table, with a condition. * @param $table The table where to compute the number of rows. * @param $where The condition before to compute the number or rows. * @return The number of rows (0 or more). */ function countOf($table, $where) { return $this->queryUniqueValue("SELECT COUNT(*) FROM `$table` WHERE $where"); } /** Get the count of rows in a table. * @param $table The table where to compute the number of rows. * @return The number of rows (0 or more). */ function countOfAll($table) { return $this->queryUniqueValue("SELECT COUNT(*) FROM `$table`"); } /** Internal function to debug when MySQL encountered an error, * even if debug is set to Off. * @param $query The SQL query to echo before diying. */ function debugAndDie($query) { $this->debugQuery($query, "Error"); die("
".mysql_error()."
Notice : A session had already been started - ignoring session_start() in C :\wamp\www\WebProcedures\config .inc .php on line 2mtStart = $this->getMicroTime(); $this->nbQueries = 0; $this->lastResult = NULL; mysql_connect($server, $user, $pass) or die('Server connexion not possible.'); mysql_select_db($base) or die('Database connexion not possible.'); } /** Query the database. * @param $query The query. * @param $debug If true, it output the query and the resulting table. * @return The result of the query, to use with fetchNextObject(). */ function query ($query, $debug = -1) { $this->nbQueries++; $this->lastResult = mysql_query($query) or $this->debugAndDie($query); $this->debug($debug, $query, $this->lastResult); return $this->lastResult; } /** Do the same as query() but do not return nor store result.\n * Should be used for INSERT, UPDATE, DELETE... * @param $query The query. * @param $debug If true, it output the query and the resulting table. */ function execute ($query, $debug = -1) { $this->nbQueries++; mysql_query($query) or $this->debugAndDie($query); $this->debug($debug, $query); } /** Convenient method for mysql_fetch_object(). * @param $result The ressource returned by query(). If NULL, the last result returned by query() will be used. * @return An object representing a data row. */ function fetchNextObject ($result = NULL) { if ($result == NULL) $result = $this->lastResult; if ($result == NULL || mysql_num_rows($result) < 1) return NULL; else return mysql_fetch_object($result); } /** Get the number of rows of a query. * @param $result The ressource returned by query(). If NULL, the last result returned by query() will be used. * @return The number of rows of the query (0 or more). */ function numRows ($result = NULL) { if ($result == NULL) return mysql_num_rows($this->lastResult); else return mysql_num_rows($result); } /** Get the result of the query as an object. The query should return a unique row.\n * Note: no need to add "LIMIT 1" at the end of your query because * the method will add that (for optimisation purpose). * @param $query The query. * @param $debug If true, it output the query and the resulting row. * @return An object representing a data row (or NULL if result is empty). */ function queryUniqueObject ($query, $debug = -1) { $query = "$query LIMIT 1"; $this->nbQueries++; $result = mysql_query($query) or $this->debugAndDie($query); $this->debug($debug, $query, $result); return mysql_fetch_object($result); } /** Get the result of the query as value. The query should return a unique cell.\n * Note: no need to add "LIMIT 1" at the end of your query because * the method will add that (for optimisation purpose). * @param $query The query. * @param $debug If true, it output the query and the resulting value. * @return A value representing a data cell (or NULL if result is empty). */ function queryUniqueValue ($query, $debug = -1) { $query = "$query LIMIT 1"; $this->nbQueries++; $result = mysql_query($query) or $this->debugAndDie($query); $line = mysql_fetch_row($result); $this->debug($debug, $query, $result); return $line[0]; } /** Get the maximum value of a column in a table, with a condition. * @param $column The column where to compute the maximum. * @param $table The table where to compute the maximum. * @param $where The condition before to compute the maximum. * @return The maximum value (or NULL if result is empty). */ function maxOf ($column, $table, $where) { return $this->queryUniqueValue("SELECT MAX(`$column`) FROM `$table` WHERE $where"); } /** Get the maximum value of a column in a table. * @param $column The column where to compute the maximum. * @param $table The table where to compute the maximum. * @return The maximum value (or NULL if result is empty). */ function maxOfAll ($column, $table) { return $this->queryUniqueValue("SELECT MAX(`$column`) FROM `$table`"); } /** Get the count of rows in a table, with a condition. * @param $table The table where to compute the number of rows. * @param $where The condition before to compute the number or rows. * @return The number of rows (0 or more). */ function countOf ($table, $where) { return $this->queryUniqueValue("SELECT COUNT(*) FROM `$table` WHERE $where"); } /** Get the count of rows in a table. * @param $table The table where to compute the number of rows. * @return The number of rows (0 or more). */ function countOfAll ($table) { return $this->queryUniqueValue("SELECT COUNT(*) FROM `$table`"); } /** Internal function to debug when MySQL encountered an error, * even if debug is set to Off. * @param $query The SQL query to echo before diying. */ function debugAndDie ($query) { $this->debugQuery($query, "Error"); die("
Ik vermoed dat hij geen verbinding kan maken met de databank.. De logingegevens van de databank zijn nog altijd de default.
Heeft er iemand een idee wat ik fout doe?
Groeten,
Stefan
|