php-windows Digest 16 Apr 2005 23:07:27 -0000 Issue 2635
Topics (messages 25857 through 25858):
Re: PHP5 and MySQL
25857 by: Janet Valade
Windows 2003 SP1 / PHP 5.03
25858 by: Liquidfrog
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[email protected]
----------------------------------------------------------------------
--- Begin Message ---
JC Botha wrote:
Ok, I did the phpinfo() and only the SQLlite is listed there, no MySQL
is listed. I did enable the php_mysql.dll and set the windows path to
c:\php. What else it there that I can look at. Thanks for all the
links sent to me, I read them all and try to follow the instructions
but some how I dont do someting tight on my XP computer.
In your php.ini file, you will find a line:
extension=php_mysql.dll
This line should not have a ; in the beginning of the line. If it does,
remove it. Then, restart apache. That's all you need to do to enable
MySQL support. After you do this, look at the phpinfo() output again.
You will see that MySQL is now shown in the output.
Janet
On 4/15/05, Janet Valade <[EMAIL PROTECTED]> wrote:
JC Botha wrote:
This is the Browser error:
Fatal error: Call to undefined function mysql_connect() in
C:\apache\htdocs\cedarintranet\index.php on line 3
This error means that MySQL support is not enabled in your PHP. In PHP
4, this was done automatically. Now you need to enable it yourself when
you install. You can tell whether it's enabled by running a phpinfo()
statement in your PHP script. This statement outputs a long list of PHP
settings. Somewhere in that list, it provides a block of MySQL settings
for installations that have MySQL support enabled. If your output
doesn't show the MySQL settings, then MySQL support is not enabled.
To enable it on a Windows machine, in your php.ini file, uncomment the
"extension" line for mysql. You may need to restart Apache after you
edit the php.ini file. Be sure you are making changes in the php.ini
file that PHP is using. The output, mentioned above, from phpinfo()
shows the path to the php.ini file that PHP is using.
Janet
This is my php code:
// Connect to the database server
$dbcnx = mysql_connect("localhost", "intranet", "1234");
if (!$dbcnx) {
echo( "<P>Unable to connect to the " .
"database server at this time. Please make use of the contact
page.</P>" );
exit();
}
// Select the database
if ([EMAIL PROTECTED]("cedarintranet") ) {
echo( "<P>Unable to connect to the " .
"database server at this time. Please contact webmaster at
[EMAIL PROTECTED]</P>" );
exit();
}
On 4/15/05, Kevin Smith <[EMAIL PROTECTED]> wrote:
Perhaps posting you code will help us resolve your problem.
JC Botha wrote:
Dear Users
I'm havin a problem to connect to MySQL through the use of PHP5. I
followed all documentation and none seem to resolve the problem. I'm
running WinXP on the computer that I use to develop the apps. Any
advice out there that could be of help.
Thanks
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
Janet Valade -- janet.valade.com
--
Janet Valade -- janet.valade.com
--- End Message ---
--- Begin Message ---
Hello,
Already posted this over at php.net. Basically they told me to get lost and
that the problem was bogus. I would like to kick that person.
However, I have updated my server to SP1 and I had php 5.0.3 on it. After
doing so I checked out the site today and it stated.
INVALID ACCESS TO MEMORY LOCATION
Once I saw this I was like wtf? So what I did was go and update to 5.0.4
because php.net stated it was important. After doing so I see this now.
http://www.gravityworks.us
However, I know it IS a PHP problem becuase if I change the sites to html
they work fine.
http://www.pcgotbugs.com
Is there anyone out there that can help me with this? This is really
important and without the sites online business is suffering. I do not like
to go back on Service Packs. So any and all information is appreciated.
Sincerely.
Kind regard,
Liquidfrog
--- End Message ---