Jump to content

Archived

This topic is now archived and is closed to further replies.

deemurphy

Connecting to database

Recommended Posts

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

Share this post


Link to post
Share on other sites
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

249214[/snapback]

 

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..

 

Share this post


Link to post
Share on other sites
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

249214[/snapback]

 

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.siteinaweek.com/installphp5/howto.php

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.