I am experiencing the following error when trying to
load the index.php:
Warning: Supplied argument is not a valid MySQL-Link resource in /var/www/phpinv/inc/db_mysql.php on line 56
Database error in phpInv: Invalid SQL: INSERT INTO phpinv_session (hash, userid, ip, useragent, activity) VALUES
('3288f18a333cfb94d8e87a63c25aad80','1','156.127.2.173','Mozilla/4.79 [en] (Windows NT 5.0; U)',now() )
mysql error:
mysql error number:
Date: 03.10.2002 @ 09:40
Script: /phpinv/category.php?hash=
Referer: http://156.127.2.140/phpinv/
This is after I changed db_mysql.php to have "1" as
the link_id variable. The default was "0" but using that generates an error about failing to connect using passwd YES even though I have the user/pass defined in db_mysql.php
The database and tables have been created and I can login fine via command line. Any help or suggestions ? Thanks.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If you change the link_id predefined value to 1 you also have to change the function connect()
Instead of "if ( 0 == $this->link_id ) {" use "if ( 1 == $this->link_id ) {".
Actually there's no need to change it :)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I wouldn't have changed it (and have changed it back now) if it didn't seem to be ignoring the user and password variables. I get this error:
Warning: Access denied for user: 'phpinv@localhost' (Using password: YES) in /var/www/phpinv/inc/db_mysql.php on line 25
Warning: MySQL Connection Failed: Access denied for user: 'phpinv@localhost' (Using password: YES) in /var/www/phpinv/inc/db_mysql.php on line 25
I don't know why it wants to log in as phpinv.
I guess the next step is to create a phpinv user with no password and see what happens.
btw- here is how my php_db file is- do you see anything I did blatently wrong here?:
This is a cool program I'd really like to get it to work on my system (Debian)
Thanks
<?
class DB {
var $database = "phpinv";
var $link_id = 0;
var $query_id = 0;
var $record = array();
var $errdesc = "";
var $errno = 0;
var $show_error = 0;
var $debug = 1;
var $server = "localhost";
var $user = "root";
var $password = "xxxxxxx";
var $tableprefix = "phpinv_";
var $appname = "phpInv";
function connect() {
if ( 0 == $this->link_id ) {
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am experiencing the following error when trying to
load the index.php:
Warning: Supplied argument is not a valid MySQL-Link resource in /var/www/phpinv/inc/db_mysql.php on line 56
Database error in phpInv: Invalid SQL: INSERT INTO phpinv_session (hash, userid, ip, useragent, activity) VALUES
('3288f18a333cfb94d8e87a63c25aad80','1','156.127.2.173','Mozilla/4.79 [en] (Windows NT 5.0; U)',now() )
mysql error:
mysql error number:
Date: 03.10.2002 @ 09:40
Script: /phpinv/category.php?hash=
Referer: http://156.127.2.140/phpinv/
This is after I changed db_mysql.php to have "1" as
the link_id variable. The default was "0" but using that generates an error about failing to connect using passwd YES even though I have the user/pass defined in db_mysql.php
The database and tables have been created and I can login fine via command line. Any help or suggestions ? Thanks.
Also if I run that sql query at the command line
it works just fine.
If you change the link_id predefined value to 1 you also have to change the function connect()
Instead of "if ( 0 == $this->link_id ) {" use "if ( 1 == $this->link_id ) {".
Actually there's no need to change it :)
I wouldn't have changed it (and have changed it back now) if it didn't seem to be ignoring the user and password variables. I get this error:
Warning: Access denied for user: 'phpinv@localhost' (Using password: YES) in /var/www/phpinv/inc/db_mysql.php on line 25
Warning: MySQL Connection Failed: Access denied for user: 'phpinv@localhost' (Using password: YES) in /var/www/phpinv/inc/db_mysql.php on line 25
I don't know why it wants to log in as phpinv.
I guess the next step is to create a phpinv user with no password and see what happens.
btw- here is how my php_db file is- do you see anything I did blatently wrong here?:
This is a cool program I'd really like to get it to work on my system (Debian)
Thanks
<?
class DB {
var $database = "phpinv";
var $link_id = 0;
var $query_id = 0;
var $record = array();
var $errdesc = "";
var $errno = 0;
var $show_error = 0;
var $debug = 1;
var $server = "localhost";
var $user = "root";
var $password = "xxxxxxx";
var $tableprefix = "phpinv_";
var $appname = "phpInv";
function connect() {
if ( 0 == $this->link_id ) {
Just don't change anything in db_mysql.php. It's a database layer to make it simple to use other databases.
The configs are located in admin/config. you have to change username and password for your database in db.php.
Hopefully this help you - just post the errors if not ;)
wow I couldn't feel more stupid.
I restored the db_mysql.php, changed the correct
file as you said and whoolah! Thank you very much!