Re: [PHP-DB] Filling a dropbox on form

2001-05-18 Thread Paul Burney

on 5/18/01 8:16 PM, Howard Picken at [EMAIL PROTECTED] wrote:

> Does any one know of way to fill a dropbox that
> reduces the list of items as you type in more
> info.
> 
> I have a dropbox that fills with data from
> a MySQL db and it wrks fine.  Except that now
> the list has grown to more then 300 uniquie items
> it's a pain to select from it.

It can't really be done in PHP because PHP is server-side.  You'll need a
client-side language (e.g., JavaScript) to do it.  They may have something
for this on:



Other than that, you could have the user do a limiting search on the DB for
the item first, and then make the drop box from that.

HTH,

Paul Burney
http://paulburney.com/


-- 
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-DB] Filling a dropbox on form

2001-05-18 Thread Howard Picken

Running Freebsd, Apache, MySQL and Php4.

Does any one know of way to fill a dropbox that
reduces the list of items as you type in more
info.

I have a dropbox that fills with data from
a MySQL db and it wrks fine.  Except that now
the list has grown to more then 300 uniquie items
it's a pain to select from it.


Howard Picken
(Server, SQL, Query, PHP, MySQl, Apache, Freebsd...   etc)
[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]




Re: [PHP-DB] PHP accessing MySQL

2001-05-18 Thread Miles Thompson

Jonathan .. see below.
At 08:38 PM 5/18/01 +, Jonathan Duncan wrote:
>Miles
>
>Thank you for the response.  I did some debugging and the value of $dbs is 2.
>
>I am not sure of what example you are referring to.  I am not using the
>manual currently, although I have the PDF version of it.

http://www.php.net/mysql_list_dbs
for on line version, with annotations!


>The incrementation of $db_num happens on line 24 but I only listed the first
>10 lines because it seems to be a problem within the first 10 lines as the
>error message indicates.
>
>If I change line 10 from:
>
>$tables = mysql_list_dbs($db_names[$db_num])
>
>to:
>
>$tables = mysql_list_dbs()
>
>the script runs and gives me a list of the databases redundantly:
>
>-mysql
>-test
>mysql
>test
>twignud
>-twignud
>mysql
>test
>twignud

Cool! Although it's not what you want. .
But what is it telling us? We're just running through two loops, but really 
asking for the same information each time, if I interpret it correctly.

And if you look at your code, you have two nested loops, doing essentially 
the same thing - listing the databases.


>   $connection = mysql_connect("localhost", "user", "password") or die
>("Couldn't connect.");
>   $dbs = mysql_list_dbs($connection) or die("Couldn't list databases.");
>   $db_list = "";
>   $db_num = 0;
>   while ($db_num < mysql_num_rows($dbs)) {
> $db_names[$db_num] = mysql_tablename($dbs, $db_num);
> $db_list .= "$db_names[$db_num]";
> if (($db_names[$db_num] != "mysql") && ($db_names[$db_num] !
>= "tempdata")) {
> $tables = mysql_list_dbs($db_names[$db_num]) or die("Couldn't list
>databases.");
>   $tables = mysql_list_dbs() or die("Couldn't list databases.");
>   $table_list = "";
>   $table_num = 0;
>   while ($table_num < mysql_num_rows($tables)) {
> $table_names[$table_num] = mysql_tablename($tables, $table_num);
> $table_list .= "$table_names[$table_num]";
> $table_num++;
>   }
>   $table_list .= "";
> }
> $db_list .= "$table_list";
> $db_num++;
>   }
>   $db_list .= "";
>?>
>
>This is minus my debugging additions.  I tried to get info from
>$mysql_tablename but it came up blank every way I tried it.  It is as though
>nothing is getting passed into $mysql_tablename.

That's strange, because this annotation came from zak@php:
[Editor's Note: mysql_db_name(), mysql_dbname() and mysql_tablename()
  are all aliases for mysql_result() and should behave in exactly the same
  fashion. [EMAIL PROTECTED]]

Use mysql_db_name() instead of mysql_tablename() to read databases.
http://php.net/manual/en/function.mysql-db-name.php

So this should give us a list of keys and databases:
while( $row = mysql_fetch_array( $dbs ) )
{
 echo $row[ 0 ];
 echo $row[ 1 ];
}

I'm wondering, if $row[ 0 ] returns the name of the database, and $row[ 1 ] 
returns "array". (Or vice versa.) If so, we should be able to nest another 
while () in there and fetch the table names. (If that's your intention.)

I'll warn you that I get lost in multi-dimensional arrays very quickly, and 
I'm freelancing this off the top of my head.

>Does this clarify anything in your mind?  I am taking this script straight
>from a book.  However, the book is designed for PHP 4 and I am using PHP
>3.0.16, although I don't know if that would make a difference.

Shouldn't, but is there any reason why you can't go to 4.0.5? Why not get 
the database names loop working first, and then go for the table names, a 
divide and conquer approach.


>Thank you very much for your help,
>Jonathan

My pleasure - you're digging on it too.
Miles



>Miles Thompson <[EMAIL PROTECTED]> said:
>
> > Well, when you debug it, what do you get?
> > What's  the value of $dbs?
> >
> > Did you try the simple example shown in the manual, using your 
> information.
> > Did it work?
> >
> > I don't see where you are incrementing $db_num, that could be where your
> > error is coming from. Also check to see if what you are getting back from
> > mysql_tablename() is text or and index.
> >
> > Good luck - Miles Thompson
> >
> > At 01:33 PM 5/18/01 -0600, you wrote:
> > >I am making a script to access MySQL and when I run it I get this:
> > >
> > >Warning: 0 is not a MySQL link index in 
> /sites/htdocs/php/db_listtables.php
> > >on line 10
> > >
> > >Following is the first 10 lines of my script:
> > >
> > > > >   $connection = mysql_connect("localhost", "user", "password") or
> > >die("Couldn't connect.");
> > >   $dbs = mysql_list_dbs($connection) or die("Couldn't list databases.");
> > >   $db_list = "";
> > >   $db_num = 0;
> > >   while ($db_num < mysql_num_rows($dbs)) {
> > > $db_names[$db_num] = mysql_tablename($dbs, $db_num);
> > >  $db_list .= "$db_names[$db_num]";
> > >  if (($db_names[$db_num] != "mysql") && ($db_names[$db_num] !
>= "tempdata"))
> > >{
> > >$tables = mysql_list_dbs($db_names[$db

[PHP-DB] php notepad

2001-05-18 Thread Paul Shortis

PHPCoder at www.phpide.de is a complete free php editor & IDE (for Windows). The 
latest version has sorted out some of the quirks of the previous versions.

Drivers for Windows (and links to Linux Driver sites) can be found at 
www.windrivers.com.

Regards, Paul Shortis


- Original Message -

Date:  Fri, 18 May 2001 17:17:15 +0530 
From:  Sharmad Naik <[EMAIL PROTECTED]> 
Reply-To:  Sharmad Naik <[EMAIL PROTECTED]> 
Subject:  php notepad 
To:  [EMAIL PROTECTED] 
   


Hi,
I have recently fineshed my project in php
I want to document it.
Can anyone tell me an editor that highlights the code of PHP ?
and another question off the way is can i get drivers anywhere for an 
Epson stylus Color 480 printer
-Regards
-- 
The secret of the universe is @*&í!'ñ^#+ NO CARRIER
__ _ _ _ _
|_|_||_||_||\/||_|| \
_|| || || \| || ||_/



-- 
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]




Re: [PHP-DB] Got some probs

2001-05-18 Thread matthew knight

if this is a mysql_db_query.. you need to pass the db first.. you're passing
a query, then $verbindung..

should be something like

$news = mysql_dbquery($db, "SELECT bar FROM foo");


--
matthew knight - web developer
[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-DB] Got some probs

2001-05-18 Thread BuRnln~THuNdEr

hi...
i got some probs with a mysql query...

--
86:  $news = mysql_db_query("SELECT DISTINCT n.id AS id, n.titel AS titel, 
DATE_FORMAT(n.datum,'%d.%m.%Y %H:%S') AS datum, u.username AS username, g.kuerzel AS 
game FROM news AS n, xmb_members AS u, games AS g WHERE u.uid = n.user AND n.game = 
g.id",$verbindung);

98:  while (list($id,$titel,$datum,$username,$game) = mysql_fetch_row($news)) {
--

  Warning: Supplied argument is not a valid MySQL result resource in 
D:\user\www950001\login.php on line 98
   

i dunno whats wrong?!
the sql-query works...



[PHP-DB] image upload -> mime types??

2001-05-18 Thread matthew knight


i've created an application where users can upload images through the form
upload, and to ensure that they are sending me an image, i take a look at
the type of the file (ie. $uploadedfile_type), which usually returns
something like

image/x-png

however.. not always.. so secondly, i check for a file extension using
$uploadedfile_name, but if they've loaded it from a mac.. i can't be sure
there will be a filename.. so, those things both failing in some cases.. is
there any other way of checking the filetype of a file?

i'm concerned that some could upload malicious content and run it (although
the execute flag is turned off, AND the filename is difficult to get.. ) and
would like to reduce the possiblity..

any suggestions?


--
matthew knight - online developer
[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]




Re: [PHP-DB] php-notepad

2001-05-18 Thread Ken Wills

* Sharmad Naik <[EMAIL PROTECTED]> [010518 10:55]:
> Please tell me an editor for Linux
> -- 
> The secret of the universe is @*&í!'ñ^#+ NO CARRIER
> ___  _  _  _
> |_|_||_||_||\/||_|| \
> _|| || || \|  || ||_/
> 
> -- 
> 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]

xemacs ( http://www.xemacs.org/ ) + php-mode.el (search the net for this).
Infodock ( http://www.sourceforge.net/projects/infodock/ ) - built on xemacs - good
for editing just about anything.

Ken
--

-- 
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]




Re: [PHP-DB] PHP accessing MySQL

2001-05-18 Thread Darren

I think the 0 is referring to your $db_num
"Jonathan Duncan" <[EMAIL PROTECTED]> wrote in message
9e3suq$17r$[EMAIL PROTECTED]">news:9e3suq$17r$[EMAIL PROTECTED]...
> I am making a script to access MySQL and when I run it I get this:
>
> Warning: 0 is not a MySQL link index in
/sites/htdocs/php/db_listtables.php
> on line 10
>
> Following is the first 10 lines of my script:
>
>$connection = mysql_connect("localhost", "user", "password") or
> die("Couldn't connect.");
>   $dbs = mysql_list_dbs($connection) or die("Couldn't list databases.");
>   $db_list = "";
>   $db_num = 0;
>   while ($db_num < mysql_num_rows($dbs)) {
> $db_names[$db_num] = mysql_tablename($dbs, $db_num);
>  $db_list .= "$db_names[$db_num]";
>  if (($db_names[$db_num] != "mysql") && ($db_names[$db_num] !=
"tempdata"))
> {
>$tables = mysql_list_dbs($db_names[$db_num]) or die("Couldn't list
> databases.");
>
> Any Ideas?  Thank you in advance!!
>
> Jonathan
>
>
>
> --
> 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]




Re: [PHP-DB] Need Database Design help

2001-05-18 Thread Szii

Hmmit may be easier to just do this...

Group Definition Table

DefID
GroupName



User Definition Table
---
UserID


GroupMember Table
---
MapID
UserID
GroupID

Then you can assign a user to a group by
inserting a new record into the GroupMember Table where UserID is the user,
and GroupID is
the new group.

If you want to search all users in Group "West" you could say
(assuming Group Definition Table is populated with
1  North
2  South
3  East
4  West
)
SELECT UserID from GroupMemberTable WHERE GroupID = 4;
or if you wanted to check multiple groups,
SELECT UserID from GroupMemberTable WHERE GroupID IN (4,2,3);

The map table may get huge depending on the number of users/groups,
but it's a possibility.

-Szii

- Original Message -
From: "Doug Schasteen" <[EMAIL PROTECTED]>
To: "php-db list" <[EMAIL PROTECTED]>
Sent: Friday, May 18, 2001 1:13 PM
Subject: [PHP-DB] Need Database Design help


I'll try to simplify my problem so that this isn't a long read and is easy
to understand.

Tree Table:
--
node_id
node_name
parent_id

I use the above table's rows to create an online tree in php and javascript.
The parent_id column is just a pointer to a the node_id of which the current
node branches off of. The tree is used to group users, which we store in
another table.

Users Table:

user_id
node_id

Now, if I wanted to compare side by side the users of one node to the users
of another node, I would do a select * from tree, users where users.node_id
= tree.node_id and node_id = 'x' for each node id. I created the database
this way so that I could do comparisons with polling results. My problem
comes when the tree gets large and I want to compare a group of nodes to
another group of nodes.  For instance, the tree splits out into southwest
and northwest divisions, and under each of those it splits out into the
groups where the users reside. There will be no users linked directly to the
southwest or northwest nodes, but I want to compare all the users that are
in groups that are PART of the northwest node to all users that are in
groups that are part of the southwest node. I could probably do a "Where
parent_id = 'node id of northwest division" but what if the tree splits up
even farther than that? What if the tree originally splits into North and
South divisions, and under each of those divisions it goes into East and
West, and then splits into groups. I'd have to be able to know the parent's
of the parents in a single SQL statement.

I don't see how I can do this without redesigning the database, and I'm not
even sure what I would need to change in order to get the database to work.
If anyone out there is a database design expert and can see my mistake right
away, please help me out.

- Doug Schasteen



-- 
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-DB] Need Database Design help

2001-05-18 Thread Doug Schasteen

I'll try to simplify my problem so that this isn't a long read and is easy to 
understand.

Tree Table:
--
node_id 
node_name
parent_id

I use the above table's rows to create an online tree in php and javascript. The 
parent_id column is just a pointer to a the node_id of which the current node branches 
off of. The tree is used to group users, which we store in another table.

Users Table:

user_id
node_id

Now, if I wanted to compare side by side the users of one node to the users of another 
node, I would do a select * from tree, users where users.node_id = tree.node_id and 
node_id = 'x' for each node id. I created the database this way so that I could do 
comparisons with polling results. My problem comes when the tree gets large and I want 
to compare a group of nodes to another group of nodes.  For instance, the tree splits 
out into southwest and northwest divisions, and under each of those it splits out into 
the groups where the users reside. There will be no users linked directly to the 
southwest or northwest nodes, but I want to compare all the users that are in groups 
that are PART of the northwest node to all users that are in groups that are part of 
the southwest node. I could probably do a "Where parent_id = 'node id of northwest 
division" but what if the tree splits up even farther than that? What if the tree 
originally splits into North and South divisions, and under each of those divisions it 
goes into East and West, and then splits into groups. I'd have to be able to know the 
parent's of the parents in a single SQL statement.

I don't see how I can do this without redesigning the database, and I'm not even sure 
what I would need to change in order to get the database to work. If anyone out there 
is a database design expert and can see my mistake right away, please help me out.

- Doug Schasteen



[PHP-DB] PHP accessing MySQL

2001-05-18 Thread Jonathan Duncan

I am making a script to access MySQL and when I run it I get this:

Warning: 0 is not a MySQL link index in /sites/htdocs/php/db_listtables.php
on line 10

Following is the first 10 lines of my script:

";
  $db_num = 0;
  while ($db_num < mysql_num_rows($dbs)) {
$db_names[$db_num] = mysql_tablename($dbs, $db_num);
 $db_list .= "$db_names[$db_num]";
 if (($db_names[$db_num] != "mysql") && ($db_names[$db_num] != "tempdata"))
{
   $tables = mysql_list_dbs($db_names[$db_num]) or die("Couldn't list
databases.");

Any Ideas?  Thank you in advance!!

Jonathan



-- 
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-DB] Re: Command line PHP + DB access

2001-05-18 Thread Dan Fitzpatrick

Jor,

You will need to have the Informix environment variables defined in your
shell environment:

INFORMIXDIR
INFORMIXSERVER

Make sure that the command line PHP binary you are using is compiled
with Informix support. 

Dan


>Subject: Command line PHP + DB access
>   Date: Fri, 18 May 2001 11:08:17 +0200
>   From: Jordi Campos i Miralles <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
>
>Hello everybody!
>
>I'm trying to access an Informix DB from a PHP script that has to be
>executed from the console with "php -q"...
>
>The script include some libraries I've done, and one of them is used to
>connect to the DB.
>
>Well, when this library is used through a PHP script executed by Apache
>there are no problems,
>
>BUT when the same library is used through a PHP script directly executed
>from the command line, the error:
>
>"Call to undefined function:  ifx_connect()"... appear
>
>So, does anybody know how should I call the PHP script from the command
>line in order to let the database functions work?
>
>Thanks in advance.
>
>jor:)i

-- 
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]




Re: [PHP-DB] Sql result loop problem !

2001-05-18 Thread Jason Stechschulte

On Fri, May 18, 2001 at 04:32:51PM +0200, Keith Whyman wrote:
> while ($p = mysql_fetch_array($result1)) {
> 
> $msg .= $p["s_bereich_name"];
> $msg .= $p["s_news_text"];
> $msg .= $p["s_users_real_name"];

I'm not sure if this is what you want, but something like this maybe??

\n";
  $oldBereichName = $p["s_bereich_name"];
   }
   echo $p["s_news_text"]." - ".$p["s_users_real_name"]."\n";
}
?>

-- 
Jason Stechschulte
[EMAIL PROTECTED]
--
If I allowed "next $label" then I'd also have to allow "goto $label",
and I don't think you really want that...  :-)
 -- Larry Wall in <[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-DB] PHP and DGS Search anchor tags

2001-05-18 Thread Brian Tegtmeier

Recently I setup the DGS Search PHP script from
http://www.hotscripts.com/Detailed/5477.html to use on my site. Currently it
works great and how it is supposed to but I was wondering if there was
something I could add.

If you've ever used or tested this script, the way it works in a "Googleish"
interface it scans for keywords on your site pages and give you a list of
results wheras you can click and goto the page with that keyword on it.

The thing I am running into now is I would like it when I do a direct search
for say "LS-470" it takes me to the page where that exact word is held and
uses an anchor tag (where I created an anchor tag for that section) to take
the user to that section of the page.

Do you think it is possible?


__
FREE Personalized Email at Mail.com
Sign up at http://www.mail.com/?sr=signup

-- 
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]




Re: [PHP-DB] php-notepad

2001-05-18 Thread Jimmy Brake

vi 

Jimmy Brake

On Fri, 18 May 2001, Sharmad Naik wrote:

> Please tell me an editor for Linux
> -- 
> The secret of the universe is @*&í!'ñ^#+ NO CARRIER
> ___  _  _  _
> |_|_||_||_||\/||_|| \
> _|| || || \|  || ||_/
> 
> -- 
> 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]




Re: [PHP-DB] php-notepad

2001-05-18 Thread Miles Thompson

One with a Graphical User Interface, and I believe with a plug-in or 
dictionary for PHP, is bluefish.
There's also PHPEd, but for the life of me I can't remember if it's Windows 
or X-based editor.
And of course there are: joe, jed, vim, gvim, emacs 
Miles

At 09:13 PM 5/18/01 +0530, Sharmad Naik wrote:
>Please tell me an editor for Linux
>--
>The secret of the universe is @*&í!'ñ^#+ NO CARRIER
>___  _  _  _
>|_|_||_||_||\/||_|| \
>_|| || || \|  || ||_/
>
>--
>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-DB] php-notepad

2001-05-18 Thread Sharmad Naik

Please tell me an editor for Linux
-- 
The secret of the universe is @*&í!'ñ^#+ NO CARRIER
___  _  _  _
|_|_||_||_||\/||_|| \
_|| || || \|  || ||_/

-- 
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]




RE: [PHP-DB] MySQL Connect Problem

2001-05-18 Thread Jeff Oien

I found a "solution." I uninstalled (and deleted the ini file) MySQL 
v. 3.23.36 and installed v. 3.23.38 and now it works. I have no
idea why. But I learned some things in the process. Thank you 
very much for all the help.
Jeff Oien

> Where you have your variable set to "password" just put "" that means there
> is no password other whys your saying your password is password
> ""Jeff Oien"" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > I tried your code and got this:
> >
> > Warning: Can't connect to MySQL server on 'localhost'
> >
> > Also tried ip address of my machine. So at least maybe that narrows
> > down the problem.
> > Jeff Oien
> >
> > > Hi Jeff,
> > > I am using Windows, but am a beginner.  Here is some code I use maybe it
> > > will help
> > >
> > > I use this in my navigation pages:
> > >
> > > 
> > >
> > >  > >
> > > mysql_pconnect("$host","$user","$password")
> > > or die("Unable to connect to SQL server");
> > > mysql_select_db("$dbasename") or die("Unable to select database");
> > > ?>
> > >
> > > and here is db_details.php
> > >
> > >  > > $host="host.name.com";
> > > $user="user_id";
> > > $password="password";
> > > $dbasename="database_name";
> > > ?>
> > > By using the include it means if I go LIVE with a site I only have to
> change
> > > one file db_details.php
> > > The reason I don't do it all in one is that it didn't like "." in IP
> > > addresses for some reason ( I think it thought it was the beginning of a
> > > string)
> > > On my windows machine my db_details would look like this
> > >  > > $host="localhost";
> > > $user="";
> > > $password="";
> > > $dbasename="database_name";
> > > ?>
> > > You shouldn't need a password.
> > > I hope this helps
> > > All the Best
> > > Lisa
> > >
> > > -Original Message-
> > > From: Jeff Oien [mailto:[EMAIL PROTECTED]]
> > > Sent: Thursday, May 17, 2001 2:16 PM
> > > To: PHP-DB
> > > Subject: RE: [PHP-DB] MySQL Connect Problem
> > >
> > >
> > > I'm on Windows 2000.
> > > Jeff
> > >
> > > > Jeff,
> > > >
> > > > If you are on unix/linux use the command id to see who you are.
> > > > You can only use jeff in your connect string if jeff is a user in your
> > > mysql
> > > > database.
> > > >
> > > > If you are root when you are running mysql then you should probably
> set a
> > > > password for root in the database.
> > > >
> > > > Wayne
> > > >
> > > >
> > > > On Thu, 17 May 2001 13:20, Jeff Oien wrote:
> > > > > > > Here is sample code:
> > > > > > >  > > > > > > $connection = @mysql_connect("localhost", "jeff", "*")
> > > > > > > or die("Couldn't connect.");
> > > > > > > if ($connection) {
> > > > > > > $msg = "success!";
> > > > > > > }
> > > > > > > ?>
> > > > > > >
> > > > > > > This is on my machine only used by me. I also tried connecting
> to
> > > > > > > IP address and 127.0.0.1 and it still won't work. Thanks.
> > > > > > > Jeff Oien
> > > > > >
> > > > > > Are your the 'root' rather than 'jeff'?  Did you alter the grants
> and
> > > > > > apply the password? If not do you need  a password for connection?
> > > > > >
> > > > > > Tim Morris
> > > > >
> > > > > To be honest I don't know if I am root. I know I don't need a
> password
> > > > > to connect via the command line. I just type 'mysql'. I do have
> username
> > > > > and password specified in the .ini file which I believe I set when I
> > > first
> > > > > installed it. What can I do from here?
> > > > > Jeff Oien
> > > >
> > > > --
> > > > Wayne Bastow - DBA - Central Coast Health Phone: 61 2 43203231
> > > > Email: wbastowATccahsDOThealthDOTnswDOTgovDOTau
> > > >
> > > > Linux, the choice of a GNU generation Kernel 2.2.16-22 on a i686
> > > >
> > > > Running Windows on a Pentium is like having a brand new Porsche but
> only
> > > > be able to drive backwards with the handbrake on. (Unknown source)
> > > >
> > > > ==
> > > > This message is intended for the addressee named and may contain
> > > > confidential information. If you are not the intended recipient,
> please
> > > > delete it and notify the sender. Views expressed in this message are
> > > > those of the individual sender, and are not necessarily the views of
> > > > the NSW Department of Health.
> > > > ==
> > > >
> > >
> > > --
> > > 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 Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To c

Re: [PHP-DB] MySQL Connect Problem

2001-05-18 Thread Greg K

Where you have your variable set to "password" just put "" that means there
is no password other whys your saying your password is password
""Jeff Oien"" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I tried your code and got this:
>
> Warning: Can't connect to MySQL server on 'localhost'
>
> Also tried ip address of my machine. So at least maybe that narrows
> down the problem.
> Jeff Oien
>
> > Hi Jeff,
> > I am using Windows, but am a beginner.  Here is some code I use maybe it
> > will help
> >
> > I use this in my navigation pages:
> >
> > 
> >
> >  >
> > mysql_pconnect("$host","$user","$password")
> > or die("Unable to connect to SQL server");
> > mysql_select_db("$dbasename") or die("Unable to select database");
> > ?>
> >
> > and here is db_details.php
> >
> >  > $host="host.name.com";
> > $user="user_id";
> > $password="password";
> > $dbasename="database_name";
> > ?>
> > By using the include it means if I go LIVE with a site I only have to
change
> > one file db_details.php
> > The reason I don't do it all in one is that it didn't like "." in IP
> > addresses for some reason ( I think it thought it was the beginning of a
> > string)
> > On my windows machine my db_details would look like this
> >  > $host="localhost";
> > $user="";
> > $password="";
> > $dbasename="database_name";
> > ?>
> > You shouldn't need a password.
> > I hope this helps
> > All the Best
> > Lisa
> >
> > -Original Message-
> > From: Jeff Oien [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, May 17, 2001 2:16 PM
> > To: PHP-DB
> > Subject: RE: [PHP-DB] MySQL Connect Problem
> >
> >
> > I'm on Windows 2000.
> > Jeff
> >
> > > Jeff,
> > >
> > > If you are on unix/linux use the command id to see who you are.
> > > You can only use jeff in your connect string if jeff is a user in your
> > mysql
> > > database.
> > >
> > > If you are root when you are running mysql then you should probably
set a
> > > password for root in the database.
> > >
> > > Wayne
> > >
> > >
> > > On Thu, 17 May 2001 13:20, Jeff Oien wrote:
> > > > > > Here is sample code:
> > > > > >  > > > > > $connection = @mysql_connect("localhost", "jeff", "*")
> > > > > > or die("Couldn't connect.");
> > > > > > if ($connection) {
> > > > > > $msg = "success!";
> > > > > > }
> > > > > > ?>
> > > > > >
> > > > > > This is on my machine only used by me. I also tried connecting
to
> > > > > > IP address and 127.0.0.1 and it still won't work. Thanks.
> > > > > > Jeff Oien
> > > > >
> > > > > Are your the 'root' rather than 'jeff'?  Did you alter the grants
and
> > > > > apply the password? If not do you need  a password for connection?
> > > > >
> > > > > Tim Morris
> > > >
> > > > To be honest I don't know if I am root. I know I don't need a
password
> > > > to connect via the command line. I just type 'mysql'. I do have
username
> > > > and password specified in the .ini file which I believe I set when I
> > first
> > > > installed it. What can I do from here?
> > > > Jeff Oien
> > >
> > > --
> > > Wayne Bastow - DBA - Central Coast Health Phone: 61 2 43203231
> > > Email: wbastowATccahsDOThealthDOTnswDOTgovDOTau
> > >
> > > Linux, the choice of a GNU generation Kernel 2.2.16-22 on a i686
> > >
> > > Running Windows on a Pentium is like having a brand new Porsche but
only
> > > be able to drive backwards with the handbrake on. (Unknown source)
> > >
> > > ==
> > > This message is intended for the addressee named and may contain
> > > confidential information. If you are not the intended recipient,
please
> > > delete it and notify the sender. Views expressed in this message are
> > > those of the individual sender, and are not necessarily the views of
> > > the NSW Department of Health.
> > > ==
> > >
> >
> > --
> > 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 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-DB] Re: displaying multiple results only one time...

2001-05-18 Thread Angela Meehan

Here's my idea:

// select all products made by the manufacturer
$query="SELECT DISTINCT Name, Prod_ID FROM Product WHERE In_Stock = 1
and Man_ID = '$Man_ID'";
$mysql_result=mysql_query($query, $mysql_link);
// loop through the results
while($row=mysql_fetch_row($mysql_result)){
// determine whether the product is in the current category
$query2="SELECT * FROM Product_Category WHERE Prod_ID = '$row[1]'
and Cat_ID = '$Cat_ID'";
$mysql_result2=mysql_query($query2, $mysql_link);
// if it is in category, add it to one list
if(mysql_num_rows($mysql_result2) != 0){
$ThisCatList .= "$row[0]\n";
}
// if it isn't in category, add it to second list
else{
$OtherCatList .= "$row[0]\n";
}
}
// display list from this category
print("$ThisCatList");
// display list from other categories
print("$OtherCatList");


-- 
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-DB] Sql result loop problem !

2001-05-18 Thread Keith Whyman

I know someone can help !

Following sql

SELECT DISTINCT s_news_text,s_bereich_name,s_users_real_name,s_bereich_id
FROM s_news,s_users,s_bereich
WHERE (s_news_user_id = s_users_user_id)
AND (s_news_bereich_id = s_bereich_id)
AND (s_news_sent ='0')
ORDER BY s_bereich_name

while ($p = mysql_fetch_array($result1)) {

$msg .= $p["s_bereich_name"];
$msg .= $p["s_news_text"];
$msg .= $p["s_users_real_name"];

The result gets passed on and mailed !
The question is I have 6 bereichs(areas) identified with a number =
s_bereich_id and I only want the name of the area to appear once.
To try and explain a bit better, there are 3 tables -
users - where the names and mail addresses come from
bereich - where the areas name and numbers are
and news - where the actual messages are, and info for which area and from
who

The mail should then look like

Area 1
newsname
news2  name
news3  name

Area 2
news   name
etc

at the moment I can only work out how to get
Area 1
news name
Area 1
news name

Anyhelp appreciated !

Thanks in advance
Keith






-- 
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]




Re: [PHP-DB] php notepad

2001-05-18 Thread Keith Whyman

Have to say I love Textpad www.textpad.com !
or try Editplus


> On 18 May 2001, at 17:17, Sharmad Naik wrote:
> 
> > Hi,
> > I have recently fineshed my project in php
> > I want to document it.
> > Can anyone tell me an editor that highlights the code of PHP ?
> 
> Allaire's HomeSite does the job well...
> 
> 
> /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
> 
> Fabrizio Ermini   Alternate E-mail:
> C.so Umberto, 7   [EMAIL PROTECTED]
> loc. Meleto Valdarno  Mail on GSM: (keep it short!)
> 52020 Cavriglia (AR)  [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 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]




RE: [PHP-DB] php notepad

2001-05-18 Thread Steve Brett

i've ust downloaded html kit which is free and superb.

Steve

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: 18 May 2001 14:47
> To: Sharmad Naik; [EMAIL PROTECTED]
> Subject: Re: [PHP-DB] php notepad
> 
> 
> On 18 May 2001, at 17:17, Sharmad Naik wrote:
> 
> > Hi,
> > I have recently fineshed my project in php
> > I want to document it.
> > Can anyone tell me an editor that highlights the code of PHP ?
> 
> Allaire's HomeSite does the job well...
> 
> 
> /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
> 
> Fabrizio Ermini   Alternate E-mail:
> C.so Umberto, 7   [EMAIL PROTECTED]
> loc. Meleto Valdarno  Mail on GSM: (keep it short!)
> 52020 Cavriglia (AR)  [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 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]




Re: [PHP-DB] php notepad

2001-05-18 Thread fabrizio . ermini

On 18 May 2001, at 17:17, Sharmad Naik wrote:

> Hi,
> I have recently fineshed my project in php
> I want to document it.
> Can anyone tell me an editor that highlights the code of PHP ?

Allaire's HomeSite does the job well...


/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

Fabrizio Ermini   Alternate E-mail:
C.so Umberto, 7   [EMAIL PROTECTED]
loc. Meleto Valdarno  Mail on GSM: (keep it short!)
52020 Cavriglia (AR)  [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]




Re: [PHP-DB] ORDER BY in MYSQL ? 8(

2001-05-18 Thread Bob Hall

>question:
>
>Do any of you knwo how to correctly sort output from a query that contains
>"Umlaut" like " Ä Ö Ü" etc. so that it looks like this:
>
>A
>Ä
>B
>C
>D
>
>O
>Ö
>P
>R
>
>
>and not like MYSQL does it now with the ORDER BY function, which puts all
>the "Umlaut" at the end like this:
>
>A
>B
>C
>D
>...
>O
>P
>R
>...
>Z
>Ä
>Ö
>
>thx in advance for any suggestions. I didn't find anything in the
>manualunder the ORDER BY documentation, but maybe myasql can configure the
>kind of sort in prefs or such? =)
>
>Jens Nedal
>
>
>So long and thx for the fish!

Sir, you may have to change the character set. I think the default 
character set  causes sorts to be correct for Swedish, which puts the 
funny looking vowels at the end. I know that I have to use the Danish 
character set to get the correct sort for Norwegian. Check the manual 
for instructions on changing character sets. It's been a while since 
I've done it, and I no longer remember how.

Bob Hall

Know thyself? Absurd direction!
Bubbles bear no introspection. -Khushhal Khan Khatak
MySQL list magic words: sql query database

--
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]




