deemurphy Posted July 5, 2005 Share Posted July 5, 2005 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 https://forums.phpfreaks.com/topic/2383-connecting-to-database/ Share on other sites More sharing options...
karnetics Posted July 8, 2005 Share Posted July 8, 2005 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 https://forums.phpfreaks.com/topic/2383-connecting-to-database/#findComment-7823 Share on other sites More sharing options...
Rederick Posted July 16, 2005 Share Posted July 16, 2005 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 https://forums.phpfreaks.com/topic/2383-connecting-to-database/#findComment-7907 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.