php-install Digest 17 Mar 2002 00:53:04 -0000 Issue 747

Topics (messages 6378 through 6385):

Re: mysql_db_query is deprecated
        6378 by: Andrey Hristov

Re: how to get a php shell binary
        6379 by: Ray Hunter

Re: Javascript in PHP
        6380 by: Ray Hunter
        6381 by: pong-TC

PHP and MySQL?
        6382 by: Randall Hobbs
        6383 by: Pierre-Alain Joye

problems with 4.1.2 build
        6384 by: Phil Glatz

how to include the same file twice?
        6385 by: Joe Lira

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 ---
 This is because it is better to do

mysql_connect('','','');
mysql_select_db('some');
...

mysql_query()..

...

After selecting the database with mysql_select_db() it is the default, so you don't 
need to provide its resource id.

If you want to make a query to another db just call mysql_select_db() with the name of 
the new db.

Best regards,
Andrey Hristov

----- Original Message ----- 
From: "Martin" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, March 16, 2002 1:28 PM
Subject: [PHP-INST] mysql_db_query is deprecated


> Warning: mysql_db_query is deprecated; use mysql_select_db() and
> mysql_query() instead in i:\apache\htdocs\phoenix\online.php on line 18
> 
> What is this....Why is the server responding
> in this way!!!?
> 
> --
> Martin Eriksson
> webdesigner & Utvecklare
> ----------------------------------------------------------------
> [EMAIL PROTECTED]
> http://www.svensk-design.com
> 
> 
> 
> -- 
> PHP Install Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

--- End Message ---
--- Begin Message ---
PHP does not compile as a binary (CLI) and as a module at the same time.
You will have to compile as binary first then compile again as a module.

For compiling as a CLI do this:

$ ./configure --prefix=/path/to/php
$ make
$ make install

Move the files in the bin directory to somewhere like /usr/bin
Then delete the file "config.cache" and run "make clean", next recompile
with the options that you want for your apache module...make...make
install...

That is all to it...

"Nicholas Ritter" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I have another question, how do I compile php so that have it as a
> module in apache and also a shell binary? I want to call php from a cron
> job (for cacti.)
>
> Nicholas
>
>


--- End Message ---
--- Begin Message ---
All you do is echo or print out the javascript that you want to use...


Ray Hunter


"Thomas A. Dunlap" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Can anyone direct me to a tutorial that shows how to incorporate
> javascript in a php script.
>
>


--- End Message ---
--- Begin Message ---
[EMAIL PROTECTED] writes:
>Can anyone direct me to a tutorial that shows how to incorporate
>javascript in a php script.
>
>
I think if you know JS well.  You can use it anytime when you want to in
PHP ie.

echo "<script language=JavaScript>";
echo "window.close();";
echo "</script>";

Things like above, you can do it upon your imagination.

Hope, this would help.
Pong

