SitePoint Sponsor |
|
User Tag List
Results 1 to 10 of 10
Thread: MySQL and PHP 4.2.0
-
Apr 24, 2002, 10:50 #1
- Join Date
- Mar 2002
- Location
- Columbia, South Carolina
- Posts
- 304
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
MySQL and PHP 4.2.0
Hi, I just upgraded to PHP 4.2.0... have they changed the way you connect to mysql? Cos I can get to mysql VIA command line but when I do it in a script ( @mysql_connect("localhost","myusername","mypass") or die(mysql_error()) ), I get an access denied error (see Http://clete.d2g.com/Guestbook/index.php )
-
Apr 24, 2002, 11:48 #2
- Join Date
- Mar 2002
- Location
- Columbia, South Carolina
- Posts
- 304
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
also the server's behavior is odd, its the newest apache, dled today. I must start the server with the last 2 lines commented (
AddType application/x-httpd-php .php
LoadModule php4_module modules/libphp4.so)
which will disable php... then i use bin/apachectl restart after i uncomment those lines. then it works, no other way, anyone know a solution? should i revert back to Apache1.3?
-
Apr 24, 2002, 15:40 #3
- Join Date
- Jul 2001
- Location
- Missouri
- Posts
- 3,428
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally posted by Clete2
should i revert back to Apache1.3?
otherwise, no, you should be able to connect to MySQL just fine if you username/password is correct.- Matt** Ignore old signature for now... **
Dr.BB - Highly optimized to be 2-3x faster than the "Big 3."
"Do not enclose numeric values in quotes -- that is very non-standard and will only work on MySQL." - MattR
-
Apr 24, 2002, 18:56 #4
- Join Date
- Mar 2002
- Location
- Columbia, South Carolina
- Posts
- 304
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
yea, it failed when i said apxs, told me to use apxs2... so I did, sorry i didn't say so but i got it fixed not the odd server startup tho, maybe its a bug...
-
Apr 24, 2002, 21:00 #5
- Join Date
- Mar 2002
- Location
- Columbia, South Carolina
- Posts
- 304
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
oh sorry to ask soo much but umm what can I use besides ?Name=1 in the title bar in 4.2.0? Since it doesn't work...
-
Apr 25, 2002, 05:27 #6
- Join Date
- Mar 2002
- Location
- Columbia, South Carolina
- Posts
- 304
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally posted by Clete2
oh sorry to ask soo much but umm what can I use besides ?Name=1 in the title bar in 4.2.0? Since it doesn't work...
-
Apr 25, 2002, 14:51 #7
- Join Date
- Jul 2001
- Location
- Missouri
- Posts
- 3,428
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
a form wouldn't work either.
i don't think it's a problem with PHP, but your scripts. register_globals is probably off if you used the new php.ini. you basically have 2 choices: 1) turn register_globals on in php.ini, or 2) access your variables the preferred way, as $_GET['Name'] instead of $Name, etc.
-
Apr 25, 2002, 14:57 #8
- Join Date
- Mar 2002
- Location
- Columbia, South Carolina
- Posts
- 304
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
hmm yes I got this info from another person... only thing is when I use $_POST[""] and GET to do stuff... doesn't work... here is what I got:
PHP Code:<? // PHP42.php
$name="test.html";
$_POST['yay'] = $name;
?>
<a href="Bla.php"><? echo $name; ?></a>PHP Code:<? .. Bla.php
$_GET['yay'] = $name;
echo $name;
include("$name"); // Yes, I know there is a big security risk with this
?>
1) pass name to Bla.php
2) Include $name in the page
what am I doing wrong?
-
Apr 25, 2002, 15:09 #9
- Join Date
- Jul 2001
- Location
- Missouri
- Posts
- 3,428
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
your assignments are wrong in those examples.
go to `file.php?name=file.html'. in file.php:
PHP Code:<?php
include($_GET['name']);
?>
-
Apr 25, 2002, 18:11 #10
- Join Date
- Mar 2002
- Location
- Columbia, South Carolina
- Posts
- 304
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
ohh -- worked, thanks!
Bookmarks