Re: [PHP-DB] ER diagram class

2004-10-11 Thread Ignatius Reilly
Dezign / MySQL Importer

www.datanamic.com

HTH

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



Re: [PHP-DB] ER diagram class

2004-10-11 Thread =?ISO-8859-1?Q?Arn=E9=20Klopper?=
HI Matthew
 
Although I'm not one of Microsoft's supporters, I must say I've done this in Microsoft 
Vision, there is a function called Reversed Engineer..., which can connect to a 
database and illustrate the structue... I think the funtion is under ... the Database 
menu.
 
What I also have done is port the db structure to SQL Server and use the diagram 
illustrator to map the structure...
 
 
 
Kind Regards
Arné Klopper
 

NetCB Solutions (Pty) Ltd.
www.netcb.com
Office: +27 12 997 3007
Fax: 27 12 997 3629
Mobile: +27 84 513 4119

>>> Matthew Perry <[EMAIL PROTECTED]> 2004/10/12 01:03:11 AM >>>

Does anyone know a good class or program that automatically generates an 
ER diagram from all tables in a MySQL database?

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





Re: [PHP-DB] Connect remote DB server

2004-10-11 Thread Laurence Lim
Hi Shahmat,

I had installed all. But, it still can't work. The constrain is that I can't
install mysql on application server. That's why I need to make a remote db
connection... should I install the php-devel-*.rpm on application server?

Here is the rpm on APP server,
[EMAIL PROTECTED] webmas]$ rpm -qa | grep -i php
php-mysql-4.3.2-11.1.ent
php-imap-4.3.2-11.1.ent
php-ldap-4.3.2-11.1.ent
php-4.3.2-11.1.ent
[EMAIL PROTECTED] webmas]$ rpm -qa | grep -i mysql
php-mysql-4.3.2-11.1.ent
MySQL-devel-4.0.13-0
MySQL-shared-compat-4.0.13-0
MySQL-client-4.0.13-0

And, DB server,
[EMAIL PROTECTED] webmas]$ rpm -qa | grep -i php
php-ldap-4.3.2-14.ent
php-4.3.2-14.ent
php-imap-4.3.2-14.ent
php-4.3.2-11.1.ent
php-mysql-4.3.2-14.ent
[EMAIL PROTECTED] webmas]$ rpm -qa | grep -i mysql
MySQL-shared-compat-4.0.13-0
MySQL-client-4.0.13-0
MySQL-devel-4.0.13-0
MySQL-server-4.0.13-0
php-mysql-4.3.2-14.ent

Any idea?

Laurence

"Shahmat Dahlan" <[EMAIL PROTECTED]> ???
news:[EMAIL PROTECTED] ???...
> How about mysql client (which will include all the necessary libraries)?
> having php-mysql install, doesn't mean you will be able to connect if
> you don't have the libraries.
> Since I assume that you are using some form of redhat linux dist, how
> about the following packages (if I remember them correctly):
> 1. mysql-4.x
> 2. mysql-devel
> 3. mysqlclient
>
>
> Laurence Lim wrote:
>
> >Hi Shahmat,
> >
> >The platform im using is EL3, I have asked the engineer to install the
> >packages (rpms),
> >
> >php-imap-4.3.2-11.1.ent
> >php-ldap-4.3.2-11.1.ent
> >php-4.3.2-11.1.ent
> >php-mysql-4.3.2-11.1.ent
> >
> >Is these enough? Thanks for reply!
> >
> >"Shahmat Dahlan" <[EMAIL PROTECTED]> ???
> >news:[EMAIL PROTECTED] ???...
> >
> >
> >>I think the mysql extension was not loaded, that's why you got the
> >>message, and it was not able to recognize the function mysql_connect.
> >>
> >>Fatal error: Call to undefined function: mysql_connect()
> >>
> >>how did you install your copy of php? compile it from source?
> >>
> >>
> >>Laurence Lim wrote:
> >>
> >>
> >>
> >>>Hi all, im new to PHP.net.
> >>>
> >>>Im developing a program to retrieve data from a remote DB server
running
> >>>MySQL. The code written as
> >>>
> >>>if (!($dbLink = mysql_connect("some.remote.host", $dbUser, $dbPass))) {
> >>> print ("mysql_connect failed!");
> >>> exit;
> >>>}
> >>>
> >>>But, it doesn't work... and return me the error msg,
> >>>
> >>>Fatal error: Call to undefined function: mysql_connect() in
> >>>/var/www/philately/hkpo-eng/request_information/test.php on line 6
> >>>
> >>>I have granted permission for access, no firewall blocking... Anyone
know
> >>>why it happens? Thanks for reply!
> >>>
> >>>Regards, Laurence
> >>>
> >>>
> >>>
> >>>
> >>>
> >
> >
> >

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



Re: [PHP-DB] Connect remote DB server

2004-10-11 Thread Laurence Lim
Should I install php_devel-***.rpm in order to make the PHP work?