RE: [PHP-DB] php notepad

2001-05-18 Thread Miles Thompson

UltraEdit is a cool editor, but I don't think it prints colourized syntax.

Simpler approach is to save the scripts with a .PHPS extension, render them 
in the browser and print. This is also a helpful debuggin technique for 
those times you feel completely lost.

As for drivers, how about a search "Epson 480 driver" on Google? Or a visit 
to http://www.driverguilde.com

Cheers - Miles Thompson

At 01:04 PM 5/18/01 +0100, Tom Hodder \(Global Gold Network Ltd\) wrote:
>UltraEdit
>
>www.ultraedit.com
>
>
>cool software
>
>
>
>
>-Original Message-
>From: Sharmad Naik [mailto:[EMAIL PROTECTED]]
>Sent: 18 May 2001 12:47
>To: [EMAIL PROTECTED]
>Subject: [PHP-DB] php notepad
>
>
>Hi,
>I have recently fineshed my project in php
>I want to document it.
>Can anyone tell me an editor that highlights the code of PHP ?
>and another question off the way is can i get drivers anywhere for an
>Epson stylus Color 480 printer
>-Regards
>--
>The secret of the universe is @*&í!'ñ^#+ NO CARRIER
>___  _  _  _
>|_|_||_||_||\/||_|| \
>_|| || || \|  || ||_/
>
>--
>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 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]




