|
-
Jul 23rd, 2004, 09:55 PM
#1
Thread Starter
Member
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 
-
Jul 23rd, 2004, 10:55 PM
#2
Fanatic Member
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.
-
Jul 24th, 2004, 01:34 AM
#3
Hyperactive Member
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
-
Jul 24th, 2004, 01:36 AM
#4
Fanatic Member
he doesn't have my mate. he only has iis, php and msde.
-
Jul 24th, 2004, 01:40 AM
#5
Hyperactive Member
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
-
Jul 24th, 2004, 01:43 AM
#6
-
Jul 24th, 2004, 03:14 AM
#7
Hyperactive Member
We'll never know till OctaneChicken replies! This is a big mystery!
Tapan Bhanot,
CEO, Avis Software.
Website: www.avissoftware.com
-
Jul 24th, 2004, 08:00 AM
#8
Thread Starter
Member
-
Jul 24th, 2004, 08:06 AM
#9
Hyperactive Member
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
-
Jul 24th, 2004, 11:41 AM
#10
Thread Starter
Member
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 
-
Jul 24th, 2004, 11:58 AM
#11
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
-
Jul 24th, 2004, 11:27 PM
#12
Thread Starter
Member
ok i'll try that
Thank you all much
Dave 
-
Jul 26th, 2004, 07:04 AM
#13
Frenzied Member
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|