Pagina 1 van 1

News block mod

Geplaatst: 18 mei 2005, 11:24
door Eefjuh
Ik wil de update doen en in krijg een error.

Update = news_update.php

Code: Selecteer alles

<?php

/***************************************************************************
 *                              news_install.php
 *                            -------------------
 *   begin                : Thursday, Apr 3, 2003
 *   copyright            : (C) 2003 Garold W. Robinson
 *   email                : setheep@hotmail.com
 *
 *
 *
 *
 ***************************************************************************/

$tablename = 'news';

// ******************* NO EDITING BELOW THIS LINE *******************

$eipver = '6.1.0';

// connect to phpbb
include('./config.php');

$cnx = mysql_connect($dbhost, $dbuser, $dbpasswd)
or die("Unable to connect to database server.");
mysql_select_db($dbname, $cnx)
or die("Unable to select database.");


 $sql2 = 'INSERT INTO ' . $table_prefix.$tablename . "(config_name, config_value)
				VALUES ('news_style', ''),
                       ('news_bold', ''),
                       ('news_ital', ''),
                       ('news_under', '')";
$result = mysql_query($sql2);

echo "<HTML><HEAD><TITLE>Installing: NEWS BLOCK ".$eipver."</TITLE></HEAD>";
echo "<BODY>";

if(!$result)
echo "Install failed<BR><BR>";
if (mysql_error()) { echo "Error Report: <B>".mysql_error()."</B><BR><BR>"; }
else {
echo "Install complete, new  values added.<BR><BR><BR>Please remember to delete this file ASAP.";

}
echo "<BODY></HTML>";
exit;
?>

En ik krijg:

Install failed

Error Report: Duplicate entry 'news_style' for key 1


En ik snap dr niks meer van..

Geplaatst: 18 mei 2005, 19:32
door Luuk
Je hebt het bestand al eens uitgevoerd want die rij bestaat al.