RE: [PHP-DB] php notepad

2001-05-18 Thread Matt Williams


> UltraEdit
> 
> www.ultraedit.com
> 
> 
> cool software

Agreed, or HTML edit if you're looking for something free.

M@

-- 
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]




RE: [PHP-DB] Stupid question

2001-05-18 Thread Matt Williams

> So, you would do:
>  if ($x == 'CHECKED') { echo "Is Checked"; } else { echo "Isn\'t 
> Checked"; }; 
> ?>

Or 
(isset($x)) ? "Is Checked" : "Not Checked";

M@

-- 
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]




RE: [PHP-DB] php notepad

2001-05-18 Thread Tom Hodder \(Global Gold Network Ltd\)

UltraEdit

www.ultraedit.com


cool software




-Original Message-
From: Sharmad Naik [mailto:[EMAIL PROTECTED]]
Sent: 18 May 2001 12:47
To: [EMAIL PROTECTED]
Subject: [PHP-DB] php notepad


Hi,
I have recently fineshed my project in php
I want to document it.
Can anyone tell me an editor that highlights the code of PHP ?
and another question off the way is can i get drivers anywhere for an
Epson stylus Color 480 printer
-Regards
--
The secret of the universe is @*&í!'ñ^#+ NO CARRIER
___  _  _  _
|_|_||_||_||\/||_|| \
_|| || || \|  || ||_/

