-
AuthorPosts
-
sincerity Friend
sincerity
- Join date:
- December 2014
- Posts:
- 56
- Downloads:
- 0
- Uploads:
- 10
- Thanks:
- 12
- Thanked:
- 1 times in 1 posts
June 24, 2012 at 5:39 am #178460This code works fine in mysql :
<?php
$query = mysql_query("SELECT `abstract_id` FROM `dp7x1_chronoforms_data_frmAbstract` ORDER BY `abstract_id` DESC LIMIT 1");
$query_row = mysql_fetch_array($query);
echo ($query_row['abstract_id']);
?>But I installed JaKranos as mysqli and now I have to change this code for mysqli. I tried this code
<?php
$query = mysqli_query("SELECT `abstract_id` FROM `dp7x1_chronoforms_data_frmAbstract` ORDER BY `abstract_id` DESC LIMIT 1");
$query_row = mysqli_fetch_array($query);
echo ($query_row['abstract_id']);
?>but got the errors as given below :
Warning: mysqli_query() expects at least 2 parameters, 1 given in /home/wac/public_html/administrator/components/com_chronoforms/form_actions/email/email.php(51) : eval()’d code on line 13Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, null given in /home/wac/public_html/administrator/components/com_chronoforms/form_actions/email/email.php(51) : eval()’d code on line 14
Then I tried this
<?php
$link = mysqli_connect("localhost", "my_user", "my_password", "my_database");
$query = mysqli_query($link, "SELECT `abstract_id` FROM `dp7x1_chronoforms_data_frmAbstract` ORDER BY `abstract_id` DESC LIMIT 1");
$query_row = mysqli_fetch_array($query);
echo ($query_row['abstract_id']);
?>Now I am getting the error message given below :
Warning: mysqli_connect() [function.mysqli-connect]: (28000/1045): Access denied for user ‘wac_dbuser’@’localhost’ (using password: YES) in /home/wac/public_html/administrator/components/com_chronoforms/form_actions/email/email.php(51) : eval()’d code on line 13
Connect Error (1045) Access denied for user ‘wac_dbuser’@’localhost’ (using password: YES)I am sure that I am using the proper database, db user and password for mysqli connect.
I am not good in handling mysqli, so please help me out.
And also, I would like to know if there will be any problem if I convert the database from mysqli to mysql in the Global Configuration.
Thanks
pavit Moderatorpavit
- Join date:
- September 2007
- Posts:
- 15749
- Downloads:
- 199
- Uploads:
- 2274
- Thanks:
- 417
- Thanked:
- 4028 times in 3778 posts
June 24, 2012 at 7:32 am #458628Hi
My first thought about this error is that the component Chronoform is having problems with a mysqli database and is not related to the template settings
Try to switch from global configuration the database to MySql, after you have taken a full backup of your site with akeeba backup.
Hope that this help
-
AuthorPosts
This topic contains 3 replies, has 2 voices, and was last updated by sincerity 12 years, 4 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum