Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • sincerity Friend
    #178460

    This 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 13

    Warning: 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 Moderator
    #458628

    Hi

    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

    sincerity Friend
    #459429

    Dear Pavit,

    As per your suggestion, I took backup and changed MySQLi to MySQL in the Global Configuration and everything works fine now.

    Thanks.

Viewing 3 posts - 1 through 3 (of 3 total)

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