--
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-DB] php notepad

2001-05-18 Thread Sharmad Naik

Hi,
I have recently fineshed my project in php
I want to document it.
Can anyone tell me an editor that highlights the code of PHP ?
and another question off the way is can i get drivers anywhere for an 
Epson stylus Color 480 printer
-Regards
-- 
The secret of the universe is @*&í!'ñ^#+ NO CARRIER
___  _  _  _
|_|_||_||_||\/||_|| \
_|| || || \|  || ||_/

-- 
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]




RE: [PHP-DB] Stupid question

2001-05-18 Thread Ben Cairns

The value of a CHECKED Checkbox is 'CHECKED'

So, you would do:


hth

-- Ben Cairns - Head Of Technical Operations
intasept.COM
Tel: 01332 365333
Fax: 01332 346010
E-Mail: [EMAIL PROTECTED]
Web: http://www.intasept.com

"MAKING sense of
the INFORMATION
TECHNOLOGY age
@ WORK.."


-- 
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-DB] Stupid question

2001-05-18 Thread Bartek Pawlik

Sorry for this type of question but i don't want to subscribe another list.

1. I have checkbox NAME="x" on Page1.
2. On page two I want to check ($x)  if it's checked or not. How can I do it.
3. What value is stored in $x.

Thanks in advance
Bartek Pawlik
Poland



