Results 1 to 11 of 11

Thread: [RESOLVED] Error on MYSQL

  1. #1

    Thread Starter
    Addicted Member thamizhinpan's Avatar
    Join Date
    Dec 2005
    Location
    TE
    Posts
    243

    Resolved [RESOLVED] Error on MYSQL

    I have newly installed mysql saver on computer yesterday.

    Code:
    <?php
    $con = mysql_connect("localhost","home","iagree");
    if (!$con)
      {
      die('Could not connect: ' . mysql_error());
      }
    
    // some code
    
    ?>
    But when I run a PHP file with this code I have been getting this error message
    Code:
    Fatal error: Call to undefined function mysql_connect() in I:\Inetpub\wwwroot\PHPTest\SQLTest.php on line 2
    What is wrong on my code?
    If above question or answer will help to you
    Don't forget to rate me
    தமிழ்இன்பன்

  2. #2
    PowerPoster kfcSmitty's Avatar
    Join Date
    May 2005
    Posts
    2,248

    Re: Error on MYSQL

    I have no idea what MySQL Saver is, but here is a whole list of solutions to your issue:

    http://www.google.ca/search?q=%22Fat...ient=firefox-a

    It seems mysql support has not been installed properly. You can verify by creating a simple php page with

    Code:
    <?php
    phpinfo();
    ?>
    And search for MySQL. If it fails to find it, then the support has not been added.

  3. #3

    Thread Starter
    Addicted Member thamizhinpan's Avatar
    Join Date
    Dec 2005
    Location
    TE
    Posts
    243

    Re: Error on MYSQL

    Ok, I'll try to install it correctly.
    Thanks
    Last edited by thamizhinpan; Dec 18th, 2007 at 02:22 PM.
    If above question or answer will help to you
    Don't forget to rate me
    தமிழ்இன்பன்

  4. #4

    Thread Starter
    Addicted Member thamizhinpan's Avatar
    Join Date
    Dec 2005
    Location
    TE
    Posts
    243

    Re: Error on MYSQL

    Ok, I have solved that error.
    But Now I couldn't got any message unless "Start" for this code.
    Code:
    <?php
      echo ("Start");
    $con = mysql_connect("localhost","home","iagree");
      echo ("Test2");
    if (!$con)
      {
      die('Could not connect: ' . mysql_error());
      }
      echo ("End");
    
    // some code
    
    ?>
    What is problem now?
    If above question or answer will help to you
    Don't forget to rate me
    தமிழ்இன்பன்

  5. #5
    PowerPoster kfcSmitty's Avatar
    Join Date
    May 2005
    Posts
    2,248

    Re: Error on MYSQL

    try

    Code:
    <?php
      echo ("Start");
    $con = mysql_connect('localhost','home','iagree') or Die("Error: " . mysql_error());
    ?>
    You sure you have the MySQL server running on your PC with a user called "home" and a password "iagree"?

    The password will be case sensitive FYI.
    Last edited by kfcSmitty; Dec 19th, 2007 at 01:08 PM.

  6. #6
    Frenzied Member I_Love_My_Vans's Avatar
    Join Date
    Jan 2005
    Location
    In the PHP compiler
    Posts
    1,275

    Re: Error on MYSQL

    @kfvSmitty


    Code:
    <?php
      echo ("Start");
    $con = mysql_connect('localhost','home','iagree') or Die("Error: " . mysql_error());
    ?>
    You need one more ) at the end of your connect code.

  7. #7

    Thread Starter
    Addicted Member thamizhinpan's Avatar
    Join Date
    Dec 2005
    Location
    TE
    Posts
    243

    Re: Error on MYSQL

    Oh No!...
    I have tired on installing PHP & MySQL 5.
    On last post I have wrote that I have Solved
    "Call to undefined function mysql_connect()"
    Error. But now I found that I din't solve that error until yet.
    I didn't see that error on that time, because unfortunatly
    I changed display_errors veriable as OFF on php.ini.

    Now I changed it back to On mode.

    I have saw your Google search results. Thanks for it.
    But I cannot be able to solve my problum by guidlines those web pages.

    I know you can't identify error of installation methord with out more details.
    So I'm giving details on short form. and I'm attaching the phpinfo page,
    php.ini, my.ini

    with this reply.

    Version = php-5.2.5-Win32
    PHP base folder = C:\PHP5

    php5ts.dll at C:\php5
    php.ini at I:\windows
    php.ini-dist Changed as PHP.ini

    I have edited on PHP.ini
    =====================================
    doc_root =I:\inetpub\wwwroot
    extension_dir = c:\php5\ext

    removed ; mark on ;extension=php_mysql.dll.

    -----------------------------------------------
    sql version = mysql-5.0.0a-alpha-win
    SQL base folder= c:\mysql\
    If I couldn't install MYSQL, I can't learn it myself on my PC.
    So please help me.
    Attached Files Attached Files
    If above question or answer will help to you
    Don't forget to rate me
    தமிழ்இன்பன்

  8. #8
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: Error on MYSQL

    1. Check that C:\php5\ext\php_mysql.dll exists.
    2. Check that you have the file libmysql.dll in your mysql installation folder.
    3. If it does either copy it to your PHP directory or add its path to the PATH environment variable. My Computer (right click) --> Properties --> Advanced --> Environment Variables.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  9. #9
    PowerPoster kfcSmitty's Avatar
    Join Date
    May 2005
    Posts
    2,248

    Re: Error on MYSQL

    You could also scrap the installation you have and use an all-in-one installer such as WAMP, which will install Apache, MySQL, and PHP in an easy to use step-by-step installer on a Windows system.

    Link: http://www.wampserver.com/en/

  10. #10
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Error on MYSQL

    Check that the IIS user account that you're using for that website has appropriate permissions to access the c:\php5\ext directory.

  11. #11

    Thread Starter
    Addicted Member thamizhinpan's Avatar
    Join Date
    Dec 2005
    Location
    TE
    Posts
    243

    Re: Error on MYSQL

    Hi, I'm very happy to say that mysql saver is working on my pc.
    But I have set a different setting on sql saver
    (I haven't read this method on any book until yet. So I don't know

    about the side effects of this method. If any one know about it

    please inform me)
    That I changed WinMySQLadmin server as "mysqld-max-nt.exe" from "

    mysqld-nt.exe".
    But all books suggest mysqld-nt.exe for Windows XP.
    But I haven't see any errors on it until yet.

    Any way Thanks for all, Who take efforts to solve my problem.
    I'm learning PHP happily with MYSQL Support with out others help.
    If above question or answer will help to you
    Don't forget to rate me
    தமிழ்இன்பன்

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width