--- End Message ---
--- Begin Message ---
Hi guys... I've got a little problem I'm sort of perplexed about. I have PHP compiled 
on my system with MySQL support. PHPINFO shows the MySQL support 
(http://www.expert-html.com/phpinfo.php). but it sure doesn't appear to be there.

MySQL works fine, as I can connect through DBI on the Perl side with no problems 
whatsoever. Whenever I try to connect via PHP, it gives me this error:

Warning:  Access denied for user: 'root@localhost' (Using password: NO) in mysql.php 
on line 13

Warning:  MySQL Connection Failed: Access denied for user: 'root@localhost' (Using 
password: NO)
 in mysql.php on line 13

of course this is running under root (I'm running thr script from the command line), 
but the script will be ran by Apache when I am finished. It doesn't matter what 
username and password I use, it always says the password isn't there, even though it 
is and I know the password is correct. Here's the actual connect line here:

$db = mysql_connect("localhost","username","password");

I can use any authorized username and password in there, and it still tells me I'm not 
using a password. This is also the case when I try to use prewritten software that 
interfaces with MySQL (though PHP and PostgreSQL work perfectly).

Of course I don't have a mysql.so file since PHP is using the MySQL header and library 
files... If I try to compile it without specifying a directory it sort of "locks up" 
PHP (displaying the phpinfo page simply causes it to keep loading for several minutes, 
until it finally times out with the server, and doesn't give me any info whatsoever).

I'm running PHP v4.0.6, and MySQL 3.23.41. 

Any info would be greatly appreciated...

Take care,
Randall

--- End Message ---
--- Begin Message ---
On Sat, 16 Mar 2002 11:23:05 -0600
"Randall Hobbs" <[EMAIL PROTECTED]> wrote:

> Hi guys... I've got a little problem I'm sort of perplexed about. I have PHP 
>compiled on my system with MySQL support. PHPINFO shows the MySQL support 
>(http://www.expert-html.com/phpinfo.php). but it sure doesn't appear to be there.
> 
> MySQL works fine, as I can connect through DBI on the Perl side with no problems 
>whatsoever. Whenever I try to connect via PHP, it gives me this error:
> 
> Warning:  Access denied for user: 'root@localhost' (Using password: NO) in mysql.php 
>on line 13
By default, user root is not able to connect via localhost and don t have to :). But 
in the case you really need ( an admin every for your db will be a better idea), you 
have to change the permissions for the root user ( see mysql permissions chapter in 
mysql doc).


hth

pa
--- End Message ---
--- Begin Message ---
(Extremely sorry for the cross post; I inadvertently sent this to 
php-general first)

I'm trying to build PHP 4.1.2 with an existing static Apache 1.3.23 
installation, and am having some resolution problems I haven't seen before.

This is on a dusty old Free BSD 2.2.2 system, but I was able to build 4.1.1 
with no problems with the same configuration.  It uses gcc version 2.7.2.1 
--- yes, I know I should upgrade the OS, but since it was able to make 
4.1.1 ok a few weeks ago, I'm guessing that isn't the problem.  I'm 
compiling in postgres and gd support, but have the same problem with them out.


I followed the steps (minimal apache, php, fuill apache), running configure 
each time and doing a make clean.

During the PHP make I see:
gcc -I. -I/usr/local/src/php-4.1.2/sapi/apache -I/usr/local/src/php-4.1.2/main
-I/usr/local/src/php-4.1.2 -I/usr/local/src/apache_1.3.23/src/include
-I/usr/local/src/apache_1.3.23/src/os/unix -I/usr/local/src/php-4.1.2/Zend
-I/usr/local/src/php-4.1.2/ext/xml/expat 
-I/usr/local/src/apache_1.3.23/src/include
-I/usr/local/src/apache_1.3.23/src/os/unix -I/usr/local/src/php-4.1.2/TSRM
-g -O2  -c mod_php4.c && touch mod_php4.lo
In file included from /usr/local/src/apache_1.3.23/src/include/httpd.h:72,
                  from mod_php4.c:32:
/usr/local/src/apache_1.3.23/src/include/ap_config.h:1386: warning: 
`XtOffsetOf' redefined
/usr/local/src/php-4.1.2/main/php.h:342: warning: this is the location of 
the previous definition

I was able to fix this by editing main/php.h and removing the extra spaces, 
so the definition was the same as in the other files.

I tried an Apache build, but it gave me:
===> src/modules/php4
gcc -c  -I../../os/unix -I../../include   -funsigned-char
-I/usr/local/src/php-4.1.2 -I/usr/local/src/php-4.1.2/main 
-I/usr/local/src/php-4.1.2/main
-I/usr/local/src/php-4.1.2/Zend -I/usr/local/src/php-4.1.2/Zend
-I/usr/local/src/php-4.1.2/TSRM -I/usr/local/src/php-4.1.2/TSRM 
-I/usr/local/src/php-4.1.2
-DUSE_EXPAT -I../../lib/expat-lite `../../apaci` -fpic -DSHARED_MODULE
mod_php4.c && mv mod_php4.o mod_php4.so-o
In file included from ../../include/httpd.h:72,
                  from mod_php4.c:32:
../../include/ap_config.h:1386: warning: `XtOffsetOf' redefined
/usr/local/src/php-4.1.2/main/php.h:342: warning: this is the location of 
the previous definition
rm -f libphp4.so
gcc -shared -o libphp4.so mod_php4.so-o 
libmodphp4.a  -L/usr/local/src/gd-1.8.4/ 
-L/usr/local/postgres/lib  -L/usr/local/src/gd-1.8.4/ 
-L/usr/local/postgres/lib -Lmodules/php4 -L../modules/php4 
-L../../modules/php4 -lmodphp4   -lpq -lgd -lcrypt -lbind 
-lm  -lcrypt   -lcrypt
ld: libmodphp4.a(zend_alloc.o): RRS text relocation at 0x1cd9 for 
"_zend_unblock_interruptions"
ld: libmodphp4.a(zend_alloc.o): RRS text relocation at 0x1ccd for 
"_alloc_globals"
ld: libmodphp4.a(zend_alloc.o): RRS text relocation at 0x1cc0 for 
"_alloc_globals"

followed by hundreds of similar errors...

thanks 


--- End Message ---
--- Begin Message ---
so at my site:

www.joe.to/live

i have a php page that queries two counter-strike servers to get info on
them

but i can only get it to show ONE server at a time. i am a beginner with php
and i can't figure out why it wont show two at once. the files there are for
you to look at. if you can tell me what's wrong i would REALLY appreciate it
:)

thanks
joe
--- End Message ---

Reply via email to