kaustubhghag Posted March 2, 2006 Share Posted March 2, 2006 I have Installed MySQL on windows 2000 professional operating system and then i have created ijdb as new database in which i have created joke table.so when i tried to connect to that table and try to retrieve values it shows me following message:Fatal error: Call to undefined function mysql_connect() in e:\Inetpub\wwwroot\connect.php on line 6Following is the code:html><head><title>Our List of Jokes</title><body><?php// Connect to the database server$dbcnx = @mysql_connect('localhost', 'root', 'mypasswd');if (!$dbcnx) {exit('<p>Unable to connect to the ' .'database server at this time.</p>');}// Select the jokes databaseif (!@mysql_select_db('ijdb')) {exit('<p>Unable to locate the joke ' .'database at this time.</p>');}?><p>Here are all the jokes in our database:</p><blockquote><?php// Request the text of all the jokes$result = @mysql_query('SELECT joketext FROM joke');if (!$result) {exit('<p>Error performing query: ' . mysql_error() . '</p>');}// Display the text of each joke in a paragraphwhile ($row = mysql_fetch_array($result)) {echo '<p>' . $row['joketext'] . '</p>';echo "Hello";}?></blockquote></body></html>html><head><title>Our List of Jokes</title><body><?php// Connect to the database server$dbcnx = @mysql_connect('localhost', 'root', 'root');if (!$dbcnx) {exit('<p>Unable to connect to the ' .'database server at this time.</p>');}// Select the jokes databaseif (!@mysql_select_db('ijdb')) {exit('<p>Unable to locate the joke ' .'database at this time.</p>');}?><p>Here are all the jokes in our database:</p><blockquote><?php// Request the text of all the jokes$result = @mysql_query('SELECT joketext FROM joke');if (!$result) {exit('<p>Error performing query: ' . mysql_error() . '</p>');}// Display the text of each joke in a paragraphwhile ($row = mysql_fetch_array($result)) {echo '<p>' . $row['joketext'] . '</p>';echo "Hello";}?></blockquote></body></html>so can anyone guide what is problem Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted March 2, 2006 Share Posted March 2, 2006 You need to enable the MySQL extrension in the php.ini file. PHP5.x no longer provides MySQL Support inbuilt and so you need to manually enable the mysql extension in the php.iniClick [a href=\"http://www.phpfreaks.com/forums/index.php?showtopic=87276\" target=\"_blank\"]here[/a] to see how to do so. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.