Jump to content

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

Link to comment
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..

 

Link to comment
Share on other sites

  • 2 weeks later...
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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.