SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast Ckeren's Avatar
    Join Date
    Jun 2001
    Location
    AU
    Posts
    98
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    MySQL db connection with php

    was trying to connect the data base from phtml but the error pop up was

    Fatal Error: Call to undefined function: mysql_pconnect() in /var/www/html/members/login_mysql.phtml

    The command inside login_mysql.phtml

    <?php
    $link = mysql_pconnect("localhost","ckeren","my_secret")
    or die ("connection fail");
    ?>

    Done in Linux 7.1 , php4, MsQL V3.23.36

    What's been done soo far
    host name (-h) Correct
    username (-u) Exists
    Password (-p) Correct

    2 days still awake with help of caffeine

    please help

  2. #2
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sounds like PHP was not compiled with mysql functions, or the version you are using doesn't have builtin support for MySQL. Did you try just plain old mysql_connect(), doubt you will get a better result, but its worth a try. Sounds like you need to recompile PHP.
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  3. #3
    ********* Callithumpian silver trophy freakysid's Avatar
    Join Date
    Jun 2000
    Location
    Sydney, Australia
    Posts
    3,798
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You are trying to open a persistent connection to the mysql server. What about opening a vanilla flavoured (non-persistent) connection?:

    $link = mysql_connect("localhost","ckeren","my_secret")

    Does that work? If so, then it may be that you do not have persistant connections turned on in your php.ini file like so:

    mysql.allow_persistent = On

    Otherwise, like freddy says - you will need to recompile with a configuration that includes mysql.

  4. #4
    SitePoint Enthusiast Ckeren's Avatar
    Join Date
    Jun 2001
    Location
    AU
    Posts
    98
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Finally, phew...!

    Thanks guys for your GREAT SUPPORT!

    I wasn't notice and realised if php-mysql-4.0.4pl1-9.i386.rpm was properly installed, infact it wasn't installed at all.

    Afterall everything goin' just all right

    next time should initailly understand the syntext error its quite obvious though hehehe what kind of idiot am I.

    Now start to enjoy php and MySQL they really rocks.

    Thanx freakysid, freddydoesphp for your reply. (BigMac meals for you guys "I wish")

  5. #5
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Please don't come within 50 ft of me with a Big-Mac Meal
    Or I will be forced to withdraw my post!
    Please don't PM me with questions.
    Use the forums, that is what they are here for.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •