newbie question about mysql/php

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
just tried my first mysql funcition: mysql_connect().  When I try it in my
browser I get "Fatal Error: undefined function mysql_connect():  I'm running
apache2, php5 and mysql 5.0.22 - all running on Ubuntu 6.06.  I can execute
simple php scripts and phpinfo() works fine.  What is my problem?

Re: newbie question about mysql/php

Kimmo Laine wrote:
Quoted text here. Click to load it

Unless next_page.php generates PHP, the script with this include will
only get HTML.

Quoted text here. Click to load it


    if (isset($_GET['foo'])) {
      echo '<?php echo $_GET[\'foo\']; ?>';
    } else {
      echo '<?php echo \'Not available\'; ?>';

File not found: (R)esume, (R)etry, (R)erun, (R)eturn, (R)eboot

Re: newbie question about mysql/php

jbo wrote:
Quoted text here. Click to load it

When you ran phpinfo() did you see a group of information for MySQL?  
It's towards the end. If not did you do any modification in the PHP.ini  
and Apache2.conf for MySQL to run with them?

In your PHP.ini:
- Uncomment ';extension=php_mysql.dll' so it will loaded.
- Make sure your extension path is set correctly. Typically:
   extension_dir = "C:/php/ext"

In your Apache2 config file httpd.conf
- Make sure you have these entries :
   LoadModule php5_module "C:/php/php5apache2.dll"
   AddType application/x-httpd-php .php
- Make sure you added 'index.php' to the DirectoryIndex statement

If you make any changes to php.ini or apache2 config then restart your  
Apache2 server.

Else look at the documentation here:

Thanks in Advance...
IchBin, Pocono Lake, Pa, USA    
'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor,  Regular Guy (1952-)

Site Timeline