"Shahmat Dahlan" <[EMAIL PROTECTED]> ???
news:[EMAIL PROTECTED] ???...
> How about mysql client (which will include all the necessary libraries)?
> having php-mysql install, doesn't mean you will be able to connect if
> you don't have the libraries.
> Since I assume that you are using some form of redhat linux dist, how
> about the following packages (if I remember them correctly):
> 1. mysql-4.x
> 2. mysql-devel
> 3. mysqlclient
>
>
> Laurence Lim wrote:
>
> >Hi Shahmat,
> >
> >The platform im using is EL3, I have asked the engineer to install the
> >packages (rpms),
> >
> >php-imap-4.3.2-11.1.ent
> >php-ldap-4.3.2-11.1.ent
> >php-4.3.2-11.1.ent
> >php-mysql-4.3.2-11.1.ent
> >
> >Is these enough? Thanks for reply!
> >
> >"Shahmat Dahlan" <[EMAIL PROTECTED]> ???
> >news:[EMAIL PROTECTED] ???...
> >
> >
> >>I think the mysql extension was not loaded, that's why you got the
> >>message, and it was not able to recognize the function mysql_connect.
> >>
> >>Fatal error: Call to undefined function: mysql_connect()
> >>
> >>how did you install your copy of php? compile it from source?
> >>
> >>
> >>Laurence Lim wrote:
> >>
> >>
> >>
> >>>Hi all, im new to PHP.net.
> >>>
> >>>Im developing a program to retrieve data from a remote DB server
running
> >>>MySQL. The code written as
> >>>
> >>>if (!($dbLink = mysql_connect("some.remote.host", $dbUser, $dbPass))) {
> >>> print ("mysql_connect failed!");
> >>> exit;
> >>>}
> >>>
> >>>But, it doesn't work... and return me the error msg,
> >>>
> >>>Fatal error: Call to undefined function: mysql_connect() in
> >>>/var/www/philately/hkpo-eng/request_information/test.php on line 6
> >>>
> >>>I have granted permission for access, no firewall blocking... Anyone
know
> >>>why it happens? Thanks for reply!
> >>>
> >>>Regards, Laurence
> >>>
> >>>
> >>>
> >>>
> >>>
> >
> >
> >

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



Re: [PHP-DB] Connect remote DB server

2004-10-11 Thread Laurence Lim
Thx Shahmat,

These 2 packages also installed on the platform, I had tried to use the
console (mysql_client) to login, it works.

MySQL-shared-compat-4.0.13-0
MySQL-client-4.0.13-0

But, just dunno anything is still missing on the platform to make the code
run... Thanks for help!

B.Rgds,
Laurence Lim

"Shahmat Dahlan" <[EMAIL PROTECTED]> ???
news:[EMAIL PROTECTED] ???...
> How about mysql client (which will include all the necessary libraries)?
> having php-mysql install, doesn't mean you will be able to connect if
> you don't have the libraries.
> Since I assume that you are using some form of redhat linux dist, how
> about the following packages (if I remember them correctly):
> 1. mysql-4.x
> 2. mysql-devel
> 3. mysqlclient
>
>
> Laurence Lim wrote:
>
> >Hi Shahmat,
> >
> >The platform im using is EL3, I have asked the engineer to install the
> >packages (rpms),
> >
> >php-imap-4.3.2-11.1.ent
> >php-ldap-4.3.2-11.1.ent
> >php-4.3.2-11.1.ent
> >php-mysql-4.3.2-11.1.ent
> >
> >Is these enough? Thanks for reply!
> >
> >"Shahmat Dahlan" <[EMAIL PROTECTED]> ???
> >news:[EMAIL PROTECTED] ???...
> >
> >
> >>I think the mysql extension was not loaded, that's why you got the
> >>message, and it was not able to recognize the function mysql_connect.
> >>
> >>Fatal error: Call to undefined function: mysql_connect()
> >>
> >>how did you install your copy of php? compile it from source?
> >>
> >>
> >>Laurence Lim wrote:
> >>
> >>
> >>
> >>>Hi all, im new to PHP.net.
> >>>
> >>>Im developing a program to retrieve data from a remote DB server
running
> >>>MySQL. The code written as
> >>>
> >>>if (!($dbLink = mysql_connect("some.remote.host", $dbUser, $dbPass))) {
> >>> print ("mysql_connect failed!");
> >>> exit;
> >>>}
> >>>
> >>>But, it doesn't work... and return me the error msg,
> >>>
> >>>Fatal error: Call to undefined function: mysql_connect() in
> >>>/var/www/philately/hkpo-eng/request_information/test.php on line 6
> >>>
> >>>I have granted permission for access, no firewall blocking... Anyone
know
> >>>why it happens? Thanks for reply!
> >>>
> >>>Regards, Laurence
> >>>
> >>>
> >>>
> >>>
> >>>
> >
> >
> >

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



Re: [PHP-DB] Connect remote DB server

2004-10-11 Thread Shahmat Dahlan
How about mysql client (which will include all the necessary libraries)? 
having php-mysql install, doesn't mean you will be able to connect if 
you don't have the libraries.
Since I assume that you are using some form of redhat linux dist, how 
about the following packages (if I remember them correctly):
1. mysql-4.x
2. mysql-devel
3. mysqlclient

Laurence Lim wrote:
Hi Shahmat,
The platform im using is EL3, I have asked the engineer to install the
packages (rpms),
php-imap-4.3.2-11.1.ent
php-ldap-4.3.2-11.1.ent
php-4.3.2-11.1.ent
php-mysql-4.3.2-11.1.ent
Is these enough? Thanks for reply!
"Shahmat Dahlan" <[EMAIL PROTECTED]> ???
news:[EMAIL PROTECTED] ???...
 

I think the mysql extension was not loaded, that's why you got the
message, and it was not able to recognize the function mysql_connect.
Fatal error: Call to undefined function: mysql_connect()
how did you install your copy of php? compile it from source?
Laurence Lim wrote:
   

Hi all, im new to PHP.net.
Im developing a program to retrieve data from a remote DB server running
MySQL. The code written as
if (!($dbLink = mysql_connect("some.remote.host", $dbUser, $dbPass))) {
print ("mysql_connect failed!");
exit;
}
But, it doesn't work... and return me the error msg,
Fatal error: Call to undefined function: mysql_connect() in
/var/www/philately/hkpo-eng/request_information/test.php on line 6
I have granted permission for access, no firewall blocking... Anyone know
why it happens? Thanks for reply!
Regards, Laurence

 

 

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


Re: [PHP-DB] Connect remote DB server

2004-10-11 Thread Laurence Lim
Hi Shahmat,

The platform im using is EL3, I have asked the engineer to install the
packages (rpms),

php-imap-4.3.2-11.1.ent
php-ldap-4.3.2-11.1.ent
php-4.3.2-11.1.ent
php-mysql-4.3.2-11.1.ent

Is these enough? Thanks for reply!

"Shahmat Dahlan" <[EMAIL PROTECTED]> ???
news:[EMAIL PROTECTED] ???...
> I think the mysql extension was not loaded, that's why you got the
> message, and it was not able to recognize the function mysql_connect.
>
> Fatal error: Call to undefined function: mysql_connect()
>
> how did you install your copy of php? compile it from source?
>
>
> Laurence Lim wrote:
>
> >Hi all, im new to PHP.net.
> >
> >Im developing a program to retrieve data from a remote DB server running
> >MySQL. The code written as
> >
> > if (!($dbLink = mysql_connect("some.remote.host", $dbUser, $dbPass))) {
> >  print ("mysql_connect failed!");
> >  exit;
> > }
> >
> >But, it doesn't work... and return me the error msg,
> >
> >Fatal error: Call to undefined function: mysql_connect() in
> >/var/www/philately/hkpo-eng/request_information/test.php on line 6
> >
> >I have granted permission for access, no firewall blocking... Anyone know
> >why it happens? Thanks for reply!
> >
> >Regards, Laurence
> >
> >
> >

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



RE: [PHP-DB] Generate Menu based on database structure

2004-10-11 Thread Gavin Amm
Ok, sounds good.
Any hints? I've not touched this stuff before..

Will using classes allow multiple objects to be running at the same time
making the script faster?

Cheers,
Gav


-Original Message-
From: graeme [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, 6 October 2004 7:05 PM
To: Gavin Amm
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Generate Menu based on database structure


Hi,

Rather than writing a recursive function I'd suggest that you create a 
menu class and store each record as an object of the class. The menu 
class will have variables of id, parent, title, children, and tree. The 
children will be initialised to 0 and tree will be initialised to 1. You

will need to write a function to find any menu object given the menu's 
ID, should be easy if you store each object in an array (keyed on the
ID)

1) Read in a record and create a menu object
2) Get the parent object, using the parent variable and the find method
3) Increment the children variable in the parent menu object by one
4) Set the tree variable in the new menu object to the tree object in 
the parent object plus the value in the children object.

Now add method to display the menu items and your problem should be
solved.

Gavin Amm wrote:

>Hi guys,
>
>I need to generate a menu based on the content structure of my
database.
>
>The data is structured using an 'id' & 'parent' relationship, for eg:
>
>id
>
>parent
>
>title
>
>1
>
>0
>
>Home Page
>
>6
>
>1
>
>My Page 2
>
>9
>
>6
>
>My Page 3
>
>15
>
>9
>
>My Page 4
>
>21
>
>6
>
>My Page 5
>
>22
>
>9
>
>My Page 6
>
>23
>
>22
>
>My Page 7
>
>24
>
>22
>
>My Page 8
>
>25
>
>1
>
>My Page 9
>
>28
>
>25
>
>My Page 10
>
>I need to create a recursive loop that will create the menu. The text
in
>the brackets is what I'm trying to achieve, the rest is just for
>aesthetics & ease of reading.
>(The children of the row id=1 are the top of the menu tree, ie they
will
>be the menu categories at the top of the web page to display the menu
>when the mouse hovers over it.)
>(Each menu item, being a menu, will have a href to it's id number.)
>
>My Page 2 (Menu_1)
>My Page 3 (Menu_1_1)
>My Page 4 (Menu_1_1_1)
>My Page 6 (Menu_1_1_2)
>My Page 7 (Menu_1_1_2_1)
>My Page 8 (Menu_1_1_2_2)
>My Page 5 (Menu_1_2)
>My Page 9 (Menu_2)
>My Page 10 (Menu_2_1)
>
>I just can't for the life of me get the numbering to work correctly in
>the recursion.
>I seem to get things like (1_1_2_1_2_3_1_2_3_4) which I can see the
>pattern in, but it's obviously not what I'm after..
>
>Appreciate your help.
>Thanks, Gav.
>
>
>  
>

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



[PHP-DB] ER diagram class

2004-10-11 Thread Matthew Perry
Does anyone know a good class or program that automatically generates an 
ER diagram from all tables in a MySQL database?

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


Re: [PHP-DB] Don't mean to be repetitive - Session Variables

2004-10-11 Thread Stuart Felenstein
I apologize, fixed this problem a short while ago.  I
need to move the post statement a page ahead.  Now all
is working fine. 

Thank you ,
Stuart
--- [EMAIL PROTECTED] wrote:

> Have you assigned the values in the
> $_SESSION['l_industry'] array to those 
> specific local variables, $l_industry['0'],
> $l_industry['1']... ?
> 
> dave
> 
> 
> 
> 
> 
> 
> 
> 
> Stuart Felenstein <[EMAIL PROTECTED]>
> 
> 10/11/2004 10:20 AM
> 
> 
> 
>  
> 
> To:
> [EMAIL PROTECTED]
> cc:
> 
> 
> 
> 
> 
> Subject:
> Re: [PHP-DB] Don't mean to be repetitive - Session
> Variables
> 
> 
> 
> I may have spoken too soon.  Having one minor
> problem
> with getting an array (from a multiple select) to
> print out.  Anyone see anything wrong here :
> 
> Here is registering session array:
> 
> if ( empty( $_SESSION['l_industry'] ) ) {
> $_SESSION['l_industry']=array();
> }
> 
> if ( is_array( $_REQUEST['LurkerIndustry'] ) ) {
> $_SESSION['l_industry'] = array_unique(
> array_merge( $_SESSION['l_industry'],
>  $_REQUEST['LurkerIndustry'] )
> );
> }
> Here is my call: 
> 
> echo $l_industry['0'].""; 
> echo $l_industry['1'].""; 
> echo $l_industry['2'].""; 
> echo $l_industry['3'].""; 
> echo $l_industry['4'].""; 
> echo $l_industry['5'].""; 
> 
> 
> Thank you,
> Stuart
> 
> -- 
> 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-DB] downloading from database

2004-10-11 Thread Adil
Hey everyone,

I have a question about downloading from a mySQL database, running php on
Apache.

Basically right now I'm working on this file upload download tool.  You
login, see a list of files, (upload functionality works great).  You click
on a file name which pops up the new file in a new browser window.  This new
page contains a "download" button under where it displays the file(image,
swf, pdf, etc).

What I want to happen is that when I click on the download button I want the
file to download to my machine.  Instead right now, it just downloads the
page that the button is on.

Any ideas?
Thanks in advance.
Adil.

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



Re: [PHP-DB] Don't mean to be repetitive - Session Variables

2004-10-11 Thread dpgirago
Have you assigned the values in the $_SESSION['l_industry'] array to those 
specific local variables, $l_industry['0'], $l_industry['1']... ?

dave








Stuart Felenstein <[EMAIL PROTECTED]>

10/11/2004 10:20 AM



 

To:
[EMAIL PROTECTED]
cc:





Subject:
Re: [PHP-DB] Don't mean to be repetitive - Session Variables



I may have spoken too soon.  Having one minor problem
with getting an array (from a multiple select) to
print out.  Anyone see anything wrong here :

Here is registering session array:

if ( empty( $_SESSION['l_industry'] ) ) {
$_SESSION['l_industry']=array();
}

if ( is_array( $_REQUEST['LurkerIndustry'] ) ) {
$_SESSION['l_industry'] = array_unique(
array_merge( $_SESSION['l_industry'],
 $_REQUEST['LurkerIndustry'] )
);
}
Here is my call: 

echo $l_industry['0'].""; 
echo $l_industry['1'].""; 
echo $l_industry['2'].""; 
echo $l_industry['3'].""; 
echo $l_industry['4'].""; 
echo $l_industry['5'].""; 


Thank you,
Stuart

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





Re: [PHP-DB] Suggestions for record insertion

2004-10-11 Thread John Holmes
Stuart Felenstein wrote:
I've put together a long form that spans 5 tables of
the database. 
Once the user has reached the final page I want to
insert into database but wonder what the logical steps
would be.
I'll be reading through manual , but thought I'd ask
about things like "rollback".  I'm guessing that for
whatever reason, insert into say the 3rd table failed,
it's going to take a decent amount of code to delete
the records from the first 2 tables ? 

Basically I'm open to any ideas on this, while I
search out the manual.
You need to use transactions. Search your database's manual on how to 
use them.

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
php|architect: The Magazine for PHP Professionals – www.phparch.com
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Interested in helping develop a php/MySql program ?

2004-10-11 Thread lee
hello everyone,
Firstly, apologies if I have wrongly understood this as the place for 
such a mail;

I'm just mailing to see if any of you have the time and interest to 
develop and code for Mailgust, (mailgust.org) which is a php 
internet/email mailing manager.
I am merely a user and tester, but am in close contact with the 
developer, who sadly cannot afford to spend time on further development 
at the moment due to having to pursue paid work. Meanwhile, mailgust's 
already excellent software is in a state of hiatus. (sp?)

The main task needing attention is to recode much of mailgust (php4) to 
accommodate the new recent php release. There are also a few issues 
which need coding to achieve or improve certain functions or bugs.

Maybe have a look at the above website (documentation there is a little 
sparce and out of date) and download the latest 2.0pre4b release, and 
see what you think. The developer hasn't asked me to generate support in 
this way, but I am quite passionate about mailgust and would love to see 
it progress further.

Feel free to email me directly with any thoughts or questions, and I can 
forward your details onto the developer if you'd like me to.

Many thanks for your time and help,
Lee
England
scanned by lee's virus software. outbound message found to be clean.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Suggestions for record insertion

2004-10-11 Thread Stuart Felenstein
I've put together a long form that spans 5 tables of
the database. 
Once the user has reached the final page I want to
insert into database but wonder what the logical steps
would be.
I'll be reading through manual , but thought I'd ask
about things like "rollback".  I'm guessing that for
whatever reason, insert into say the 3rd table failed,
it's going to take a decent amount of code to delete
the records from the first 2 tables ? 

Basically I'm open to any ideas on this, while I
search out the manual.

Thank you
Stuart

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



[PHP-DB] Re: [PHP] Lost in query... Trying to get output from query....

2004-10-11 Thread GH
Thank You Murray's suggestion worked


On Mon, 11 Oct 2004 11:20:57 -0400, John Nichel <[EMAIL PROTECTED]> wrote:
> GH wrote:
> > Greetings:
> >
> >  I am having a problem with trying to get data out of my mySql database.
> >
> > I run my query which works fine and everything...
> >
> > I use:
> >
> > $admin_get_options_query_text = "Select * from adminpage";
> >
> > $admin_get_options_results_reference =
> > mysql_query($admin_get_options_query_text,$db_access) or die("Admin
> > Get Options: ". mysql_error());
> >
> > $admin_get_options_result =
> > mysql_fetch_assoc($admin_get_options_results_reference);
> 
> If the query is going to return multiple rows, you need to loop thru the
> result set...
> 
> while ( $admin_get_options_result =
> mysql_fetch_assoc($admin_get_options_results_reference) ) {
>// do stuff with each row returned
> }
> 
> --
> John C. Nichel
> ÜberGeek
> KegWorks.com
> 716.856.9675
> [EMAIL PROTECTED]
> 
> 
> 
> --
> PHP General 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-DB] Re: [PHP] Lost in query... Trying to get output from query....

2004-10-11 Thread John Nichel
GH wrote:
Greetings:
 I am having a problem with trying to get data out of my mySql database.
I run my query which works fine and everything... 

I use: 

$admin_get_options_query_text = "Select * from adminpage";
$admin_get_options_results_reference =
mysql_query($admin_get_options_query_text,$db_access) or die("Admin
Get Options: ". mysql_error());
$admin_get_options_result =
mysql_fetch_assoc($admin_get_options_results_reference);
If the query is going to return multiple rows, you need to loop thru the 
result set...

while ( $admin_get_options_result = 
mysql_fetch_assoc($admin_get_options_results_reference) ) {
	// do stuff with each row returned
}

--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] Don't mean to be repetitive - Session Variables

2004-10-11 Thread Stuart Felenstein
I may have spoken too soon.  Having one minor problem
with getting an array (from a multiple select) to
print out.  Anyone see anything wrong here :

Here is registering session array:

if ( empty( $_SESSION['l_industry'] ) ) {
$_SESSION['l_industry']=array();
}

if ( is_array( $_REQUEST['LurkerIndustry'] ) ) {
$_SESSION['l_industry'] = array_unique(
array_merge( $_SESSION['l_industry'],
 $_REQUEST['LurkerIndustry'] )
);
}
Here is my call: 

echo $l_industry['0'].""; 
echo $l_industry['1'].""; 
echo $l_industry['2'].""; 
echo $l_industry['3'].""; 
echo $l_industry['4'].""; 
echo $l_industry['5'].""; 


Thank you,
Stuart

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



[PHP-DB] RE: [PHP] Lost in query... Trying to get output from query....

2004-10-11 Thread Murray @ PlanetThoughtful
Hi,

You need to loop through the returned recordset and use the returned
result(s).

Instead of:

$admin_get_options_result =
mysql_fetch_assoc($admin_get_options_results_reference);

Try:

While ($admin_get_options_result =
mysql_fetch_assoc($admin_get_options_results_reference)){

echo " The api# ".$admin_get_options_result["adminpageid"]."
allows you to ".$admin_get_options_result["description"].", and uses the
file ".$admin_get_options_result["filename"]."";
}

Mysql_free_result($admin_get_options_results_reference);

Hope this helps...

Much warmth,

Murray


-Original Message-
From: GH [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, 12 October 2004 12:59 AM
To: PHP General; [EMAIL PROTECTED]
Subject: [PHP] Lost in query... Trying to get output from query

Greetings:

 I am having a problem with trying to get data out of my mySql database.

I run my query which works fine and everything... 

I use: 

$admin_get_options_query_text = "Select * from adminpage";

$admin_get_options_results_reference =
mysql_query($admin_get_options_query_text,$db_access) or die("Admin
Get Options: ". mysql_error());

$admin_get_options_result =
mysql_fetch_assoc($admin_get_options_results_reference);


-

When I run the query in mysql directly the results are. 

mysql> Select * from adminpage;
+-++
--+
| adminpageid | file_name  | description
|
+-++
--+
| 101 | nycalertstatus.php | Change New York City Threat Alert
Status |
+-++
--+
1 row in set (0.00 sec)



my problem is that I would like to get that output into my php
codeI would like to have something that goes like this for each
record..

The api# $adminpageid allows you to $description, and uses the file
#file_name


can anyone please assist.

-- 
PHP General 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-DB] Lost in query... Trying to get output from query....

2004-10-11 Thread GH
Greetings:

 I am having a problem with trying to get data out of my mySql database.

I run my query which works fine and everything... 

I use: 

$admin_get_options_query_text = "Select * from adminpage";

$admin_get_options_results_reference =
mysql_query($admin_get_options_query_text,$db_access) or die("Admin
Get Options: ". mysql_error());

$admin_get_options_result =
mysql_fetch_assoc($admin_get_options_results_reference);


-

When I run the query in mysql directly the results are. 

mysql> Select * from adminpage;
+-++--+
| adminpageid | file_name  | description  |
+-++--+
| 101 | nycalertstatus.php | Change New York City Threat Alert Status |
+-++--+
1 row in set (0.00 sec)



my problem is that I would like to get that output into my php
codeI would like to have something that goes like this for each
record..

The api# $adminpageid allows you to $description, and uses the file #file_name


can anyone please assist.

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



Re: [PHP-DB] Don't mean to be repetitive - Session Variables

2004-10-11 Thread Stuart Felenstein
Jason, thank you for all the help today! 
It's all working now.  
However, warning: I maybe back when I try to slam it
all into the database. 

Stuart
--- Jason Wong <[EMAIL PROTECTED]> wrote:

> On Monday 11 October 2004 19:42, Stuart Felenstein
> wrote:
> > I think I found the correct way.  By registering
> the
> > session variable in the "next" page is how they
> take.
> > Form Page 1 -
> > collect user input
> > Form Page 2 -
> > $_SESSION['name'] = $POST['myane'];
> >
> > This sound right?
> 
> Yes (aside from the typos above).
> 
> > I'm not sure if
> > A) in the field area do i keep the value set as
> > "value=""> or is
> > that where my mistake is happening ?
> 
> At this point $_SESSION['MyName'] is not defined
> (not registered, and even if 
> it was registered you have nothing to put in it just
> yet) and hence setting 
> your field value to it is meaningless.
> 
> -- 
> Jason Wong -> Gremlins Associates ->
> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet
> Applications Development *
> --
> Search the list archives before you post
> http://marc.theaimsgroup.com/?l=php-db
> --
> /*
> When you say "I wrote a program that crashed
> Windows", people just stare at
> you blankly and say "Hey, I got those with the
> system, *for free*".
> */
> 
> -- 
> 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



Re: [PHP-DB] Don't mean to be repetitive - Session Variables

2004-10-11 Thread Jason Wong
On Monday 11 October 2004 19:42, Stuart Felenstein wrote:
> I think I found the correct way.  By registering the
> session variable in the "next" page is how they take.
> Form Page 1 -
> collect user input
> Form Page 2 -
> $_SESSION['name'] = $POST['myane'];
>
> This sound right?

Yes (aside from the typos above).

> I'm not sure if
> A) in the field area do i keep the value set as
> "value=""> or is
> that where my mistake is happening ?

At this point $_SESSION['MyName'] is not defined (not registered, and even if 
it was registered you have nothing to put in it just yet) and hence setting 
your field value to it is meaningless.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-db
--
/*
When you say "I wrote a program that crashed Windows", people just stare at
you blankly and say "Hey, I got those with the system, *for free*".
*/

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



Re: [PHP-DB] Don't mean to be repetitive - Session Variables

2004-10-11 Thread Stuart Felenstein
I think I found the correct way.  By registering the
session variable in the "next" page is how they take.
Form Page 1 - 
collect user input
Form Page 2 - 
$_SESSION['name'] = $POST['myane'];

This sound right?

Stuart


--- Stuart Felenstein <[EMAIL PROTECTED]> wrote:

> 
> --- Jason Wong <[EMAIL PROTECTED]> wrote:
> 
> 
> > The point is that you should understand *what* is
> > going on with the examples. 
> > It's only when you've understood something that
> you
> > can then apply it to 
> > other situations.
> 
> Your right and I agree with you.  My perspective is
> that the example(s) in the manual does not actually
> address my particular situation. 
> In the manual example it's showing the session
> variable  
> set to the value of count.  If that value of count
> changes, it's updated in the variable. 
> 
>  
> > The 'something' in your particular case is the
> data
> > from the form on Page1. Eg
> $_SESSION['variable'] = $_POST['myforminput'];
> 
> Yes, I've tried this, it didn't work so I'm doing
> something wrong.
> I'm not sure if 
> A) in the field area do i keep the value set as 
> "value=""> or is
> that where my mistake is happening ?
> 
> MyName is the value not the variable
> so I think this is the right way to register the
> variable: $_SESSION['name'] = $_POST['myname'];
> 
> Maybe I leave the value blank and rely on the field
> name ?
> 
> Stuart
> > 
> > -- 
> > Jason Wong -> Gremlins Associates ->
> > www.gremlins.biz
> > Open Source Software Systems Integrators
> > * Web Design & Hosting * Internet & Intranet
> > Applications Development *
> > --
> > Search the list archives before you post
> > http://marc.theaimsgroup.com/?l=php-db
> > --
> > /*
> > About all some men accomplish in life is to send a
> > son to Harvard.
> > */
> > 
> > -- 
> > 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 Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Don't mean to be repetitive - Session Variables

2004-10-11 Thread Stuart Felenstein

--- Jason Wong <[EMAIL PROTECTED]> wrote:


> The point is that you should understand *what* is
> going on with the examples. 
> It's only when you've understood something that you
> can then apply it to 
> other situations.

Your right and I agree with you.  My perspective is
that the example(s) in the manual does not actually
address my particular situation. 
In the manual example it's showing the session
variable  
set to the value of count.  If that value of count
changes, it's updated in the variable. 

 
> The 'something' in your particular case is the data
> from the form on Page1. Eg
$_SESSION['variable'] = $_POST['myforminput'];

Yes, I've tried this, it didn't work so I'm doing
something wrong.
I'm not sure if 
A) in the field area do i keep the value set as 
"value=""> or is
that where my mistake is happening ?

MyName is the value not the variable
so I think this is the right way to register the
variable: $_SESSION['name'] = $_POST['myname'];

Maybe I leave the value blank and rely on the field
name ?

Stuart
> 
> -- 
> Jason Wong -> Gremlins Associates ->
> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet
> Applications Development *
> --
> Search the list archives before you post
> http://marc.theaimsgroup.com/?l=php-db
> --
> /*
> About all some men accomplish in life is to send a
> son to Harvard.
> */
> 
> -- 
> 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



Re: [PHP-DB] Don't mean to be repetitive - Session Variables

2004-10-11 Thread Jason Wong
On Monday 11 October 2004 17:35, Stuart Felenstein wrote:

> > If you don't have a specific reason for this to be
> > enabled you should disable
> > it.
>
> I don't control it.  On  a shared server.

OK.

> > and try out the examples and understand what's going
> > on.
>
> The examples don't seem to apply.  

The point is that you should understand *what* is going on with the examples. 
It's only when you've understood something that you can then apply it to 
other situations.

> > Executive summary:
> >
> > do not enable register_globals
> > $_SESSION['variable'] = 'something'; // to register
> > a session variable
>
> Alright , I guess the light isn't shining through
> here. 'Something' is setting the variable to something
> the user can change with the form input ?

The 'something' in your particular case is the data from the form on Page1. Eg

  $_SESSION['variable'] = $_POST['myforminput'];

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-db
--
/*
About all some men accomplish in life is to send a son to Harvard.
*/

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



Re: [PHP-DB] Don't mean to be repetitive - Session Variables

2004-10-11 Thread Stuart Felenstein

--- Jason Wong <[EMAIL PROTECTED]> wrote:

> If you don't have a specific reason for this to be
> enabled you should disable 
> it.

I don't control it.  On  a shared server.

> > Question 1: is this enough to register the session
> > variable ?
> 
> No. You should read (repeatedly if necessary)
> 
>   manual > Session Handling Functions

I think my repeats on reading has maxed out.  I'll
consider another hobby.

> 
> and try out the examples and understand what's going
> on.

The examples don't seem to apply.  They are applying a
set value to the session variable: $count =1;

if (!session_is_registered('count')) {
   session_register('count');
   $count = 1;
} else {
   $count++;
}




> Executive summary:
> 
> do not enable register_globals
> $_SESSION['variable'] = 'something'; // to register
> a session variable

Alright , I guess the light isn't shining through
here. 'Something' is setting the variable to something
the user can change with the form input ?

Stuart

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



Re: [PHP-DB] Don't mean to be repetitive - Session Variables

2004-10-11 Thread Jason Wong
On Monday 11 October 2004 16:47, Stuart Felenstein wrote:
> I can't seem to figure this out.
> Right now I'm still trying to get the multi page form
> down.
> For the facts, running php 4.3.8, apache 1.3.x
> Register Globals are enabled

If you don't have a specific reason for this to be enabled you should disable 
it.

> So I'm starting the pages with:
>  session_start();
> ?>
>
> Now since this is a form, the user creates the value
> for the variable, so within the form:
>
>  value="">
>
> Question 1: is this enough to register the session
> variable ?

No. You should read (repeatedly if necessary)

  manual > Session Handling Functions

and try out the examples and understand what's going on.

Executive summary:

do not enable register_globals
$_SESSION['variable'] = 'something'; // to register a session variable

> If I send this form action post to a page where I
> have:
>  session_start();
> ?.
> ..
>  echo "\$myname = ".$myname."";
> ?>

$myname is taken straight from your form, and because you have enabled 
register_globals it is available in the GLOBAL scope. That has nothing to do 
with your sessions.

> The variable print out fine.
> BUT - if I add another page between first and
> printout,
> echo "\$myname = ".$myname.""; - returns nothing

1) understand the paragraph above
2) realise that at no stage have you actually registered any session variables
3) realise that you have not propagated $myform from page2 to page3 either 
through a form or through the URL

hence $myname is not available on page3.

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



Re: [PHP-DB] Connect remote DB server

2004-10-11 Thread Shahmat Dahlan
I think the mysql extension was not loaded, that's why you got the 
message, and it was not able to recognize the function mysql_connect.

Fatal error: Call to undefined function: mysql_connect()
how did you install your copy of php? compile it from source?
Laurence Lim wrote:
Hi all, im new to PHP.net.
Im developing a program to retrieve data from a remote DB server running
MySQL. The code written as
if (!($dbLink = mysql_connect("some.remote.host", $dbUser, $dbPass))) {
 print ("mysql_connect failed!");
 exit;
}
But, it doesn't work... and return me the error msg,
Fatal error: Call to undefined function: mysql_connect() in
/var/www/philately/hkpo-eng/request_information/test.php on line 6
I have granted permission for access, no firewall blocking... Anyone know
why it happens? Thanks for reply!
Regards, Laurence
 

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


RE: [PHP-DB] 3D charts

2004-10-11 Thread Griffiths, Daniel
jpgraph is the one, http://www.aditus.nu/jpgraph/

-Original Message-
From: Vipin Chandran [mailto:[EMAIL PROTECTED]
Sent: 11 October 2004 05:15
To: [EMAIL PROTECTED]
Subject: [PHP-DB] 3D charts


hi,
Can we draw 3d graphs or pie charts using php and gd? or is there any
class or method available for this ?
-- 
Regards,
Vipin Chandran

-- 
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-DB] Don't mean to be repetitive - Session Variables

2004-10-11 Thread Stuart Felenstein
I can't seem to figure this out.
Right now I'm still trying to get the multi page form
down.
For the facts, running php 4.3.8, apache 1.3.x
Register Globals are enabled

So I'm starting the pages with:


Now since this is a form, the user creates the value
for the variable, so within the form:



Question 1: is this enough to register the session
variable ?

If I send this form action post to a page where I
have:
";
?>

The variable print out fine.
BUT - if I add another page between first and
printout,
echo "\$myname = ".$myname.""; - returns nothing

The 2nd page is another page in the form.  So 2nd page
variables will print out on the echoing page, but
again if I put a page between 2nd and 3rd , the 2nd's
are lost.

Now I've printed out the session.id so I see the
session is alive and id's match.  I've also checked
(forget the funtion) to see if $myname is a registered
session value and it returns 1 (true), so what gives ?

Thank you
Stuart

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



Re: [PHP-DB] Connect remote DB server

2004-10-11 Thread Sune Rievers
It sounds like you haven't compiled php with mysql support.

recompile php with --with-mysql or using "apt-get install php-mysql"
if you're running debian

Regards,
Sune Rievers

On Mon, 11 Oct 2004 16:24:49 +0800, Laurence Lim
<[EMAIL PROTECTED]> wrote:
> Hi all, im new to PHP.net.
> 
> Im developing a program to retrieve data from a remote DB server running
> MySQL. The code written as
> 
> if (!($dbLink = mysql_connect("some.remote.host", $dbUser, $dbPass))) {
>  print ("mysql_connect failed!");
>  exit;
> }
> 
> But, it doesn't work... and return me the error msg,
> 
> Fatal error: Call to undefined function: mysql_connect() in
> /var/www/philately/hkpo-eng/request_information/test.php on line 6
> 
> I have granted permission for access, no firewall blocking... Anyone know
> why it happens? Thanks for reply!
> 
> Regards, Laurence
> 
> --
> 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-DB] Connect remote DB server

2004-10-11 Thread Laurence Lim
Hi all, im new to PHP.net.

Im developing a program to retrieve data from a remote DB server running
MySQL. The code written as

 if (!($dbLink = mysql_connect("some.remote.host", $dbUser, $dbPass))) {
  print ("mysql_connect failed!");
  exit;
 }

But, it doesn't work... and return me the error msg,

Fatal error: Call to undefined function: mysql_connect() in
/var/www/philately/hkpo-eng/request_information/test.php on line 6

I have granted permission for access, no firewall blocking... Anyone know
why it happens? Thanks for reply!

Regards, Laurence

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