Ecommerce software home
Shopping Cart Software Forum for Ecommerce Templates
 
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

Find us on Facebook Follow us on Twitter View our YouTube channel
Search our site
Forum Search
Google Site Search
 All Forums
 Technical
 PHP (Unix / Linux / Apache) versions
 Error with upgrade to PHP 7
Author « Topic »  

outofnowhere
Advanced Member

USA
134 Posts

Pre-sales questions only
(More Details...)

Posted - 08/28/2019 :  16:20:53  
We updated our store to PHP 7 and it threw this error message when going to the site:

Fatal error: Uncaught Error: Call to undefined function mysql_query() in /home/deejaysc/public_html/vsadmin/inc/languagefile.php:10 Stack trace: #0 /home/deejaysc/public_html/vsadmin/inc/languagefile.php(21): lfect_query('SELECT storelan...') #1 /home/deejaysc/public_html/index.php(19): include('/home/deejaysc/...') #2 {main} thrown in /home/deejaysc/public_html/vsadmin/inc/languagefile.php on line 10

Can you point me in the right direction to a solution?

dbdave
ECT Moderator

USA
10468 Posts

Posted - 08/28/2019 :  16:27:53  
You will likely need to update the database connection string. You may also need to update a few pages.
This thread is a good starting point.
https://www.ecommercetemplates.com/support/topic.asp?TOPIC_ID=107737

Edited by - dbdave on 08/28/2019 16:30:01

outofnowhere
Advanced Member

USA
134 Posts

Pre-sales questions only
(More Details...)

Posted - 08/28/2019 :  16:43:57  
Thank you.

My includes.php was already correct.
I updated db_conn_open.php and it threw this error:

Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /home/deejaysc/public_html/vsadmin/db_conn_open.php:14 Stack trace: #0 /home/deejaysc/public_html/proddetail.php(23): include() #1 {main} thrown in /home/deejaysc/public_html/vsadmin/db_conn_open.php on line 14

dbdave
ECT Moderator

USA
10468 Posts

Posted - 08/28/2019 :  17:40:12  
Maybe post up (without any sensitive password info) what you have on line 14 of db_conn_open.php

outofnowhere
Advanced Member

USA
134 Posts

Pre-sales questions only
(More Details...)

Posted - 08/29/2019 :  07:24:17  
Here is the file, minus the private info. Line 14 is the one that starts with "$dbh=mysql_connect"

<?php

// You host should be able to provide you with these settings if you do not know them already

$db_username = "xxxx"; // Your database login username
$db_password = "xxxxx"; // Your database login password
$db_name = "xxxxx"; // The name of the database you wish to use
$db_host = "xxxxx"; // The address of the database. Often this is localhost, but may be for example db.yoursite.com

//////////////////////////////////////////////////
// Please do not edit anything below this line. //
//////////////////////////////////////////////////

$dbh=mysql_connect($db_host, $db_username, $db_password) or die ('YOU need to set your database connection in vsadmin/db_conn_open.php.</td></tr></table></body></html>');
mysql_select_db($db_name) or die ('YOU NEED TO SET YOUR DATABASE CONNECTION IN vsadmin/db_conn_open.php.</td></tr></table></body></html>');

?>

Phil
ECT Moderator

United Kingdom
7715 Posts

Posted - 08/29/2019 :  07:29:30  
Hi,
You need to change this below
$dbh=mysql_connect($db_host, $db_username, $db_password) or die ('YOU need to set your database connection in vsadmin/db_conn_open.php.</td></tr></table></body></html>');
mysql_select_db($db_name) or die ('YOU NEED TO SET YOUR DATABASE CONNECTION IN vsadmin/db_conn_open.php.</td></tr></table></body></html>');

?>

to

$GLOBALS['ectdatabase'] = new mysqli($db_host, $db_username, $db_password, $db_name);
if(mysqli_connect_error()){
ob_clean();
print '<html><head><title>Database connect error</title></head><body><div style="margin:20px;clear:both">Database Connect Error (' . mysqli_connect_errno() . ') ' . mysqli_connect_error() . '</div>';
print('<div style="margin:20px;clear:both">You need to set your database connection in vsadmin/db_conn_open.php</div>');
print '<div style="margin:20px;clear:both">For help setting your database connection please see...<br />';
print '<a href="https://www.ecommercetemplates.com/phphelp/ecommplus/instructions.asp#dbconn" target="_blank">https://www.ecommercetemplates.com/phphelp/ecommplus/instructions.asp#dbconn</a></div>';
print '<div style="margin:20px;clear:both">We also have a support forum here...<br />';
print '<a href="https://www.ecommercetemplates.com/support/" target="_blank">https://www.ecommercetemplates.com/support/</a></div>';
die('</body></html>');
}
?>



* Database Migrations and Conversions*
* ASP to PHP Cart Conversions*

*Contact Us*
*Buy The PHP Capture Card Plugin*
*Rate Our Services/View Our Feedback*

outofnowhere
Advanced Member

USA
134 Posts

Pre-sales questions only
(More Details...)

Posted - 08/29/2019 :  07:35:10  
That worked. Thanks!

I have two other stores with the same problem, so I will update them in the same way.

I guess this just shows how long we have had these sites!
  « Topic »  
Jump To:
Shopping Cart Software Forum for Ecommerce Templates © 2002-2022 ecommercetemplates.com
This page was generated in 0.04 seconds. Snitz Forums 2000