Jump to content


Photo

Connecting to database


  • Please log in to reply
2 replies to this topic

#1 deemurphy

deemurphy
  • Members
  • PipPipPip
  • Advanced Member
  • 64 posts

Posted 05 July 2005 - 03:07 PM

I installed mysql, using wamp. I created a php script using dreamweaver. I can see my database and tables, but when I do a call to them I get an error:

Fatal error: Call to undefined function mysql_connect() in C:\Inetpub\wwwroot\ru playing\manage.php on line 13

I do the following in my script:

function doDB() {
global $conn;
//connect to server and select database; you may need it
$conn = mysql_connect("localhost", "user", "password") or die(mysql_error());
mysql_select_db("ruplaying",$conn) or die(mysql_error());
}


Of course I am using my userid and password.

The database is spelled corretly. Why would I be getting this area.

Is the code different when using dreamweaver? I used a site to set this up in dreamweaver? Does mysql.exe need to be in the path statement. I also found out I have to do to c:\wamp\mysql\bin to create tables and databases or use phpadmin.

Am I doing something wrong?


Thanks
Dee

#2 karnetics

karnetics
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 08 July 2005 - 03:37 PM

I installed mysql, using wamp. I created a php script using dreamweaver. I can see my database and tables, but when I do a call to them I get an error:

Fatal error: Call to undefined function mysql_connect() in C:\Inetpub\wwwroot\ru playing\manage.php on line 13

I do the following in my script:

function doDB() {
global $conn;
//connect to server and select database; you may need it
$conn = mysql_connect("localhost", "user", "password") or die(mysql_error());
mysql_select_db("ruplaying",$conn) or die(mysql_error());
}
Of course I am using my userid and password.

The database is spelled corretly. Why would I be getting this area.

Is the code different when using dreamweaver?  I used a site to set this up in dreamweaver?  Does mysql.exe need to be in the path statement.  I also found out I have to do to c:\wamp\mysql\bin to create tables and databases or use phpadmin.

Am I doing something wrong?
Thanks
Dee

View Post


Let me ask you a question. In dream weaver you can setup a connection to your database by using the database connection option under applications. When you do this it, it will setup a connect.php file under connects. And then it sounds like you are trying to access your db with your self made script..


#3 Rederick

Rederick
  • Members
  • Pip
  • Newbie
  • 6 posts
  • LocationNanaimo, BC Canada

Posted 16 July 2005 - 04:22 PM

I installed mysql, using wamp. I created a php script using dreamweaver. I can see my database and tables, but when I do a call to them I get an error:

Fatal error: Call to undefined function mysql_connect() in C:\Inetpub\wwwroot\ru playing\manage.php on line 13

I do the following in my script:

function doDB() {
global $conn;
//connect to server and select database; you may need it
$conn = mysql_connect("localhost", "user", "password") or die(mysql_error());
mysql_select_db("ruplaying",$conn) or die(mysql_error());
}
Of course I am using my userid and password.

The database is spelled corretly. Why would I be getting this area.

Is the code different when using dreamweaver?  I used a site to set this up in dreamweaver?  Does mysql.exe need to be in the path statement.  I also found out I have to do to c:\wamp\mysql\bin to create tables and databases or use phpadmin.

Am I doing something wrong?
Thanks
Dee

View Post


Ok do this... make a .php page say "info.php"
then inside the file put
<?php
phpinfo();
?>
Then go there in your webbrowser... If you can see a section about mysql then this is not your problem, but I suspect from that error message that php is not set up to support mysql....this might be of use
http://www.siteinawe...lphp5/howto.php




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users