₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,325,020 members, 8,419,966 topics. Date: Thursday, 04 June 2026 at 08:26 AM

Toggle theme

Database Error! - Programming - Nairaland

Nairaland ForumScience/TechnologyProgrammingDatabase Error! (1281 Views)

1 Reply (Go Down)

Database Error! by asadul549(op):
I recently upgraded my server php to 5.6.25 & MySQL to 5.5.49 & from then I'm getting a kind of error like this on specific page.

Warning: mysql_query(): Access denied for user 'yury97'@'localhost' (using password: NO) in /home/yury97/public_html/wp-content/themes/Avada/template-member_list.php on line 22

Warning: mysql_query(): A link to the server could not be established in /home/yury97/public_html/wp-content/themes/Avada/template-member_list.php on line 22


Warning: mysqli_fetch_object() expects parameter 1 to be mysqli_result, boolean given in /home/yury97/public_html/wp-content/themes/Avada/template-member_list.php on line 27


I also was exported my database & then delete & created new & then imported on server & set new user & pass on wp-config.php file on wordpress. My database host is now set to localhost.

What can be the solution now? Will appreciate your help. Thanks in advance! huh
Re: Database Error! by Whytelyon(m): 7:24pm On Oct 26, 2016
1.) Paste the code, we'll help you.

2.) if you doing this for a big company,i suggest you switch platform and don't use PHP for most industry standard apps anymore. Your code exposed a flaw for Sql injection and it's vulnerable.

If a hacker gets foothold of your site, consider yourself a goner,you've lost the contract.
Re: Database Error! by asadul549(op): 7:44pm On Oct 26, 2016
code form where?
From that template where the error is occurring?
Re: Database Error! by Whytelyon(m): 8:46pm On Oct 26, 2016
asadul549:
code form where?
From that template where the error is occurring?
Your source code that gave that error
Re: Database Error! by ANTONINEUTRON(m): 10:39pm On Oct 26, 2016
I Might Suggest U Are Using Mysql And Mysqli Together
Or Ur Connection Method Is Wrong.
Post Ur Code Here (wisely) E Go Easy To See People Wey Go Help U
Re: Database Error! by asadul549(op):
I will appreciate you guys help man. This is template source code where I'm getting error
Re: Database Error! by seunex4real: 6:44pm On Oct 29, 2016
Kindly use mysqli, you are using MySQL to query and mysqli to get results. MySQL is deprecated

Print out the error Using mysqli_error($connection). And the kill the page with die().

Also watch Out for sql injection .

Hope it helps.
Re: Database Error! by gloryz24: 7:25pm On Oct 29, 2016
Looks like you're mixing mysql_ with mysqli_ commands and that won't work. So if you're migrating from mysql_ to mysqli_ the differnece is not just in that one one letter... It's much bigger and you should consult php mysqli documentation:
http://php.net/manual/en/book.mysqli.php
Re: Database Error! by asadul549(op): 7:41pm On Oct 29, 2016
I recently upgraded Mysql from 5.4.something to 5.5.49
Re: Database Error! by asadul549(op):
I already tried once by replacing mysqli to mysql on that template. But then it says on the page-
Re: Database Error! by asadul549(op): 8:00pm On Oct 29, 2016
sad
1 Reply

Getting Started With Firebase Realtime Database On The WebPlease How Do I Print This Data From MY Database. MYSQL, PHP234

Free TrainingHackerpost NG Deal: Get Professional Certified Ethical Hacker Online TrainingI Need Full Time Developers