manually pulling SQL from install files that won't install

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   manually pulling SQL from install files that won't install
sabastina
CZ Active Member
Occupation: College Student
Website:
Status: Offline
Joined: Nov 03, 2003
0.03 posts per day
Posts: 212
Points: 120,520
AIM Address Yahoo Messenger MSN Messenger ICQ Number
The mod in question in this care is the Restrict images in signatures mod ported by telli.

I can't get the install to run. But I'm wondering, if I pulled the following from the install coding, can I just quesry my DB with it to achieve the installation?


"INSERT INTO " . CONFIG_TABLE . " (config_name, config_value) VALUES ('sig_images_max_width', 400), ('sig_images_max_height', 300), ('sig_images_max_limit', 1)";

This was the only SQL command I saw, but I will post the rest of the file here:



<?php
/***************************************************************************
* db_update.php
* -------------------
* copyright : ©2003 Freakin' Booty ;-P
* built for : Restrict images in signatures 0.1.1
*
*
***************************************************************************/

/***************************************************************************
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
***************************************************************************/

if (!eregi("modules.php", $PHP_SELF)) {
die ("You can't access this file directly...");
}
if ($popup != "1"){
$module_name = basename(dirname(__FILE__));
require("modules/".$module_name."/nukebb.php");
}
else
{
$phpbb_root_path = 'modules/Forums/';
}

define('IN_PHPBB', true);
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);

//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_INDEX, $nukeuser);
init_userprefs($userdata);
//
// End session management
//


$page_title = 'Updating the database';
include('includes/page_header.php');

echo '<table width="100%" cellspacing="1" cellpadding="2" border="0" class="forumline">';
echo '<tr><th>Updating the database</th></tr><tr><td><span class="genmed"><ul type="circle">';


$sql = array();
$sql[] = "INSERT INTO " . CONFIG_TABLE . " (config_name, config_value) VALUES ('sig_images_max_width', 400), ('sig_images_max_height', 300), ('sig_images_max_limit', 1)";

for( $i = 0; $i < count($sql); $i++ )
{
if( !$result = $db->sql_query ($sql[$i]) )
{
$error = $db->sql_error();

echo '<li>' . $sql[$i] . '<br /> +++ <font color="#FF0000">Error:</font> ' . $error['message'] . '</li><br />';
}
else
{
echo '<li>' . $sql[$i] . '<br /> +++ <font color="#00AA00">Successfull</font></li><br />';
}
}


echo '</ul></span></td></tr><tr><td class="catBottom" height="28"> ;;</td></tr>';
echo '<tr><th>End</th></tr><tr><td><span class="genmed">Installation is now finished. Please be sure to delete this file now.<br />If you have run into any errors, please visit the <a href="http://www.codezwiz.com/forums.html" target="_blank">codezwiz.com support forums</a> and ask someone for help.</span></td></tr>';
echo '<tr><td class="catBottom" height="28" align="center"><span class="genmed"><a href="' . append_sid("index.$phpEx") . '">Have a nice day</a></span></td></table>';

include('includes/page_tail.php');

?>



Thanks for any help on this,

Sabastina



Back to top Reply with quote
#2   re: manually pulling SQL from install files that won't insta
Kelly_Hero
PayPal Donation
CZ Revered Member
 Codezwiz Site Donator
usa.gif southcarolina.gif
Occupation: Web Developer
Age: 59
Gender: Female
Website:
Status: Offline
Joined: Aug 20, 2003
0.48 posts per day
Posts: 3765
Points: 351,412
   
Did you upload the file to your modules/forums directory and then try to access that file from your browser? IE...www.mysite.com/modules.php?name=Forums&file=db_update

If you still can't get it to run, you should be able to put the following into the SQL box in phpMyAdmin

INSERT INTO " . CONFIG_TABLE . " (config_name, config_value) VALUES ('sig_images_max_width', 400), ('sig_images_max_height', 300), ('sig_images_max_limit', 1)



Back to top Reply with quote
#3   
Telli
Site Admin
Occupation: Self Employed
Age: 46
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.03 posts per day
Posts: 8089
Points: 494,430
   
" . CONFIG_TABLE. " is a defined constant. If you want to use it phpmyadmin change that too nuke_bbconfig.

INSERT INTO nuke_bbconfig (config_name, config_value) VALUES ('sig_images_max_width', 400), ('sig_images_max_height', 300), ('sig_images_max_limit', 1);




_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
#4   
sabastina
CZ Active Member
Occupation: College Student
Website:
Status: Offline
Joined: Nov 03, 2003
0.03 posts per day
Posts: 212
Points: 120,520
AIM Address Yahoo Messenger MSN Messenger ICQ Number
Ok, I may have found an answer to the problem.
When I entered it manually, I got the following

Database wisdomofthedark_org_-_phpnuke1 running on localhost
Error

SQL-query :

"INSERT INTO ". CONFIG_TABLE . " (config_name, config_value) VALUES ('sig_images_max_width', 400), ('sig_images_max_height', 300), ('sig_images_max_limit', 1)"

MySQL said:


You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '"INSERT INTO " . NUKE_CONFIG . " (config_name, config_value) VA


At first I thought it was because my table is called NUKE_CONFIG umm...that didn't work and so I decided to come here and pose the question, what is the error and where is this manual?

Thanks for reading!

Sabastina



Back to top Reply with quote
#5   
sabastina
CZ Active Member
Occupation: College Student
Website:
Status: Offline
Joined: Nov 03, 2003
0.03 posts per day
Posts: 212
Points: 120,520
AIM Address Yahoo Messenger MSN Messenger ICQ Number
It worked! Thanks guys!

headbang.gif U ROCK!

Sabastina



Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum