Re: [PHP] Re: [PHP-DB] php-mysql problem

2004-05-15 Thread Burhan Khalid
Jianping Zhu wrote:
Hi, thank you for your respinse.
It the /etc/php.ini i have something like:
;
;   extension=modulename.extension
;
; For example:
;
   extension=mysql.so
if you go to 
http://coopunit.forestry.uga.edu:8080/test.php
you will find mysql is not installed as an extension.

but i do not know how to fix this problem.
Do i have to recomplie the phd from source code?
Yes.
See http://www.php.net/mysql for details.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: [PHP-DB] php-mysql problem

2004-05-13 Thread Jianping Zhu
Hi, thank you for your respinse.

It the /etc/php.ini i have something like:

;
;   extension=modulename.extension
;
; For example:
;
   extension=mysql.so

if you go to 
http://coopunit.forestry.uga.edu:8080/test.php
you will find mysql is not installed as an extension.

but i do not know how to fix this problem.

Do i have to recomplie the phd from source code?

Thanks
JP

On Thu, May 13, 2004 at 07:24:28PM +0200, Stefan Dengscherz wrote:
 hello,
 
 did you load the mysql module in your php.ini configuration file?
 i.e. is the following line there:
 extension=mysql.so
 
 regards
 
 On Thu, 13 May 2004 11:47:41 -0400
 Jianping Zhu [EMAIL PROTECTED] wrote:
 
   have redhat 9.0 and Server version: Apache/2.0.40.
i have installed rpms php-4.2.2-17.2.i386.rpm
 php-mysql-4.2.2-17.2.i386.rpm
  
  
 After i create a database called mydb and serveral tables in mysql,
 I tried to run following testdb.php script
  
  
 --
 html
 body
 ?php
 $db = mysql_connect(localhost, root,xx);
 mysql_select_db(mydb,$db);
 $result = mysql_query(SELECT * FROM employees,$db);
 printf(First Name: %sbr\n, mysql_result($result,0,first));
 printf(Last Name: %sbr\n, mysql_result($result,0,last));
 printf(Address: %sbr\n, mysql_result($result,0,address));
 printf(Position: %sbr\n, mysql_result($result,0,position));
 ?
 /body
 /html
 ---
  
 but i got error message with:
 http://coopunit.forestry.uga.edu:8080/testdb.php
 the error is:
 Fatal error: Call to undefined function:
 mysql_connect() in /var/www/html/testdb.php on line 13
  
 How can Fix this problem? Thanks
  
  -- 
  PHP Database Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
  
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: [PHP-DB] PHP/MySql - address book

2002-01-06 Thread Andrey Hristov

The answer to your question is the relational model of databases.
So instead of one big table, you have to use 2. Say first table is employee and the 
second - companies.
in the employee we have some fields and one of them is company_id,
this id corresponds to a single row in the companies table. companies table contains 
several fields nut one of them is company_id.
company_id is a foreign key (the link you ask).

How to get all employees from single company:
select employee.* from employee,companies where 
employee.company_id=companies.company_id and companies.company_name='Some Ltd.
Inc.';
or better
select employee.* from employee left join companies using(company_id) where 
company_name='Some Ltd Inc.';

I do not have links to literature about relational model but I remember that on 
www.phpbuilder.com there is/are some info on it.I
think from y.2000.

Regards,
Andrey Hristov

Andrey Hristov
Web Developer
- Original Message -
From: sg [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, January 06, 2002 7:26 PM
Subject: [PHP-DB] PHP/MySql - address book


 Hi,

 I'm trying to do a sort of address book where I'd put all information about
 anybody or any company from which I receive informtation (friend, people
 from work, hotels, places...)

 An entry starts with a name, then I can have any type of information. The
 table I'm using has a lot of fields, but I display via PHP only those that
 are not empty.

 I'm now facing a problem many must have already faced. A lot of people work
 for the same company, and I'd like to have a separate table or storage area
 to put that data, so that I don't have to write the same company addresse
 twice, and if that information changes, I won't have to go through ten or
 twenty people's entries to modify it.

 So how would I link a company's information to a person's entry?

 I know it may sound easy or ridiculous a question, but though I know HTML
 very well I'm still a beginner (learning on my own) et PHP and MySql.

 So far I have a neat rendering of the database I've created, but I feel I
 should look further into DB use.

 Software I'm using:

 EasyPHP (latest version)
 PHP 4
 MySql
 PhpMyAdmin

 on Windows Me

 Main question, I repeat is : how would I link a company's information to a
 person's entry?

 Cheers

 Sébastien



 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] RE: [PHP-DB] php+mysql simple query help me pls! ty.

2002-01-04 Thread Rick Emery

Test the mysql_query() return value:
$result = mysql_query(SELECT * FROM members) or
die(Error:.mysql_error());

there may be an error in your query.

-Original Message-
From: louie miranda [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 03, 2002 1:59 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: [PHP-DB] php+mysql simple query help me pls! ty.


Hi, can someone help me here! :(
I can't query the data on my sql from php.
db is fine, i couldnt see the prob in php!
pls help, ty.



# MSQL ###
mysql desc members;
+--+-+--+-+-++
| Field| Type| Null | Key | Default | Extra  |
+--+-+--+-+-++
| id   | tinyint(5)  |  | PRI | NULL| auto_increment |
| ircname  | varchar(30) | YES  | | NULL||
| email| varchar(30) | YES  | | NULL||
| realname | varchar(40) | YES  | | NULL||
| asl  | varchar(30) | YES  | | NULL||
| info | varchar(70) | YES  | | NULL||
+--+-+--+-+-++



# PHP 
html
body

?php

$db = mysql_connect(my_db_host, my_db_user, my_db_pass)
or die(Could not connect);

mysql_select_db(mydb,$db);

$result = mysql_query(SELECT * FROM members,$db);

printf(ircname: %sbrn, mysql_result($result,0,ircname));
printf(email: %sbrn, mysql_result($result,0,email));
printf(realname: %sbrn, mysql_result($result,0,realname));
printf(asl: %sbrn, mysql_result($result,0,asl));
printf(info: %sbrn, mysql_result($result,0,info));

?

/body
/html


# ERROR 


  Warning: Supplied argument is not a valid MySQL result resource in
/mnt/host-users/cavite/irc/members/t2.php on line 13
ircname:
n
Warning: Supplied argument is not a valid MySQL result resource in
/mnt/host-users/cavite/irc/members/t2.php on line 14
email:
n
Warning: Supplied argument is not a valid MySQL result resource in
/mnt/host-users/cavite/irc/members/t2.php on line 15
realname:
n
Warning: Supplied argument is not a valid MySQL result resource in
/mnt/host-users/cavite/irc/members/t2.php on line 16
asl:
n
Warning: Supplied argument is not a valid MySQL result resource in
/mnt/host-users/cavite/irc/members/t2.php on line 17
info:
n


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: [PHP-DB] php+mysql simple query help me pls! ty.

2002-01-03 Thread louie miranda

yes, i forgot something,

this = mysql_select_db(mydb,$db); 

i did not specify my db name.


thanks :)


louie
  
- Original Message - 
From: Rick Emery [EMAIL PROTECTED]
To: 'louie miranda' [EMAIL PROTECTED]; [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Friday, January 04, 2002 4:06 AM
Subject: RE: [PHP-DB] php+mysql simple query help me pls! ty.


 Test the mysql_query() return value:
 $result = mysql_query(SELECT * FROM members) or
 die(Error:.mysql_error());
 
 there may be an error in your query.
 
 -Original Message-
 From: louie miranda [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, January 03, 2002 1:59 PM
 To: [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Subject: [PHP-DB] php+mysql simple query help me pls! ty.
 
 
 Hi, can someone help me here! :(
 I can't query the data on my sql from php.
 db is fine, i couldnt see the prob in php!
 pls help, ty.
 
 
 
 # MSQL ###
 mysql desc members;
 +--+-+--+-+-++
 | Field| Type| Null | Key | Default | Extra  |
 +--+-+--+-+-++
 | id   | tinyint(5)  |  | PRI | NULL| auto_increment |
 | ircname  | varchar(30) | YES  | | NULL||
 | email| varchar(30) | YES  | | NULL||
 | realname | varchar(40) | YES  | | NULL||
 | asl  | varchar(30) | YES  | | NULL||
 | info | varchar(70) | YES  | | NULL||
 +--+-+--+-+-++
 
 
 
 # PHP 
 html
 body
 
 ?php
 
 $db = mysql_connect(my_db_host, my_db_user, my_db_pass)
 or die(Could not connect);
 
 mysql_select_db(mydb,$db);
 
 $result = mysql_query(SELECT * FROM members,$db);
 
 printf(ircname: %sbrn, mysql_result($result,0,ircname));
 printf(email: %sbrn, mysql_result($result,0,email));
 printf(realname: %sbrn, mysql_result($result,0,realname));
 printf(asl: %sbrn, mysql_result($result,0,asl));
 printf(info: %sbrn, mysql_result($result,0,info));
 
 ?
 
 /body
 /html
 
 
 # ERROR 
 
 
   Warning: Supplied argument is not a valid MySQL result resource in
 /mnt/host-users/cavite/irc/members/t2.php on line 13
 ircname:
 n
 Warning: Supplied argument is not a valid MySQL result resource in
 /mnt/host-users/cavite/irc/members/t2.php on line 14
 email:
 n
 Warning: Supplied argument is not a valid MySQL result resource in
 /mnt/host-users/cavite/irc/members/t2.php on line 15
 realname:
 n
 Warning: Supplied argument is not a valid MySQL result resource in
 /mnt/host-users/cavite/irc/members/t2.php on line 16
 asl:
 n
 Warning: Supplied argument is not a valid MySQL result resource in
 /mnt/host-users/cavite/irc/members/t2.php on line 17
 info:
 n
 
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: [PHP-DB] PHP/Mysql

2001-11-30 Thread Andrey Hristov

Fatal error: Call to undefined function: mysql_connect() means to things. php is not 
built with integrated mysql support, or php
cannot find php_mysql.so on your comp. What is the value of php.ini variable 
include_path or something similar.

Regards,
Andrey Hristov
- Original Message -
From: Riccardi Moreno [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, November 30, 2001 5:21 PM
Subject: [PHP-DB] PHP/Mysql


 Hello,
 I've got cobalt raq4 with php(work) and mysql(work) but when I try to
 connect via mysql_connect() this error happens:
 Fatal error: Call to undefined function: mysql_connect()
 This is my php.ini:
 [MySQL]
 mysql.allow_persistent  =   On  ; allow or prevent persistent link
 mysql.max_persistent=   -1  ; maximum number of persistent
 links. -1 means no limit
 mysql.max_links =   -1  ; maximum number of links
 (persistent+non persistent).  -1 means no
 mysql.default_port  =   ; default port number for
 mysql_connect().  If unset,
 ;
 mysql_connect() will use the $MYSQL_TCP_PORT, or
 ; entry in
 /etc/services, or the compile-time defin
 ; (in that
 order).  Win32 will only look at MYSQL_P
 mysql.default_host  =   ; default host for
 mysql_connect() (doesn't apply in safe mode)
 mysql.default_user  =   ; default user for
 mysql_connect() (doesn't apply in safe mode)
 mysql.default_password  =   ; default password for
 mysql_connect() (doesn't apply in safe mode)
 ; Note that
 this is generally a *bad* idea to store
 ; in this
 file.  *Any* user with PHP access can run
 ; 'echo
 cfg_get_var(mysql.default_password)' and
 ; password!
 And of course, any users with read acc
 ; file will
 be able to reveal the password as well.
 And this is my httpd.conf:
 # Extra Modules
 #LoadModule php_module
 #LoadModule php3_modul
 LoadModule php4_module

 # because mod_perl lea
 #LoadModule perl_modul

 # make sure that this
 LoadModule ssl_module

 #  Reconstruction of t
 #  (static and shared
 #  [WHENEVER YOU CHANG
 #ClearModuleList

 # Extra Modules
 AddModule mod_php4.c
 #AddModule mod_php.c
 #AddModule mod_php3.c
 #AddModule mod_perl.c
 #AddModule mod_casp2.c
 I thing that it's all ok but it doesn't work.
 Any Ideas?
 Hi

 

 - Moreno Riccardi

 


 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: [PHP-DB] PHP/Mysql

2001-11-30 Thread Paul Warner

  Hello,
  I've got cobalt raq4 with php(work) and mysql(work) but when I try to
  connect via mysql_connect() this error happens:
  Fatal error: Call to undefined function: mysql_connect()
  This is my php.ini:

SNIP

  I thing that it's all ok but it doesn't work.
  Any Ideas?
  Hi
 
  
 
  - Moreno Riccardi
 
  
 

Moreno-

If you just updated to PHP 4.0.6 on a Raq you need to add
'extension=mysql.so' to /etc/httpd/php.ini

-- P



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: [PHP-DB] PHP/Mysql

2001-11-30 Thread Paul Warner

  Hello,
  I've got cobalt raq4 with php(work) and mysql(work) but when I try to
  connect via mysql_connect() this error happens:
  Fatal error: Call to undefined function: mysql_connect()
  This is my php.ini:

SNIP

  I thing that it's all ok but it doesn't work.
  Any Ideas?
  Hi
 
  
 
  - Moreno Riccardi
 
  
 

Moreno-

If you just updated to PHP 4.0.6 on a Raq you need to add
'extension=mysql.so' to /etc/httpd/php.ini

-- P




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: [PHP-DB] PHP/MySQL Question

2001-11-19 Thread RNie

Look at the MySQL manual that came along with it when you downloaded it:

manual.html#String_comparison_functions

or

manual.html#Comparison_Operators

May be that helps you.

René
www.comunica2.net




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] RE: [PHP-DB] PHP, MySQL and XML

2001-02-06 Thread Ryan Gaul

http://freshmeat.net/projects/exist/

-Original Message-
From: Thor M. Steindorsson [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 05, 2001 5:57 PM
To: php-general; php-db
Subject: [PHP-DB] PHP, MySQL and XML


Does anyone have a solution for importing data from a RDF-XML file into a
MySQL database?

I've been racking my brain, as well as looking at tutorials and some xml
parsers, but if someone has something like this it would save me tons of
time.

Thanks!


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]