vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   mySQL error (https://vborg.vbsupport.ru/showthread.php?t=51991)

Mijae 04-23-2003 01:28 AM

mySQL error
 
Database error in vBulletin Control Panel 2.3.0:

Invalid SQL: INSERT INTO useractivation VALUES (NULL,'1498','1051062010','91932666',0)
mysql error: Column count doesn't match value count at row 1

mysql error number: 1136

Date: Tuesday 22nd of April 2003 07:40:10 PM
Script: http://www.url.com/forum/forum/admin/email.php
Referer: http://www.url.com/forum/admin/email.php?action=start&

It has never happened to me before, I've been trying to email users their activation codes...

DigitalDesktops 04-23-2003 01:35 AM

you're missing the "usergroupid" column

Mijae 04-23-2003 03:57 AM

And to fix that...? I dont really know why its not there...

DigitalDesktops 04-23-2003 04:01 AM

search for this in email.php(Unhacked):

PHP Code:

                                INSERT INTO useractivation 

make sure below that it says:

PHP Code:

                                    (useractivationiduseriddatelineactivationidtypeusergroupid)
                                
VALUES
                                    
(NULL$activate[activationid], ".time()."'$user[activationid]'02)
                            
"); 

if it doesn't say that, replace the query, with the one above. :) hope this helps. :)

Mijae 04-23-2003 05:23 PM

Code:

                                          //check for existing one...if not generate new one
                                                if (!$activate=$DB_site->query_first("SELECT activationid FROM useractivation WHERE userid='$user[userid]' AND type=0")) {
                                                        // or generate new one!
                                                        // delete old activation id
                                                        $DB_site->query("DELETE FROM useractivation WHERE userid='$user[userid]' AND type=0");

                                                        // make random number
                                                        mt_srand ((double) microtime() * 1000000);
                                                        $activate[activationid]=mt_rand(0,100000000);

                                                        //save to DB
                                                        $DB_site->query("INSERT INTO useractivation VALUES (NULL,'$user[userid]','".time()."','$activate[activationid]',0)");
                                                }
                                        }

                                        $sendmessage=str_replace("\$activateid",$activate[activationid],$sendmessage);
                                }
                                $sendmessage=str_replace("\$bburl",$bburl,$sendmessage);
                                $sendmessage=str_replace("\$bbtitle",$bbtitle,$sendmessage);

                                if (!$test) {
                                        echo "sending ... \n";
                                        vbmail($user['email'], $subject, $sendmessage, $from);
                                } else {
                                        echo "testing ... \n";
                                }

                                echo "ok<br>\n";

Thats the code that has the INSERT INTO useractivation and yes this is an unhacked email.php from vb2.3.0

DigitalDesktops 04-23-2003 10:47 PM

Quote:

Today at 06:23 PM v0id said this in Post #5
Code:

                                          //check for existing one...if not generate new one
                                                if (!$activate=$DB_site->query_first("SELECT activationid FROM useractivation WHERE userid='$user[userid]' AND type=0")) {
                                                        // or generate new one!
                                                        // delete old activation id
                                                        $DB_site->query("DELETE FROM useractivation WHERE userid='$user[userid]' AND type=0");

                                                        // make random number
                                                        mt_srand ((double) microtime() * 1000000);
                                                        $activate[activationid]=mt_rand(0,100000000);

                                                        //save to DB
                                                        $DB_site->query("INSERT INTO useractivation VALUES (NULL,'$user[userid]','".time()."','$activate[activationid]',0)");
                                                }
                                        }

                                        $sendmessage=str_replace("\$activateid",$activate[activationid],$sendmessage);
                                }
                                $sendmessage=str_replace("\$bburl",$bburl,$sendmessage);
                                $sendmessage=str_replace("\$bbtitle",$bbtitle,$sendmessage);

                                if (!$test) {
                                        echo "sending ... \n";
                                        vbmail($user['email'], $subject, $sendmessage, $from);
                                } else {
                                        echo "testing ... \n";
                                }

                                echo "ok<br>\n";

Thats the code that has the INSERT INTO useractivation and yes this is an unhacked email.php from vb2.3.0

VB - 2.3.0

Replace This:
PHP Code:

(NULL,'$user[userid]','".time()."','$activate[activationid]',0)"); 

With this code:
PHP Code:

(NULL$activate[activationid], ".time()."'$user[activationid]'02)"); 



All times are GMT. The time now is 05:00 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01120 seconds
  • Memory Usage 1,751KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (4)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete