Lỗi error call to undefined function mysql_connect in c program năm 2024

Warning: mysqli::__construct() expects parameter 5 to be integer, string given in C:\xampp\htdocs\project\contactdemo.php on line 35

Show

    Warning: mysqli::query(): Couldn't fetch mysqli in C:\xampp\htdocs\project\contactdemo.php on line 44

    Warning: main(): Couldn't fetch mysqli in C:\xampp\htdocs\project\contactdemo.php on line 50 Error:INSERT INTO contactphpdem(username,email,mobile,subject) values('Rahul','[email protected]','8105189061','nvjmlik')

    Warning: mysqli::close(): Couldn't fetch mysqli in C:\xampp\htdocs\project\contactdemo.php on line 52

    Còn không muốn cài lại thì tạo một file phpinfo(). Rồi rồi search xem có hỗ trợ mysql không. nếu không hỗ trợ thì vào php.ini tìm xem có dòng nào như vầy không <

    extension=php_mysql.dll>. Bỏ đi dấu <#> khởi động lại là được

    • 3

    Bạn xem xem MySQL có bất thường gì ko? Ví dụ như ko start dc ...etc....

    • 4

    mình đã sữa được. Lý do là mình sử dụng hệ điều hành windows 7, mình cài vào phân vùng ổ C chắc có lẻ do tính bảo mật của HĐH này nên nó ngăn k cho load các thư viện lên, mình cài qua bên ổ đĩa khác thì ok

    Lỗi này thường thấy nếu ta dùng PHP 7 và vì PHP 7 không còn hỗ trợ hàm mysql_connect() nữa, thay vào đó nó có hàm mysqli_connect(). Thể hiện của lỗi này như sau:

    This page isn’t working www.kindalog.com is currently unable to handle this request. HTTP ERROR 500

    Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /wp-includes/wp-db.php:1665 Stack trace:

    0 /wp-includes/wp-db.php(632): wpdb->db_connect()

    1 /wp-includes/load.php(425): wpdb->__construct('u', 'p', 'd', 'h')

    2 /wp-settings.php(116): require_wp_db()

    3 /wp-config.php(93): require_once('/home/kindalog')

    4 /wp-load.php(37): require_once('/home/kindalog')

    5 /wp-blog-header.php(13): require_once('/home/kindalog')

    6 /index.php(17): require('/home/kindalog')

    7 {main} thrown in ~/wp-includes/wp-db.php on line 1665

    Fatal error: Uncaught Error: Call to undefined function wp_kses_normalize_entities() in /wp-includes/formatting.php:4316 Stack trace:

    0 /wp-includes/class-wp-fatal-error-handler.php(190): esc_url('https://wordpre…')

    1 /wp-includes/class-wp-fatal-error-handler.php(147): WP_Fatal_Error_Handler->display_default_error_template(Array, false)

    2 /wp-includes/class-wp-fatal-error-handler.php(52): WP_Fatal_Error_Handler->display_error_template(Array, false)

    3 [internal function]: WP_Fatal_Error_Handler->handle()

    4 {main} thrown in /wp-includes/formatting.php on line 4316

    Để khắc phục lỗi này, ta xóa hoặc gán giá trị false cho WP_USE_EXT_MYSQL trong file wp-config.php.

    define( 'WP_USE_EXT_MYSQL', false );

    Tiếp theo, mở trang quản lý PHP version trên web server và chọn mysqli.

    Lỗi error call to undefined function mysql_connect in c program năm 2024

    Fatal error: Call to undefined function mysql_connect() in C:\Drupal\drupal-4.6.2\includes\database.mysql.inc on line 31

    this msg came out.

    whats the major problem????

    anyone please?

    • Log in or register to post comments

    Comments

    Lỗi error call to undefined function mysql_connect in c program năm 2024

    cdestiny commented 20 July 2005 at 13:36

    hi micha, thanks for answering my noob question. :) i tried some sample at new php file.

    $link = mysql_connect('localhost', 'mysql_user', 'mysql_password');
    if (!$link) {
       die('Could not connect: ' . mysql_error());
    }
    echo 'Connected successfully';
    mysql_close($link);
    

    **'localhost' remain 'localhost' **'mysql_user' replace with my database username **'mysql_password' replace with my databse password.

    the same problem still occur. is that means i need to modify the php.ini ????

    • Log in or register to post comments

    Lỗi error call to undefined function mysql_connect in c program năm 2024

    cdestiny commented 20 July 2005 at 17:39

    you are right, i check on my phpinfo() i cant find mySQL listed inside there. I need to configure with php.ini

    i am trying to enable it. please tell me if you know how to enable it. thanks buddy!!

    • Log in or register to post comments

    Lỗi error call to undefined function mysql_connect in c program năm 2024

    loloyd commented 17 November 2005 at 08:03

    I also encountered the same problem and sarched/browsed around for the solution. From others experiences, I gathered that the problem lies in my failure to properly configure php. In php's documentation, they stated that they have disabled mysql support by default.

    To fix this, find the line:

    ;extension=php_mysql.dll

    from your php.ini file and remove the leading semicolon to uncomment it like so:

    extension=php_mysql.dll

    You might also want to uncomment the extension to php_gd2.dll (for graphics purposes).

    Next, ensure that the files php_mysql.dll and libmysql.dll can be reached by php by modifying and uncommenting the line:

    extension_dir = "C:\php\ext\"

    to something more appropriate to your system. Verify this by looking at the value returned by:

    < ?php phpinfo() ? >

    That should now work. The message "Fatal error: Call to undefined function mysql_connect() in C:\...drupal-x.x.x\includes\database.mysql.inc on line 31" simply means that the function mysql_connect was not found by php. Therefore, you only need to configure php to enable its encapsulating library for it to work.

    • Log in or register to post comments

    Lỗi error call to undefined function mysql_connect in c program năm 2024

    trantt commented 3 December 2005 at 23:05

    I'm still having the same problem, can someone help me to resolve this problem?

    I'm using windows xp, apache 2.055, mysql 5.0.1.6, php 5.1.1... I modified php.ini (this ini file is located under the apache directory (c:\Progarms Files\Apache Group\Apache2) accordingly to what you mentioned above.... I also modified database.mysql.inc with the following info:

    $connection = mysql_connect($url['localhost'], $url['drupal'], $url['drupal'], TRUE) or die(mysql_error()); mysql_select_db(substr($url['path'], 1)) or die('unable to select database');

    Please help, I am trying to learn drupal and I got stuck...

    Thanks

    btw, i ran phpinfo to verify mysql and it wasn't there

    • Log in or register to post comments

    Lỗi error call to undefined function mysql_connect in c program năm 2024

    coreyp_1 commented 3 December 2005 at 23:12

    if phpinfo isn't showing mysql as installed, then don't bother with drupal yet... your problems lie elsewhere.

    you must turn on mysql in your php.ini file, just as the previous post stated. Did you install everything on your own, or did you follow a tutorial, or use another, completely different method (like WAMP5)?

    • Log in or register to post comments

    Lỗi error call to undefined function mysql_connect in c program năm 2024

    trantt commented 5 December 2005 at 04:28

    corey, I installed everything on my own. I was able to import drupal database to mysql server, and I was also ran php from apache web server... Only one problem left (before starting to learn drupal) is php connection to mysql server: 1. I copied php.ini to apache root folder (C:\Program Files\Apache Group\Apache2) 2. The following changes were made to the php.ini: 1. extension_dir = "C:\Program Files\Apache Group\PhP51\ext\" 2. extension=php_mysql.dll 3. The following changes were made to the httdp.config: AddHandler server-parsed .shtml LoadModule php5_module "C:/Program Files/Apache Group/PhP51/php5apache2.dll" AddType application/x-httpd-php .php # configure the path to php.ini PHPIniDir "C:/Program Files/Apache Group/PhP51"

    DirectoryIndex index.shtml index.php index.php5 index.html index.html.var

    NameVirtualHost *:80

    I have been searching for an answer for the past two days but haven't found an answer yet.

    Thanks

    • Log in or register to post comments

    Lỗi error call to undefined function mysql_connect in c program năm 2024

    trantt commented 5 December 2005 at 05:06

    I tried this before (copy php.ini to c:\windows and php_mysql.dll and libmysql.dll to c:\windows\System32) and it failed as well. If I'm not wrong, this method is used for IIS server.

    • Log in or register to post comments

    Lỗi error call to undefined function mysql_connect in c program năm 2024

    dmeikle commented 9 December 2005 at 06:27

    after placing the php.ini file in c:\winnt I uncommented the extension=php_mysql.dll

    then i RESTARTED IIS in the services (not by right click->restart IIS in the ISS manager).

    this gave me an error of './ext' not found - I knew i was finally onto something !

    I then uncommented: extension_dir="c:\php\ext"

    restarted IIS in the services again, and voila! it worked. thanks for all the good hints and tips in the above threads. they worked for me.

    • Log in or register to post comments

    Lỗi error call to undefined function mysql_connect in c program năm 2024

    mgdoyle commented 2 May 2008 at 21:51

    Make sure that the php.ini is only in C:\Windows and not in your php root directory where the php.exe file is. You can leave it as php-dist.ini and rename it only in the c:\windows directory.

    Hope that helps.

    • Log in or register to post comments

    Lỗi error call to undefined function mysql_connect in c program năm 2024

    liquidf commented 1 July 2008 at 08:59

    The last thing that was missing for me was the following:

    Both libmysql.dll and php_mysql.dll have to be in the C:\WINDOWS\system32 folder. Additionally, php.ini must be in C:\WINDOWS\ as others have stated.

    • Log in or register to post comments

    Lỗi error call to undefined function mysql_connect in c program năm 2024

    Hi,

    I had the same problem with PHP, MySql and Apache.

    I finally solved my problem with the following:

    1.Search your server for libmysql.dll. Delete any instance of libmysql.dll that is not in the C:\PHP directory. This limits the possibility of older MySQL client API's being used with PHP.

    2.Search your server for php_mysql.dll. Delete any instance of php_mysql.dll that is not in the C:\PHP directory. This limits the possibility of older MySQL client API's being used with PHP.

    3.Open your C:\%WIN%\php.ini file in a text editor (Notepad will work).

    Search for the line that looks like --> ;extension=php_mysql.dll

    Change this line to --> extension=php_mysql.dll

    Uncomment: extension_dir="c:\php\ext"

    Save the modified php.ini file.

    4. Copy php.ini to C:\%WIN%\System32

    5. Copy C:\PHP\libmysql.dll and C:\PHP\ext\php_mysql.dll to the C:\%WIN%\system32 folder.

    Restart Apache/IIS and test it out.

    It worked for me

    • Log in or register to post comments

    Lỗi error call to undefined function mysql_connect in c program năm 2024

    ricem84 commented 31 March 2009 at 05:26

    I’m getting a similar error message. I tried the things mentioned, and it hasn’t worked yet.

    I’m a little clueless.

    In C:\%WIN%\System32, is %WIN% a wildcard for whatever path goes from C to System32?

    Php.ini is supposed to go in System 32? My browsers could still read php.ini with it in the php folder.

    Is having more than one copy of a .dll on the computer a detriment? If the .dll is called upon, does it directly search a certain location?

    How do you restart Apache/IIS?

    Is an INI-DIST file the same as a .ini file?

    Where do libmysql.dll and php_mysql.dll go – the instances you don’t delete? Do they go in the /ext folder or the php folder?

    Is there any other way to diagnose my problem if trying what was mentioned to work doesn’t work?

    Thanks.

    • Log in or register to post comments

    Lỗi error call to undefined function mysql_connect in c program năm 2024

    Parabola commented 31 March 2009 at 13:40

    Ricem84, A little googling would go a long way for most of what you are asking. There are tons of tutorials on getting PHP working with IIS. to restart IIS, open the IIS MMC, right click the local computer, goto all tasks, and click Restart IIS.

    • Log in or register to post comments

    Lỗi error call to undefined function mysql_connect in c program năm 2024

    ricem84 commented 31 March 2009 at 21:17

    I found this site by googling. I could either google for a lot more hours or just post on this message board and hope someone answers my newbie questions, which all relate to the php not detecting mysql problem. Sometimes I have trouble finding the answers to things that are background knowledge.

    I don't think I'm using IIS, which would explain why I've never heard it before. I'm using Apache and mysql.

    Does that mean the solution mentioned isn't right for me? Because I'm using Apache?

    • Log in or register to post comments

    Lỗi error call to undefined function mysql_connect in c program năm 2024

    ricem84 commented 10 April 2009 at 19:01

    georgestaban's technique worked, I think!

    so...I was being idiotic when I wrote this post. I forgot to use localhost. No problems.

    Dammit. It didn't work. I am at a complete loss about this fatal error error.

    • Log in or register to post comments

    Lỗi error call to undefined function mysql_connect in c program năm 2024

    ricem84 commented 10 April 2009 at 19:49

    Searching on the net, there aren't that many people who have this problem. Can the problem be solved when installing? I don't mind reinstalling. I haven't customized Apache. Is there some option I chose or didn't choose to make things work with mysql?

    • Log in or register to post comments

    Lỗi error call to undefined function mysql_connect in c program năm 2024

    ricem84 commented 19 April 2009 at 00:29

    Okay, I finally got it. I did everything that people suggested and it didn't work until I added a copy of php.ini to c:\php The main problem I found was that php.ini's address was showing as not present when I looked at phpinfo(); until I moved it somewhere else.

    • Log in or register to post comments

    Lỗi error call to undefined function mysql_connect in c program năm 2024

    sboyce commented 10 December 2009 at 19:19

    Worked! Thanks georgesteban22. I've been fighting with this all week and tried several other "suggestions" from the web but yours was the one that worked. So glad I found your response. I've installed all of this several times in the past and never had a problem. But, I recently got a new computer with all the latest and "greatest" updates and I've had nothing but heartache. You're a gem, thanks again so much for your perserverance figuring this out!