Author Topic: DB Problems  (Read 7143 times)

0 Members and 1 Guest are viewing this topic.

Offline Vapor

  • Pre-Newbie
  • Posts: 5
    • View Profile
DB Problems
« on: August 31, 2006, 03:47:01 AM »
I have a small site that until tonight was running fine (using 1.7.3).  When I tried to login I got this error:
An unexpected error occured. Please try again later.
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/heavensp/public_html/4images/includes/db_mysql.php on line 116

I am very new to Mysql and PHP so I have no idea as to the problem. Any help would be appreciated.

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: DB Problems
« Reply #1 on: August 31, 2006, 03:55:59 AM »
where are you trying to login? in ACP or in member's login form?
« Last Edit: August 31, 2006, 04:10:03 AM by V@no »
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Vapor

  • Pre-Newbie
  • Posts: 5
    • View Profile
Re: DB Problems
« Reply #2 on: August 31, 2006, 11:18:15 AM »
Logging into the members forum itself.

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: DB Problems
« Reply #3 on: September 01, 2006, 12:13:10 AM »
Did you do any modifications to 4images code? if you did, then perhaps that is the problem...start tracing it down by removing the changes...
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Vapor

  • Pre-Newbie
  • Posts: 5
    • View Profile
Re: DB Problems
« Reply #4 on: September 01, 2006, 03:05:11 AM »
I made no changes to the new install. I did however install over the previous version (which was modded) if that would make any difference. Out of curiosity I looked in my phpadmin and found the users table from the DB is empty. This is the error message I get when I try to browse the table:
 
SHOW FIELDS FROM `4images_users` FROM `heavensp_images` ;

MySQL said: Documentation
#1033 - Incorrect information in file: './heavensp_images/4images_users.frm'

But I have no idea how. or what caused this to happen. Also I am unable to register a new user. I get these errors:

An unexpected error occured. Please try again later.

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/heavensp/public_html/4images/includes/db_mysql.php on line 171

An unexpected error occured. Please try again later.

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/heavensp/public_html/4images/includes/db_mysql.php on line 171

An unexpected error occured. Please try again later.

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/heavensp/public_html/4images/includes/db_mysql.php on line 164

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: DB Problems
« Reply #5 on: September 01, 2006, 03:23:38 AM »
try to repair your database (use phpmyadmin) and contact your host administrator. There is nothing more you can do without loosing all your members...
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Vapor

  • Pre-Newbie
  • Posts: 5
    • View Profile
Re: DB Problems
« Reply #6 on: September 02, 2006, 06:06:03 PM »
Is there a way that I can delete just the users table and keep the rest of the database? And if so how would I re-introduce the table back into the database?

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: DB Problems
« Reply #7 on: September 02, 2006, 06:19:49 PM »
Code: [Select]
CREATE TABLE 4images_users (
  user_id int(11) NOT NULL auto_increment,
  user_level int(11) NOT NULL default '1',
  user_name varchar(255) NOT NULL default '',
  user_password varchar(255) NOT NULL default '',
  user_email varchar(255) NOT NULL default '',
  user_showemail tinyint(1) NOT NULL default '0',
  user_allowemails tinyint(1) NOT NULL default '1',
  user_invisible tinyint(1) NOT NULL default '0',
  user_joindate int(11) unsigned NOT NULL default '0',
  user_activationkey varchar(32) NOT NULL default '',
  user_lastaction int(11) unsigned NOT NULL default '0',
  user_location varchar(255) NOT NULL default '',
  user_lastvisit int(11) unsigned NOT NULL default '0',
  user_comments int(10) unsigned NOT NULL default '0',
  user_homepage varchar(255) NOT NULL default '',
  user_icq varchar(20) NOT NULL default '',
  PRIMARY KEY  (user_id),
  KEY user_lastaction (user_lastaction),
  KEY user_name (user_name)
) TYPE=MyISAM;

#
# Dumping data for table 4images_users
#

INSERT INTO 4images_users VALUES (-1, -1, 'Guest', '0493984f537120be0b8d96bc9b69cdd2', '', 0, 0, 0, 0, '', 0, '', 0, 0, '', '');
INSERT INTO 4images_users VALUES (1, 9, 'admin', '21232f297a57a5a743894a0e4a801fc3', 'admin@yourdomain.com', 1, 1, 0, 1016023608, '1e3457c0b2052a9633b886fd75ef91e0', 1016023608, '', 0, 0, '', '');
use the following user/pass to login into ACP and change admin's name and password:
admin/admin

Also, be aware, that if images were uploaded not by admin, they will be showed as uploaded by guests...
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Vapor

  • Pre-Newbie
  • Posts: 5
    • View Profile
Re: DB Problems
« Reply #8 on: September 03, 2006, 12:52:53 AM »
Thanks for all the help V@no.