RE: MySQL - program netadmin.exe ( for Windows )

2001-04-03 Thread Leonard Coonan

To access the Unix database from NT, there is a good tool I use called
webmin (http://www.webmin.com/).  It is written in perl and uses a http
connection through a different port.  I don't know about connecting to NT
from Unix, I only have databases on Linux.


len.



-Original Message-
From: Humberto Quintao [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, 4 April 2001 08:31
To: [EMAIL PROTECTED]
Subject: En: MySQL - program netadmin.exe ( for Windows )
Importance: High



Friends,

I need to manager database MySQL on UNIX Server from Windows NT and I
found the software netadmin.exe, that it is very good, written and
maintained by David Axmark.
I didnt find how to create tables on UNIX server from windows NT...  If
somebody knows how to do this, please tell me !
I need too how to access databases on Windows NT from UNIX Server.
Thank you !

Humberto Quintao
[EMAIL PROTECTED]




RE: parse error

2001-03-26 Thread Leonard Coonan

Petra,
You have a close '}' with no open '{'.  Maybe you should move the If
statement to the next line, then it won't be commented out.


len.
 

-Original Message-
From: Petra [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, 27 March 2001 13:21
To: [EMAIL PROTECTED]
Subject: parse error



can anybody help?
I get this error

Parse error: parse error in mypath to file\Default.php on line 18
I am just learning right now so if you could help me with what I did wrong
her I'd apreciate it.

Thanx Petra
[EMAIL PROTECTED]


HTML
HEAD
TITLE Our List of Historic Products /TITLE
HEAD
BODY
?php
  // Connect to the database server
$dbcnx = @mysql_connect("localhost", "root", "");
if (!$dbcnx) {
echo( "PUnable to connect to the " .
 "database server at this time./P" );
exit();
  }
  // Select the jokes database  if (! @mysql_select_db("JShistbau") ) {
echo( "PUnable to locate the historic products " .
  "database at this time./P" );
exit();
  }
?
P Here are all the products in our database: /P
BLOCKQUOTE
?php

// Request the text of all the products
  $result = mysql_query(
"SELECT catdescription FROM categories");  if (!$result) {
echo("PError performing query: " . mysql_error() . "/P");
exit();  }
  // Display the text of each product in a paragraph  while ( $row =
mysql_fetch_array($result) ) {echo("P" . $row["catdescription"] .
"/P");  }
?
/BLOCKQUOTE/BODY/HTML


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail
[EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php



RE: Split results

2001-03-19 Thread Leonard Coonan

You can use the 'limit' construct on the end of the select statement.

So for first query do 
select blah from blah where blah limit 20;

each succeeding query will be 
select blah from blah where blah limit 20,20;

check the doco for explanation.

You can do a count to start with to determine how many 'buttons' you require
to get all results.


hope this helps.


len.


-Original Message-
From: Andres M.V. Paglayan [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, 20 March 2001 12:47
To: MySQL
Subject: Split results


Hi you all,
Im trying to resolve how to manage a large resultset (about 500), 
showing only 20 rows per page and then to have the option to show more
results from several buttons, 
like when you search something with a lot of pages in the yahoo,
Best wishes for you all.
Thanks in advance.





--
Andrs Mariano Vazken Paglayan
[EMAIL PROTECTED]
--



Unary Relationship.

2001-03-13 Thread Leonard Coonan

Hi, I was wondering if anyone could help me with some SQL.  I have a product
group table that has a link to itself to allow me to build a hierarchy of
products.  Each Product has a link/relationship to its parent, so I have 

PRODUCT GROUP

PRDGRP_TK   Primary Key
PRDGRP_FK   Foreign key of parent product group.

My question is, can I retrieve all parents up the hierarchy using one SQL
statement.  I know I can use my code, (in php in this case) to keep calling
an Sql statement and go up one link at a time.  But it would be very handy
to be able to simply return the entire product group structure above a
particular product group.


thanks

len.




Re: Unary Relationship.

2001-03-13 Thread Leonard Coonan

Almost, and sorry for the ambiguity.  I have two tables, Product Group and
Product.

The product group only contains the 'Product Hierarchy' and the Product
table contains all the product information.

eg

Product Group
-
Prdgrp_idPrdprn_idName
1 Hardware
2 Software
31Monitors
4317"
52Productivity Software
65Office tools
76Word Processors
86Spreadsheets

Product
--
Product_id   Prdgrp_id   Name
17   Msoft Word
28   Msoft Excel
36   Msoft Office

So, in the above example, if I have selected Product 2(excel) I want an SQL
statement to walk up the product group hierarchy as follows.
8  Spreadsheets
6  Office tools
5  Productivity Software
2  Software


I had tried to specify a multiple table structure, but I need unlimited
hierarchy depth, and the ability to cross link and even redesign product
levels on the fly, so the multiple table approach just won't work in this
case.


-Original Message-
From: Eric Fitzgerald [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, 14 March 2001 10:59
To: Leonard Coonan; [EMAIL PROTECTED]
Subject: Re: Unary Relationship.


Very situational

Let me lay out what I *think* your saying your, tell me if I'm right/wrong.

You have a table with 3 (or more, but irelevent) columns.  A sample of the
data is as such:

Product | Group | Name
1   | 1 | Full product listing
2   | 1 | Computers
3   | 2 | Motherboards
4   | 2 | Monitors
5   | 3 | Asus
6   | 3 | Tyan


And let's say your in the Asus sub section of motherboards, so you want to
"step up" the ladder, and find the entire sub path your in...

Well, I personally don't see a way to do this right off, what I would end up
doing in this case is redesigning the tables.  Use a multiple table
structure that links to each other, so you can use joins to gather
information about categories higher up in the heirarchy.

If I misunderstood, please explain.

- Original Message -
From: "Leonard Coonan" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, March 13, 2001 3:52 PM
Subject: Unary Relationship.


 Hi, I was wondering if anyone could help me with some SQL.  I have a
product
 group table that has a link to itself to allow me to build a hierarchy of
 products.  Each Product has a link/relationship to its parent, so I have

 PRODUCT GROUP
 
 PRDGRP_TK Primary Key
 PRDGRP_FK Foreign key of parent product group.

 My question is, can I retrieve all parents up the hierarchy using one SQL
 statement.  I know I can use my code, (in php in this case) to keep
calling
 an Sql statement and go up one link at a time.  But it would be very handy
 to be able to simply return the entire product group structure above a
 particular product group.


 thanks

 len.





RE: Any ideas why this would happen....

2001-03-13 Thread Leonard Coonan

Further to your comment, I have had considerable benefits by creating an
index of both keys as well.  So I define 3 indexes userid, usernum,
useridusernum.

hope this helps.

len


-Original Message-
From: Dan Nelson [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, 14 March 2001 16:06
To: Bob Silva
Cc: [EMAIL PROTECTED]
Subject: Re: Any ideas why this would happen


In the last episode (Mar 13), Bob Silva said:
 Hope this isnt a dupe post...I mailed before confirmation was
 received so I think my post died.
 
 Here is the issue I run the query below and it takes forever ( 1+
 minutes ). It uses 2 keys (one unique) in the where clause but still
 does a full table scan.
 
 mysql SELECT usernum FROM client WHERE userid='Salty3' OR usernum =
 4158774796;
 | usernum|
 | 1893996929 |
 1 row in set (1 min 33.94 sec)
 
 mysql explain SELECT usernum FROM client WHERE userid='Salty3' OR usernum
= 4158774796;
 | table  | type | possible_keys | key  | key_len | ref  | rows|
Extra  |
 | client | ALL  | PRIMARY,useridIDX | NULL |NULL | NULL | 1586795 |
where used |

Mysql can only use one index per table.  Since using only one of the
two possible indexes may not return the requested records (what if it
chose the userid index?), it must do a full table scan.

Merging the results of two index scans on one table is tricky (Oracle
will only do it if hinted), but most of the time it's quicker to
just do the full table scan.  Your example, of course, is one where it
would help.

-- 
Dan Nelson
[EMAIL PROTECTED]

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail
[EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php