-- 

Wyjedź z nami na Madagaskar!
Weź udział w konkursie [ http://konkursy.onet.pl ]




Re: [PHP-DB] display variable variables in a text field in a form

2001-05-18 Thread Shahmat Dahlan

You know what? I did what you suggested and it works!. Overlooked that one
alright.
print "\n$fieldn\n\n  \n";

Yeah you're right, wonder why it works that way?

Thanks anyway.
regards


Steve Brett wrote:

> i always use:
>
> print "".$values."";
>
> sometimes i can get away without splitting the string but generally i find
> it easier to do it this way ...
>
> p.s. if there are any rules i'm not aware of as to the format of strings
> including values from db's i'd be really grateful if someone could point
> them out.
>
> steve
>
> > -Original Message-
> > From: Shahmat Dahlan [mailto:[EMAIL PROTECTED]]
> > Sent: 18 May 2001 11:29
> > To: PHP-DB
> > Subject: [PHP-DB] display variable variables in a text field in a form
> >
> >
> > $fields=array("fname","lname","dept","city","ophone","hphone",
> > "fax","ema
> > il");
> >
> > $sqlstmt="SELECT * FROM contacts WHERE id='$id'";
> > $result=mysql_query($sqlstmt);
> > foreach ($fields as $values) {
> >   print "\n$fieldn\n > type=\"text\" name=\"$values\" value=\"$$values\">\n  \n";
> > }
> >
> > I'm not sure how to explain this, when do the above (I have ommited
> > certain portions of my codes). The form will be displayed as:
> >
> > First Name$fname
> > Last Name$lname
> > Department   $dept
> > City   $city
> > Office Phone $ophone
> > Handphone   $handphone
> > Fax   $fax
> > E-mail   $email
> >
> > How do I make it to display the actual values of $fname instead of the
> > variable name itself?
> >
> > Thanks in advance..
> >
> > regards
> >


-- 
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]




RE: [PHP-DB] display variable variables in a text field in a form

2001-05-18 Thread Steve Brett

i always use:

print "".$values."";

sometimes i can get away without splitting the string but generally i find
it easier to do it this way ...

p.s. if there are any rules i'm not aware of as to the format of strings
including values from db's i'd be really grateful if someone could point
them out.


steve


> -Original Message-
> From: Shahmat Dahlan [mailto:[EMAIL PROTECTED]]
> Sent: 18 May 2001 11:29
> To: PHP-DB
> Subject: [PHP-DB] display variable variables in a text field in a form
> 
> 
> $fields=array("fname","lname","dept","city","ophone","hphone",
> "fax","ema
> il");
> 
> $sqlstmt="SELECT * FROM contacts WHERE id='$id'";
> $result=mysql_query($sqlstmt);
> foreach ($fields as $values) {
>   print "\n$fieldn\n type=\"text\" name=\"$values\" value=\"$$values\">\n  \n";
> }
> 
> I'm not sure how to explain this, when do the above (I have ommited
> certain portions of my codes). The form will be displayed as:
> 
> First Name$fname
> Last Name$lname
> Department   $dept
> City   $city
> Office Phone $ophone
> Handphone   $handphone
> Fax   $fax
> E-mail   $email
> 
> How do I make it to display the actual values of $fname instead of the
> variable name itself?
> 
> Thanks in advance..
> 
> regards
> 

-- 
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]




Re: [PHP-DB] MySQL Connect Problem

2001-05-18 Thread Shahmat Dahlan

If this is the case, you need to check the rights that your id "jeff" has. It
should be in the mysql database under the tablename user. You have to make sure
that you have all the rights, all the priviliges equals to  'Y'. I'm not really
sure how these previiliges, but you can just set everything to 'Y' for the time
being, until you find what each and single one of those priviliges will do.

Do you have still have the "root" id? Have you tried to connect using the "root"
id?

If the command line is a hassle to you might want to try and download mysqlfront
from www.mysqlfront.de


Jeff Oien wrote:

> I tried your code and got this:
>
> Warning: Can't connect to MySQL server on 'localhost'
>
> Also tried ip address of my machine. So at least maybe that narrows
> down the problem.
> Jeff Oien
>
> > Hi Jeff,
> > I am using Windows, but am a beginner.  Here is some code I use maybe it
> > will help
> >
> > I use this in my navigation pages:
> >
> > 
> >
> >  >
> > mysql_pconnect("$host","$user","$password")
> > or die("Unable to connect to SQL server");
> > mysql_select_db("$dbasename") or die("Unable to select database");
> > ?>
> >
> > and here is db_details.php
> >
> >  > $host="host.name.com";
> > $user="user_id";
> > $password="password";
> > $dbasename="database_name";
> > ?>
> > By using the include it means if I go LIVE with a site I only have to change
> > one file db_details.php
> > The reason I don't do it all in one is that it didn't like "." in IP
> > addresses for some reason ( I think it thought it was the beginning of a
> > string)
> > On my windows machine my db_details would look like this
> >  > $host="localhost";
> > $user="";
> > $password="";
> > $dbasename="database_name";
> > ?>
> > You shouldn't need a password.
> > I hope this helps
> > All the Best
> > Lisa
> >
> > -Original Message-
> > From: Jeff Oien [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, May 17, 2001 2:16 PM
> > To: PHP-DB
> > Subject: RE: [PHP-DB] MySQL Connect Problem
> >
> >
> > I'm on Windows 2000.
> > Jeff
> >
> > > Jeff,
> > >
> > > If you are on unix/linux use the command id to see who you are.
> > > You can only use jeff in your connect string if jeff is a user in your
> > mysql
> > > database.
> > >
> > > If you are root when you are running mysql then you should probably set a
> > > password for root in the database.
> > >
> > > Wayne
> > >
> > >
> > > On Thu, 17 May 2001 13:20, Jeff Oien wrote:
> > > > > > Here is sample code:
> > > > > >  > > > > > $connection = @mysql_connect("localhost", "jeff", "*")
> > > > > > or die("Couldn't connect.");
> > > > > > if ($connection) {
> > > > > > $msg = "success!";
> > > > > > }
> > > > > > ?>
> > > > > >
> > > > > > This is on my machine only used by me. I also tried connecting to
> > > > > > IP address and 127.0.0.1 and it still won't work. Thanks.
> > > > > > Jeff Oien
> > > > >
> > > > > Are your the 'root' rather than 'jeff'?  Did you alter the grants and
> > > > > apply the password? If not do you need  a password for connection?
> > > > >
> > > > > Tim Morris
> > > >
> > > > To be honest I don't know if I am root. I know I don't need a password
> > > > to connect via the command line. I just type 'mysql'. I do have username
> > > > and password specified in the .ini file which I believe I set when I
> > first
> > > > installed it. What can I do from here?
> > > > Jeff Oien
> > >
> > > --
> > > Wayne Bastow - DBA - Central Coast Health Phone: 61 2 43203231
> > > Email: wbastowATccahsDOThealthDOTnswDOTgovDOTau
> > >
> > > Linux, the choice of a GNU generation Kernel 2.2.16-22 on a i686
> > >
> > > Running Windows on a Pentium is like having a brand new Porsche but  only
> > > be able to drive backwards with the handbrake on. (Unknown source)
> > >
> > > ==
> > > This message is intended for the addressee named and may contain
> > > confidential information. If you are not the intended recipient, please
> > > delete it and notify the sender. Views expressed in this message are
> > > those of the individual sender, and are not necessarily the views of
> > > the NSW Department of Health.
> > > ==
> > >
> >
> > --
> > 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 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-DB] display variable variables in a text field in a form

2001-05-18 Thread Shahmat Dahlan

$fields=array("fname","lname","dept","city","ophone","hphone","fax","email");

$sqlstmt="SELECT * FROM contacts WHERE id='$id'";
$result=mysql_query($sqlstmt);
foreach ($fields as $values) {
  print "\n$fieldn\n\n  \n";
}

I'm not sure how to explain this, when do the above (I have ommited
certain portions of my codes). The form will be displayed as:

First Name$fname
Last Name$lname
Department   $dept
City   $city
Office Phone $ophone
Handphone   $handphone
Fax   $fax
E-mail   $email

How do I make it to display the actual values of $fname instead of the
variable name itself?

Thanks in advance..

regards



[PHP-DB] Command line PHP + DB access

2001-05-18 Thread Jordi Campos i Miralles

Hello everybody!

I'm trying to access an Informix DB from a PHP script that has to be
executed from the console with "php -q"...

The script include some libraries I've done, and one of them is used to
connect to the DB.

Well, when this library is used through a PHP script executed by Apache
there are no problems,

BUT when the same library is used through a PHP script directly executed
from the command line, the error:

"Call to undefined function:  ifx_connect()"... appear

So, does anybody know how should I call the PHP script from the command
line in order to let the database functions work?

Thanks in advance.

jor:)i

-- 
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-DB] Data Warehousing with PHP + DB???????

2001-05-18 Thread Corrado Topi

Hi all,

I am looking for Data Warehousing and/or OLAP applications.

Two questions:
 
1)Anybody has experience in using PHP + DB (ie. MySQL or PostgresSQL or
) for data warehousing?
 
2)Anybody has tried to implement OLAP engine for data warehousing
using PHP + DB (i.e.e MySQL or PostgresSQL or )???ù

3)Anybody knows about a spcecific DB for this kind of applications which
is integrated/interfaced with PHP?
 
I thank You in advance!
 
Have a nice day ...
 
-- 
Dr. Corrado Topi
Responsabile Sezione Progetti Speciali
Elbi International S.p.A. - Gruppo Bitron 
Via De Amicis, 78 
10093 Collegno, TO, Italy
Ph: + 39 0114102 544
Fax:+ 39 0114102 265


-- 
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-DB] ORDER BY in MYSQL ? 8(

2001-05-18 Thread Jens Nedal

question: 

Do any of you knwo how to correctly sort output from a query that contains
"Umlaut" like " Ä Ö Ü" etc. so that it looks like this:

A
Ä
B
C
D

O
Ö
P
R


and not like MYSQL does it now with the ORDER BY function, which puts all
the "Umlaut" at the end like this:

A
B
C
D
...
O
P
R
...
Z
Ä
Ö

thx in advance for any suggestions. I didn't find anything in the
manualunder the ORDER BY documentation, but maybe myasql can configure the
kind of sort in prefs or such? =)

Jens Nedal


So long and thx for the fish!



--
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]