Results 1 to 13 of 13

Thread: PHP Noob Needs Help with SQL

  1. #1

    Thread Starter
    Member
    Join Date
    Mar 2004
    Location
    Canada
    Posts
    47

    Question PHP Noob Needs Help with SQL

    Ok here's my problem "I CAN'T TO MY SQL DB". I'm using PHP 4.3.8, IIS 5.1, and MSDE 2000. I Get the following error

    Warning: mysql_connect(): Can't connect to MySQL server on 'localhost' (10061) in c:\inetpub\wwwroot\index.php on line 6

    Line 5 $link="localhost";
    Line 6 mysql_connect($link);

    Pls Help

    Dave
    Dave

  2. #2
    Fanatic Member brown monkey's Avatar
    Join Date
    Jun 2004
    Location
    Cebu
    Posts
    552
    mysql is for mysql. if you have mysql server/client intalled in your system, this works provided you start the service. in your case you use msde, i can't help you. perhaps you could read odbc_connect() then configure your datasource. i'm not sure though. i don't use this. and oh. i'm noob too. hehe. in case you want access db, i do this.

    Code:
    made a northwind.mdb
    go to control panel->administrative tools->data sources
    system dsn tab->driver do microsoft access (*.mdb)->finish
    name your data source northwind
    select database->find the northwind.mdb
    then ok
    try this
    PHP Code:
    <?php
       $cn
    =odbc_connect("northwind","","",SQL_CUR_DEFAULT);
       
    $result=odbc_do($cn,"select * from territories");
       echo 
    '<table border=1>';
       while(
    $row=odbc_fetch_array($result)){
          echo 
    '<tr>';
          foreach(
    $row as $r) echo '<td>'.$r.'</td>';
          echo 
    '</tr>';
       }
       echo 
    '</table>';
    ?>
    i don't know if this helps mate. if totally not, my big sorry.

  3. #3
    Hyperactive Member AvisSoft's Avatar
    Join Date
    Sep 2002
    Location
    Chandigarh
    Posts
    459
    Hello!

    No need to do all that. I face this problem everytime i install mysql. Anyways the solution is:

    just execute this: c:\mysql\bin\mysql --install

    re-start your pc and then try the sql thing.

    Thanks!
    Tapan Bhanot,
    CEO, Avis Software.
    Website: www.avissoftware.com

  4. #4
    Fanatic Member brown monkey's Avatar
    Join Date
    Jun 2004
    Location
    Cebu
    Posts
    552
    he doesn't have my mate. he only has iis, php and msde.

  5. #5
    Hyperactive Member AvisSoft's Avatar
    Join Date
    Sep 2002
    Location
    Chandigarh
    Posts
    459
    Originally posted by brown monkey
    he doesn't have my mate. he only has iis, php and msde.
    I think either he forgot to mention or forgot to install .. as he's using all the stuff related to mysql and also getting errors of mysql

    Warning: mysql_connect(): Can't connect to MySQL server on 'localhost' (10061) in c:\inetpub\wwwroot\index.php on line 6

    Line 5 $link="localhost";
    Line 6 mysql_connect($link);
    Tapan Bhanot,
    CEO, Avis Software.
    Website: www.avissoftware.com

  6. #6
    Fanatic Member brown monkey's Avatar
    Join Date
    Jun 2004
    Location
    Cebu
    Posts
    552
    perhaps.

  7. #7
    Hyperactive Member AvisSoft's Avatar
    Join Date
    Sep 2002
    Location
    Chandigarh
    Posts
    459
    We'll never know till OctaneChicken replies! This is a big mystery!
    Tapan Bhanot,
    CEO, Avis Software.
    Website: www.avissoftware.com

  8. #8

    Thread Starter
    Member
    Join Date
    Mar 2004
    Location
    Canada
    Posts
    47
    Ok here's the prob. "I Have No Idea What I'm Doing" (Noob).

    regarding this,
    Warning: mysql_connect(): Can't connect to MySQL server on 'localhost' (10061) in c:\inetpub\wwwroot\index.php on line 6

    Line 5 $link="localhost";
    Line 6 mysql_connect($link);

    that was the error i got on my page and line 6 is, well line 6 that screwed up.

    I have a few Questions.

    1) What is the difference between MSDE and MySQL?
    2) Can the MSDE work with PHP?



    so

    Thanks all for helping
    Dave

  9. #9
    Hyperactive Member AvisSoft's Avatar
    Join Date
    Sep 2002
    Location
    Chandigarh
    Posts
    459
    Originally posted by OctaneChicken
    Ok here's the prob. "I Have No Idea What I'm Doing" (Noob).

    regarding this,
    Warning: mysql_connect(): Can't connect to MySQL server on 'localhost' (10061) in c:\inetpub\wwwroot\index.php on line 6

    Line 5 $link="localhost";
    Line 6 mysql_connect($link);

    that was the error i got on my page and line 6 is, well line 6 that screwed up.

    I have a few Questions.

    1) What is the difference between MSDE and MySQL?
    2) Can the MSDE work with PHP?



    so

    Thanks all for helping
    Hello!

    Have you installed MySQL ? You can check by telling weather there's a folder named C:\MySQL exists or not.

    I may sound dumb but what is MSDE stands for ?

    Thanks!
    Tapan Bhanot,
    CEO, Avis Software.
    Website: www.avissoftware.com

  10. #10

    Thread Starter
    Member
    Join Date
    Mar 2004
    Location
    Canada
    Posts
    47
    I didn't Install MySQL. I installed MSDE (Microsoft SQL Server 2000 Desktop Engine (MSDE 2000) Release A) hoping that i could use that instead of MySQL.

    Dave
    Dave

  11. #11
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687
    you can use MSDE, BUT you can't use the mySQL calls.... as someone mentioned early on, you have to use the ODBC functions..... mySQL functions are specifically for mySQL databases. The ODBC ones are for anything else.

    TG
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  12. #12

    Thread Starter
    Member
    Join Date
    Mar 2004
    Location
    Canada
    Posts
    47
    ok i'll try that

    Thank you all much
    Dave

  13. #13
    Frenzied Member ober0330's Avatar
    Join Date
    Dec 2001
    Location
    OH, USA
    Posts
    1,945
    Once again, techgnome, you are wrong. There are defined calls for MSDE/SQL Server 7/2K. Instead of "mysql_connect", you have to use "mssql_connect". You also have to uncomment the extension in php.ini, and there is a dll you're going to need in your extensions directory. Look on php.net for more installation details and ask questions if you have more. There was another thread just recently on this, and it should give you some pointers.

    And in case you were wondering, MSDE is the MS SQL Server database format.
    format your code!! - [vbcode] [/vbcode]

    ANSWERS CAN BE FOUND HERE!!

    my personal company

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