Hi,
I didnt know how to remove [RESOLVED] on my previous thread… otherwise i would of put this there…
but anyways, i was able to make 1 update work but when i was writing this i must of missed something.
I add NogDogs Error reporting as well so you will know my error…
My code:
[code=php]
<?php
if(!isset($_POST[‘dbhost’]) || empty($_POST[‘dbhost’])) { }
if(!isset($_POST[‘dbuser’]) || empty($_POST[‘dbuser’])) { }
if(!isset($_POST[‘dbpass’]) || empty($_POST[‘dbpass’])) { }
if(!isset($_POST[‘dbname’]) || empty($_POST[‘dbname’])) { }
if(!isset($_POST[‘prefix’]) || empty($_POST[‘prefix’])) { }
$server = $_POST[‘dbhost’];
$dbusername = $_POST[‘dbuser’];
$dbpassword = $_POST[‘dbpass’];
$db_name = $_POST[‘$dbname’];
$pv = $_POST[‘prefix’];
$connection=mysql_connect($server, $dbuser, $dbpass);
mysql_select_db($dbname, $connection);
error_reporting(E_ALL);
$results1=mysql_query(“INSERT INTO “.$pv.”config (name, value, comment, kind, options, title, category, cat_order) VALUES (‘catcase’,’0′,’Change Category Case For Your New Categories’,’list’,’0|Exact^1|ALL UPPER CASE^2|all lower case’,’Category Text Case’,’02|Categories’,’2′)”, $connection) or die(mysql_error());
$results2=mysql_query(“INSERT INTO “.$pv.”config (name, value, comment, kind, options, title, category, cat_order) VALUES (‘showpagerankgoogle’,’1′,’Show Google Page Rank, below URL’,’flag’,”,’Search Engine Information – Google Page Rank’,’03|Links’,’10’)”, $connection) or die(mysql_error());
$query =”UPDATE “.$pv.”config SET value = ‘3.31’ WHERE name = ‘recipman_version'”;
$query =”UPDATE “.$pv.”config SET cat_order = ‘3’ WHERE name = ‘catfilesep'”;
$query =”UPDATE “.$pv.”config SET cat_order = ‘4’ WHERE name = ‘showcounters'”;
$query =”UPDATE “.$pv.”config SET cat_order = ‘5’ WHERE name = ‘dispsubcat'”;
$query =”UPDATE “.$pv.”config SET cat_order = ‘6’ WHERE name = ‘showcatdesc'”;
$query =”UPDATE “.$pv.”config SET comment = ‘Show Alexa Traffic Rank, below URL, below URL’, title = ‘Search Engine Information – Alexa Traffic Rank’, cat_order = ‘9’ WHERE name = ‘showpagerank'”;
$query =”UPDATE “.$pv.”config SET cat_order = ’11’ WHERE name = ‘showrecip'”;
$query =”UPDATE “.$pv.”config SET cat_order = ’12’ WHERE name = ‘linkstatus'”;
$query =”UPDATE “.$pv.”config SET cat_order = ’13’ WHERE name = ‘showlinktotal'”;
$query =”UPDATE “.$pv.”config SET cat_order = ’14’ WHERE name = ‘displinktotal'”;
$results3 = mysql_query($query,$connection) or die(mysql_error().”<br />QUERY: $query”);
if(mysql_affected_rows() == 0)
{
$query2 = “SELECT * FROM “.$pv.”config WHERE name = ‘recipman_version'”;
$result2 = mysql_query($query2) or die(mysql_error().”<br />QUERY: $query2″);
if(mysql_num_rows($result2) == 0)
{
trigger_error(“ERROR: no matches in “.$pv.”config for name = ‘recipman_version'”, E_USER_WARNING);
}
else
{
trigger_error(“ERROR: no rows updated for unknown reason in table “.$pv.”config”, E_USER_WARNING);
}
}
mysql_close($connection);
echo “<BR><BR>”;
if ($results1 != “1”) {
echo “Could Not Instert New Row – Google Page Rank<BR><BR>”;
} else {
echo “Updated: Insterted New – Google Page Rank<BR><BR>”;
}
if ($results2 != “1”) {
echo “Could Not Instert New Row – Category Case Change<BR><BR>”;
} else {
echo “Updated: Insterted New Row – Category Case Change<BR><BR>”;
}
if ($results3 != “1”) {
echo “Could Not Update Existing Rows<BR><BR>”;
} else {
echo “Updated Existing Rows<BR><BR>”;
}
echo “<BR><BR>”;
echo “<font size=”4″>Upgrade Completed!</font><BR><BR><font color=”#FF0000″ size=”-1″>Now Delete The Upgrade-SQL Folder</font>”;
?>
and the error i get is:
[QUOTE]
Warning: ERROR: no rows updated for unknown reason in table rl_config in /home/xpixalc/public_html/rm/Upgrade-SQL/upgrade-330to331.php on line 129
Updated Existing Rows
Thanks
Aaron