Re: [PHP-DB] keyword search a mysql database.

2002-12-19 Thread mike karthauser
on 18/12/02 5:47 pm, Adam Voigt at [EMAIL PROTECTED] wrote:

 $searchstring = $_POST[searchfor];
 $searchstring = str_replace( ,%,$searchstring);
 
 mssql_query(SELECT id FROM table WHERE field LIKE '$searchstring';);

I've modified my query to

$result = mysql_query(SELECT coursecode, title FROM courses WHERE title
LIKE '$tsearch' ORDER BY title,$db);

Where $tsearch is my search string.

I'm not getting any results from this though

What i am trying to achieve is to look in title and produce a result if the
string appears.

so searching for 'Training Course will find results like
Training Course 1
Training Course 2
Training Course n, etc.

Is LIKE the best way to do this or should i be using wildcards?
-- 
Mike Karthauser 
Managing Director - Brightstorm Ltd

Email[EMAIL PROTECTED]
Web  http://www.brightstorm.co.uk
Tel  0117 9426653 (office)
   07939 252144 (mobile)

SnailmailUnit 8, 14 King Square,
   Bristol BS2 8JJ


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




[PHP-DB] Passing selection to next page

2002-12-19 Thread Alex Francis
I have a drop down list created using the following code and am having
trouble passing my selection to the next page. Can anyone help?

?
$query = select distinct department from courses order by department;
$result = mysql_query($query);

echo SELECT ID='Category Combo Box' NAME='department';
echo OPTION VALUE=' ' SELECTEDSelect Department/OPTION;

While ($row = mysql_fetch_assoc($result))
{
   echo OPTION VALUE=';
   echo stripslashes($row[department]);
   echo ' ;
   echo stripslashes($row[department]);
   echo /OPTION;
}

echo /SELECT;
mysql_free_result($result);
?




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




RE: [PHP-DB] Passing selection to next page

2002-12-19 Thread Snijders, Mark

I guess this all is in a form

so on the next page it should be in:

echo $_POST[department];

or in

echo $department   depending on the php version





-Original Message-
From: Alex Francis [mailto:[EMAIL PROTECTED]]
Sent: donderdag 19 december 2002 12:05
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Passing selection to next page


I have a drop down list created using the following code and am having
trouble passing my selection to the next page. Can anyone help?

?
$query = select distinct department from courses order by department;
$result = mysql_query($query);

echo SELECT ID='Category Combo Box' NAME='department';
echo OPTION VALUE=' ' SELECTEDSelect Department/OPTION;

While ($row = mysql_fetch_assoc($result))
{
   echo OPTION VALUE=';
   echo stripslashes($row[department]);
   echo ' ;
   echo stripslashes($row[department]);
   echo /OPTION;
}

echo /SELECT;
mysql_free_result($result);
?




-- 
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] Passing selection to next page

2002-12-19 Thread xxx xxxx
Hi,
you have to put this list in a form...
form name=select_name action=eval.php method=post
select
option
/select
/form

in eval.php you may write like:
$variable1=$_POST['select_name'];
//and variable1 is now the option_value selected

echo $variable1;

where option_value is the value written in the list...generated by php
if I have a list with 4 values like:
option value=onevalue number one-first/option
option value=twovalue number two -second/option
option value=threevalue number three -third/option
option value=fourvalue number four fourth/option

here the option_value is one or two or three or four

so variable1 is now passed from one page to another..

if you have any questions or you are of a different opinion write to me again

cybercop78


On Thu, 19 Dec 2002 11:04:34 -, Alex Francis wrote
 I have a drop down list created using the following code and am 
 having trouble passing my selection to the next page. Can anyone help?
 
 ?
 $query = select distinct department from courses order by department;
 $result = mysql_query($query);
 
 echo SELECT ID='Category Combo Box' NAME='department';
 echo OPTION VALUE=' ' SELECTEDSelect Department/OPTION;
 
 While ($row = mysql_fetch_assoc($result))
 {
echo OPTION VALUE=';
echo stripslashes($row[department]);
echo ' ;
echo stripslashes($row[department]);
echo /OPTION;
 }
 
 echo /SELECT;
 mysql_free_result($result);
 ?
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php





http://www.idilis.ro - Stiri, e-mail gratuit, download,
SMS, server de counter-strike, hosting gratuit, servicii internet...
Fii cu un pas inaintea celorlati!


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




Re: [PHP-DB] picture into mysql (file address)

2002-12-19 Thread Terry Romine
One comment is to be sure the destination folder has write privileges 
for world.

My typical usage is:

2)  // datafile is field name for image/file upload browser
	$img_dir = ../photos; // must be 777 access
if($datafile_name != ) {
if ($datafile_name != none) {
$newFileName = $datafile_name;
if (!(copy($datafile, $img_dir/$newFileName))) {
$errmsg = bcopying $newFileName failed/bbr;
} else {
$errmsg = bcopying $newFileName succeeded/bbr;
}
}
}


On Wednesday, December 18, 2002, at 02:20 PM, Seabird wrote:


exec(cp $_POST[picture]
//localhost/seabird.jmtech.ca/OTF.com/images/$_POST[picture_name]);



[PHP-DB] Inserting URL into table

2002-12-19 Thread George Pitcher
Hi,

I'm trying to insert a URL into a char field.

MySQLFront punts out this error with my compiled query:

You have an error in your SQL syntax.  Check the manual that corresponds to
your MySQL server version for the right syntax to use near '','Yahoo
mail','httpNULL/www.yahoo.co.uk/')'

Well there's nothing helpful in the MySQL Manual so can someone point me in
the right direction.

I am expecting that some form of encoding should take place - but which one?

Cheers

George in Oxford
===

George Pitcher
HERON Technical Manager
Ingenta plc
23-38 Hythe Bridge Street, Oxford, OX1 2ET
T  +44 (0)1865 799137 direct
T  +44 (0)1865 799000 switchboard
F  +44 (0)1865 799134
E  [EMAIL PROTECTED]

www.ingenta.com
Ingenta: Empowering the exchange of academic and professional content
online.


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




RE: [PHP-DB] Inserting URL into table

2002-12-19 Thread Hutchins, Richard
Try addslashes($varname). Check PHP.NET for addslashes.

 -Original Message-
 From: George Pitcher [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, December 19, 2002 11:24 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] Inserting URL into table
 
 
 Hi,
 
 I'm trying to insert a URL into a char field.
 
 MySQLFront punts out this error with my compiled query:
 
 You have an error in your SQL syntax.  Check the manual that 
 corresponds to
 your MySQL server version for the right syntax to use near '','Yahoo
 mail','httpNULL/www.yahoo.co.uk/')'
 
 Well there's nothing helpful in the MySQL Manual so can 
 someone point me in
 the right direction.
 
 I am expecting that some form of encoding should take place - 
 but which one?
 
 Cheers
 
 George in Oxford
 ===
 
 George Pitcher
 HERON Technical Manager
 Ingenta plc
 23-38 Hythe Bridge Street, Oxford, OX1 2ET
 T  +44 (0)1865 799137 direct
 T  +44 (0)1865 799000 switchboard
 F  +44 (0)1865 799134
 E  [EMAIL PROTECTED]
 
 www.ingenta.com
 Ingenta: Empowering the exchange of academic and professional content
 online.
 
 
 -- 
 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] Inserting URL into table

2002-12-19 Thread 1LT John W. Holmes
 I'm trying to insert a URL into a char field.

 MySQLFront punts out this error with my compiled query:

 You have an error in your SQL syntax.  Check the manual that corresponds
to
 your MySQL server version for the right syntax to use near '','Yahoo
 mail','httpNULL/www.yahoo.co.uk/')'

 Well there's nothing helpful in the MySQL Manual so can someone point me
in
 the right direction.

 I am expecting that some form of encoding should take place - but which
one?

Probably an addslashes() issue, but what's your whole query look like?

---John Holmes...


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




[PHP-DB] trees in MySQL

2002-12-19 Thread José Moreira
hello im implementing a portal and im choosing between the 'Nested Set' and
'Adjacency Lists tree' models.
http://users.starpower.net/rjhalljr/Serve/MySQL/traer.html


im perfectly aware of the 'Adjacency Lists tree' model how-to and I am
studying the 'Nested Set', example follows :

CREATE TABLE LanguageTree (

  Language VARCHAR(255) PRIMARY KEY
, Parent VARCHAR(255)
, Lft LONG
, Rgt LONG
, INDEX idxLft (Lft)
, INDEX idxRgt (Rgt)
) Comment = Related languages;


A[1 12]
  /  \
 /\
B[2 3]   C[4 11]
   /  \
  /\
  D[5 8] F[9 10]
 |
  E[6 7]


my doubt is that if i want to insert a new node, for example 'G' under 'A'

A[1 12]
  / | \
 /   \
B[2 3]G[]   C[4 11]
   / \
  /   \
  D[5 8] F[9 10]
 |
  E[6 7]


i have? to update almost every left,righ fields after that node, resulting
in a website performance downgrade 


help? even if thjats the only way, how can i do it? perhaps im getting it
wrong ...


best regards


José Moreira
TEGOPI S.A.
http://www.tegopi.pt









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




RE: [PHP-DB] Inserting URL into table - SOLVED

2002-12-19 Thread George Pitcher
Well, all I can say is Doh! as Homer would put it! Somehow when I created my
table, the link_url field was set is INT with a length of 3! Changing it to
a much longer char field sorted it.

Cheers

George


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




RE: [PHP-DB] trees in MySQL

2002-12-19 Thread Hutchins, Richard
Jose,

In addition to any advice you may receive from your post today, check out
the PHP archives. I distinctly remember a discussion related to these models
maybe a month back that may be of interest to you. Don't remember if it
dealt with your specific concerns, but I'm pretty sure it dealt with the
flexibility of application of the two models in different environments.

Happy hunting.

Rich

 -Original Message-
 From: José Moreira [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, December 19, 2002 11:45 AM
 To: Php-Db (Correio electrónico)
 Subject: [PHP-DB] trees in MySQL
 
 
 hello im implementing a portal and im choosing between the 
 'Nested Set' and
 'Adjacency Lists tree' models.
 http://users.starpower.net/rjhalljr/Serve/MySQL/traer.html
 
 
 im perfectly aware of the 'Adjacency Lists tree' model how-to and I am
 studying the 'Nested Set', example follows :
 
 CREATE TABLE LanguageTree (
 
   Language VARCHAR(255) PRIMARY KEY
 , Parent VARCHAR(255)
 , Lft LONG
 , Rgt LONG
 , INDEX idxLft (Lft)
 , INDEX idxRgt (Rgt)
 ) Comment = Related languages;
 
 
   A[1 12]
 /  \
/\
 B[2 3]   C[4 11]
  /  \
 /\
 D[5 8] F[9 10]
|
 E[6 7]
 
 
 my doubt is that if i want to insert a new node, for example 
 'G' under 'A'
 
   A[1 12]
 / | \
/   \
 B[2 3]G[]   C[4 11]
  / \
 /   \
 D[5 8] F[9 10]
|
 E[6 7]
 
 
 i have? to update almost every left,righ fields after that 
 node, resulting
 in a website performance downgrade 
 
 
 help? even if thjats the only way, how can i do it? perhaps 
 im getting it
 wrong ...
 
 
 best regards
 
 
 José Moreira
 TEGOPI S.A.
 http://www.tegopi.pt
 
 
 
 
 
 
 
 
 
 -- 
 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] PHP/MySQL Problem....

2002-12-19 Thread Grant P. Kohler
Hello, 

I seem to have a problem getting my PHP to work with MySQL.
I have installed Redhat 7.3 on my system and I installed apache, php,
and mysql from the redhat install cd via the RPMS.  Now I know the PHP
works just fine normally, but when I start trying to use the MySQL
commands in my PHP pages to connect to the database I start getting
fatal errors like the following.

Fatal error: Call to undefined function: mysql_connect() in
/home/gkohler79/public_html/book1/chapter11/db_connect.php on line 3

and line 3 looks like this.

$connection = mysql_connect(localhost, mylogin, mypass) or die
(Couldn't connect.);

Also my php configure command looks like this..

 './configure' 'i386-redhat-linux' '--prefix=/usr' '--exec-prefix=/usr'
'--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc'
'--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib'
'--libexecdir=/usr/libexec' '--localstatedir=/var'
'--sharedstatedir=/usr/com' '--mandir=/usr/share/man'
'--infodir=/usr/share/info' '--prefix=/usr'
'--with-config-file-path=/etc' '--enable-force-cgi-redirect'
'--disable-debug' '--enable-pic' '--disable-rpath'
'--enable-inline-optimization' '--with-bz2' '--with-db3' '--with-curl'
'--with-dom=/usr' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr'
'--with-png-dir=/usr' '--with-gd' '--enable-gd-native-ttf' '--with-ttf'
'--with-gdbm' '--with-gettext' '--with-ncurses' '--with-gmp'
'--with-iconv' '--with-jpeg-dir=/usr' '--with-mm' '--with-openssl'
'--with-png' '--with-pspell' '--with-regex=system' '--with-xml'
'--with-expat-dir=/usr' '--with-zlib' '--with-layout=GNU'
'--enable-bcmath' '--enable-debugger' '--enable-exif' '--enable-ftp'
'--enable-magic-quotes' '--enable-safe-mode' '--enable-sockets'
'--enable-sysvsem' '--enable-sysvshm' '--enable-discard-path'
'--enable-track-vars' '--enable-trans-sid' '--enable-yp' '--enable-wddx'
'--without-oci8' '--with-imap=shared' '--with-imap-ssl'
'--with-kerberos=/usr/kerberos' '--with-ldap=shared'
'--with-mysql=shared,/usr' '--with-pgsql=shared'
'--with-snmp=shared,/usr' '--with-snmp=shared' '--enable-ucd-snmp-hack'
'--with-unixODBC=shared' '--enable-memory-limit' '--enable-bcmath'
'--enable-shmop' '--enable-versioning' '--enable-calendar'
'--enable-dbx' '--enable-dio' '--enable-mbstring'
'--enable-mbstr-enc-trans' '--with-apxs=/usr/sbin/apxs'

 

Any help would be greatly appreciated.

-Grant

 

 

Grant P. Kohler

Technology Consultant

The Information Age, Inc.

[EMAIL PROTECTED]

770.838.0373

 




Re: [PHP-DB] trees in MySQL

2002-12-19 Thread 1LT John W. Holmes
If you don't know how many nodes you're going to have and the amount of
branches under each node, then that's the only way to do it.

However, if you can define those numbers, you can use something like the
following. A manager would have 50 numbers, for example. So, rather than
counting through the tree to determine left and right pairs, the first
manager simply has left:1 and right:51. Now, a section leader (SL) under him
has 10 numbers (so a manager can have 5 section leaders). The first section
manager would have 2 - 11, the second 12 - 21, etc. Now each section leader
can have an employee (E) that gets an adjacent left and right pair (so they
are a leaf with nothing under them).

Something like this, hopefully the formatting remains.

Manager
150
  |
 /\
SL SL
2  1112-21
   | |
  /   \ E
E  E  13-14
3-4 5-6

So if you count around the tree, you see it still goes in order, but it
leaves holes where you can fill people in.

So, if you can assign specific limits like that, to add a new section leader
under this manager, you simply select the largest right number for the
current section leaders, which will be 21, and add 10 to that, so the new
section leader would have numbers 22-31.

  Manager
  150
|
  / \
  / |\
SL  SL SL
2  1112  21   22  31
   | |
/ \ E
EE13-14
3-4 5-6

That's probably confusing, but it works on paper for well defined trees. I
can explain in more detail if you're interested, but I don't know if it
applies to your situation or not.

---John Holmes...

- Original Message -
From: José Moreira [EMAIL PROTECTED]
To: Php-Db (Correio electrónico) [EMAIL PROTECTED]
Sent: Thursday, December 19, 2002 11:45 AM
Subject: [PHP-DB] trees in MySQL


 hello im implementing a portal and im choosing between the 'Nested Set'
and
 'Adjacency Lists tree' models.
 http://users.starpower.net/rjhalljr/Serve/MySQL/traer.html


 im perfectly aware of the 'Adjacency Lists tree' model how-to and I am
 studying the 'Nested Set', example follows :

 CREATE TABLE LanguageTree (

   Language VARCHAR(255) PRIMARY KEY
 , Parent VARCHAR(255)
 , Lft LONG
 , Rgt LONG
 , INDEX idxLft (Lft)
 , INDEX idxRgt (Rgt)
 ) Comment = Related languages;


 A[1 12]
   /  \
 /   \
 B[2 3]   C[4 11]
/  \
   /\
   D[5 8] F[9 10]
  |
   E[6 7]


 my doubt is that if i want to insert a new node, for example 'G' under 'A'

 A[1 12]
   / | \
 /  \
 B[2 3]G[]   C[4 11]
/ \
   /   \
   D[5 8] F[9 10]
  |
   E[6 7]


 i have? to update almost every left,righ fields after that node, resulting
 in a website performance downgrade 


 help? even if thjats the only way, how can i do it? perhaps im getting it
 wrong ...


 best regards


 José Moreira
 TEGOPI S.A.
 http://www.tegopi.pt









 --
 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] More linking problems but slightly OT

2002-12-19 Thread George Pitcher
Hi,

Now that I can store - and rebuild my link (URL), I'm having a problem
displaying them.

The links are being displayed into a frame and the link is being prefixed
with the default url for the frameset.

Does anyone know how I can get rid of the prefix?

Cheers

George


===

George Pitcher
HERON Technical Manager
Ingenta plc
23-38 Hythe Bridge Street, Oxford, OX1 2ET
T  +44 (0)1865 799137 direct
T  +44 (0)1865 799000 switchboard
F  +44 (0)1865 799134
E  [EMAIL PROTECTED]

www.ingenta.com
Ingenta: Empowering the exchange of academic and professional content
online.


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




Re: [PHP-DB] trees in MySQL

2002-12-19 Thread Ignatius Reilly
The difficulty you are being confronting could be alleviated by using an XML data 
model (meaning non relational). Of course, I don't know about your requirements, but 
it could be a direction worth investigating.

I use the php_xslt.dll (sablotron) extension, which I find works quite pleasantly.

Ignatius

  - Original Message -
  From: José Moreira [EMAIL PROTECTED]
  To: Php-Db (Correio electrónico) [EMAIL PROTECTED]
  Sent: Thursday, December 19, 2002 11:45 AM
  Subject: [PHP-DB] trees in MySQL


   hello im implementing a portal and im choosing between the 'Nested Set'
  and
   'Adjacency Lists tree' models.
   http://users.starpower.net/rjhalljr/Serve/MySQL/traer.html
  
  
   im perfectly aware of the 'Adjacency Lists tree' model how-to and I am
   studying the 'Nested Set', example follows :
  
   CREATE TABLE LanguageTree (
  
 Language VARCHAR(255) PRIMARY KEY
   , Parent VARCHAR(255)
   , Lft LONG
   , Rgt LONG
   , INDEX idxLft (Lft)
   , INDEX idxRgt (Rgt)
   ) Comment = Related languages;
  
  
   A[1 12]
 /  \
   /   \
   B[2 3]   C[4 11]
  /  \
 /\
 D[5 8] F[9 10]
|
 E[6 7]
  
  
   my doubt is that if i want to insert a new node, for example 'G' under 'A'
  
   A[1 12]
 / | \
   /  \
   B[2 3]G[]   C[4 11]
  / \
 /   \
 D[5 8] F[9 10]
|
 E[6 7]
  
  
   i have? to update almost every left,righ fields after that node, resulting
   in a website performance downgrade 
  
  
   help? even if thjats the only way, how can i do it? perhaps im getting it
   wrong ...
  
  
   best regards
  
  
   José Moreira
   TEGOPI S.A.
   http://www.tegopi.pt
  
  
  
  
  
  
  
  
  
   --
   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] More linking problems but slightly OT

2002-12-19 Thread Gary . Every
Be sure to add http:// to the beginning of your URL, or the browser thinks
it is a local URL

Gary Every
Sr. UNIX Administrator
Ingram Entertainment
(615) 287-4876
Pay It Forward
mailto:[EMAIL PROTECTED]
http://accessingram.com


-Original Message-
From: George Pitcher [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 19, 2002 11:12 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] More linking problems but slightly OT


Hi,

Now that I can store - and rebuild my link (URL), I'm having a problem
displaying them.

The links are being displayed into a frame and the link is being prefixed
with the default url for the frameset.

Does anyone know how I can get rid of the prefix?

Cheers

George


===

George Pitcher
HERON Technical Manager
Ingenta plc
23-38 Hythe Bridge Street, Oxford, OX1 2ET
T  +44 (0)1865 799137 direct
T  +44 (0)1865 799000 switchboard
F  +44 (0)1865 799134
E  [EMAIL PROTECTED]

www.ingenta.com
Ingenta: Empowering the exchange of academic and professional content
online.


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



RE: [PHP-DB] More linking problems but slightly OT

2002-12-19 Thread Hutchins, Richard
I think you're going to have to post some code for this one.

If your database holds the exact data you're expecting, show the code that
is building the link on your page after it is retrieved from the database.
If the link in the database is wrong, show the query that inserts it into
the database in addition to the above.

 -Original Message-
 From: George Pitcher [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, December 19, 2002 12:12 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] More linking problems but slightly OT
 
 
 Hi,
 
 Now that I can store - and rebuild my link (URL), I'm having a problem
 displaying them.
 
 The links are being displayed into a frame and the link is 
 being prefixed
 with the default url for the frameset.
 
 Does anyone know how I can get rid of the prefix?
 
 Cheers
 
 George
 
 
 ===
 
 George Pitcher
 HERON Technical Manager
 Ingenta plc
 23-38 Hythe Bridge Street, Oxford, OX1 2ET
 T  +44 (0)1865 799137 direct
 T  +44 (0)1865 799000 switchboard
 F  +44 (0)1865 799134
 E  [EMAIL PROTECTED]
 
 www.ingenta.com
 Ingenta: Empowering the exchange of academic and professional content
 online.
 
 
 -- 
 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] More linking problems but slightly OT

2002-12-19 Thread George Pitcher
RE: [PHP-DB] More linking problems but slightly OTgary,

Thanks, I'd just found that worked.

Cheers

George
  -Original Message-
  From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
  Sent: 19 December 2002 5:32 pm
  To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
  Subject: RE: [PHP-DB] More linking problems but slightly OT


  Be sure to add http:// to the beginning of your URL, or the browser thinks
it is a local URL

  Gary Every
  Sr. UNIX Administrator
  Ingram Entertainment
  (615) 287-4876
  Pay It Forward
  mailto:[EMAIL PROTECTED]
  http://accessingram.com



  -Original Message-
  From: George Pitcher [mailto:[EMAIL PROTECTED]]
  Sent: Thursday, December 19, 2002 11:12 AM
  To: [EMAIL PROTECTED]
  Subject: [PHP-DB] More linking problems but slightly OT



  Hi,

  Now that I can store - and rebuild my link (URL), I'm having a problem
  displaying them.

  The links are being displayed into a frame and the link is being prefixed
  with the default url for the frameset.

  Does anyone know how I can get rid of the prefix?

  Cheers

  George



  ===

  George Pitcher
  HERON Technical Manager
  Ingenta plc
  23-38 Hythe Bridge Street, Oxford, OX1 2ET
  T  +44 (0)1865 799137 direct
  T  +44 (0)1865 799000 switchboard
  F  +44 (0)1865 799134
  E  [EMAIL PROTECTED]

  www.ingenta.com
  Ingenta: Empowering the exchange of academic and professional content
  online.



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



Re: [PHP-DB] PHP/MySQL Problem....

2002-12-19 Thread Jason Wong
On Friday 20 December 2002 00:56, Grant P. Kohler wrote:
 Hello,

 I seem to have a problem getting my PHP to work with MySQL.
 I have installed Redhat 7.3 on my system and I installed apache, php,
 and mysql from the redhat install cd via the RPMS.  Now I know the PHP
 works just fine normally, but when I start trying to use the MySQL
 commands in my PHP pages to connect to the database I start getting
 fatal errors like the following.

 Fatal error: Call to undefined function: mysql_connect() in
 /home/gkohler79/public_html/book1/chapter11/db_connect.php on line 3

If this is an all Redhat RPM installation then install the mysql-php*.rpm as 
well.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *


/*
If you suspect a man, don't employ him.
*/


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




[PHP-DB] extracting data

2002-12-19 Thread Edward Peloke
I posted this to the php general list also so forgive me if you are seeing
this twice.  Can I use php to extract data from an access db?  The php
script and access db will be local.  I will then upload the file to my
server.

Thanks,
Eddie


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




RE: [PHP-DB] trees in MySQL

2002-12-19 Thread José Moreira
thank you for your help,

the portal will (problably) use sort of a directory index where a node can
be a folder to go 'inside' or a

portlet like moduled application like a forum, or a partial download list
( depending on current node ).

knowing that the 'Adjacency Lists tree' and a bunch of tables would be more
easy to implement i believe the

'Nested Set', few tables ( the tree, users, permissions and a table for each
type of portlet,) and a buch of SQL statements

would be more eficient considering scalability ... correct me if im wrong :)

the first node levels will have just a few very slowly increasing branches
but the forum branch will be more dynamic

depending on site success.

perhaps the 5 or 10 seccions will be sufficientin these first levels and
could use a 1000 unit difference for the more

dinamic. perhaps using also a automated trigger PHP procedure to increase
the number of series when the difference becomes


low.


tree theory is very interesting and has much to offer in terms of knowledge
...





-Mensagem original-
De: 1LT John W. Holmes [mailto:[EMAIL PROTECTED]]
Enviada: quinta-feira, 19 de Dezembro de 2002 17:08
Para: [EMAIL PROTECTED]; Php-Db (Correio electrónico)
Assunto: Re: [PHP-DB] trees in MySQL


If you don't know how many nodes you're going to have and the amount of
branches under each node, then that's the only way to do it.

However, if you can define those numbers, you can use something like the
following. A manager would have 50 numbers, for example. So, rather than
counting through the tree to determine left and right pairs, the first
manager simply has left:1 and right:51. Now, a section leader (SL) under him
has 10 numbers (so a manager can have 5 section leaders). The first section
manager would have 2 - 11, the second 12 - 21, etc. Now each section leader
can have an employee (E) that gets an adjacent left and right pair (so they
are a leaf with nothing under them).

Something like this, hopefully the formatting remains.

Manager
150
  |
 /\
SL SL
2  1112-21
   | |
  /   \ E
E  E  13-14
3-4 5-6

So if you count around the tree, you see it still goes in order, but it
leaves holes where you can fill people in.

So, if you can assign specific limits like that, to add a new section leader
under this manager, you simply select the largest right number for the
current section leaders, which will be 21, and add 10 to that, so the new
section leader would have numbers 22-31.

  Manager
  150
|
  / \
  / |\
SL  SL SL
2  1112  21   22  31
   | |
/ \ E
EE13-14
3-4 5-6

That's probably confusing, but it works on paper for well defined trees. I
can explain in more detail if you're interested, but I don't know if it
applies to your situation or not.

---John Holmes...

- Original Message -
From: José Moreira [EMAIL PROTECTED]
To: Php-Db (Correio electrónico) [EMAIL PROTECTED]
Sent: Thursday, December 19, 2002 11:45 AM
Subject: [PHP-DB] trees in MySQL


 hello im implementing a portal and im choosing between the 'Nested Set'
and
 'Adjacency Lists tree' models.
 http://users.starpower.net/rjhalljr/Serve/MySQL/traer.html


 im perfectly aware of the 'Adjacency Lists tree' model how-to and I am
 studying the 'Nested Set', example follows :

 CREATE TABLE LanguageTree (

   Language VARCHAR(255) PRIMARY KEY
 , Parent VARCHAR(255)
 , Lft LONG
 , Rgt LONG
 , INDEX idxLft (Lft)
 , INDEX idxRgt (Rgt)
 ) Comment = Related languages;


 A[1 12]
   /  \
 /   \
 B[2 3]   C[4 11]
/  \
   /\
   D[5 8] F[9 10]
  |
   E[6 7]


 my doubt is that if i want to insert a new node, for example 'G' under 'A'

 A[1 12]
   / | \
 /  \
 B[2 3]G[]   C[4 11]
/ \
   /   \
   D[5 8] F[9 10]
  |
   E[6 7]


 i have? to update almost every left,righ fields after that node, resulting
 in a website performance downgrade 


 help? even if thjats the only way, how can i do it? perhaps im getting it
 wrong ...


 best regards


 José Moreira
 TEGOPI S.A.
 http://www.tegopi.pt









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

2002-12-19 Thread SELPH,JASON (HP-Richardson,ex1)
If you are on a windows machine, you can create a DSN to the access file and
use odbc from php to connect to it.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 19, 2002 12:59 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] extracting data


I posted this to the php general list also so forgive me if you are seeing
this twice.  Can I use php to extract data from an access db?  The php
script and access db will be local.  I will then upload the file to my
server.

Thanks,
Eddie


-- 
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] trees in MySQL

2002-12-19 Thread Cal Evans
http://froogle.google.com/froogle?q=%22SQL+for+Smarties%22btnG=Froogle+Sear
ch

Chaps 28  29. (ok, I had to read both but it sounds like you already
understand the concepts.) The end of chap 29 he gives a simple example for
maintaining what you are talking about.  I used it to write a dynamic menu
system for a web portal for a client. It is possible to do and not terribly
difficult. Given the lack of stored procedures you do end up executing 8-10
sql commands one after the other but if you are using a transaction safe
table type (*COUGH*InnoDB*COUGH*) then it works pretty good.

Unlike one of the suggestions I read here, this system doesn't like holes in
the numbers. But he gives code for adding and subtracting nodes.  By
combining the two, I actually made it so the client could move entire
branches.

HTH,
=C=

*
* Cal Evans
* The Virtual CIO
* http://www.calevans.com
*


-Original Message-
From: José Moreira [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 19, 2002 10:45 AM
To: Php-Db (Correio electrónico)
Subject: [PHP-DB] trees in MySQL


hello im implementing a portal and im choosing between the 'Nested Set' and
'Adjacency Lists tree' models.
http://users.starpower.net/rjhalljr/Serve/MySQL/traer.html


im perfectly aware of the 'Adjacency Lists tree' model how-to and I am
studying the 'Nested Set', example follows :

CREATE TABLE LanguageTree (

  Language VARCHAR(255) PRIMARY KEY
, Parent VARCHAR(255)
, Lft LONG
, Rgt LONG
, INDEX idxLft (Lft)
, INDEX idxRgt (Rgt)
) Comment = Related languages;


A[1 12]
  /  \
 /\
B[2 3]   C[4 11]
   /  \
  /\
  D[5 8] F[9 10]
 |
  E[6 7]


my doubt is that if i want to insert a new node, for example 'G' under 'A'

A[1 12]
  / | \
 /   \
B[2 3]G[]   C[4 11]
   / \
  /   \
  D[5 8] F[9 10]
 |
  E[6 7]


i have? to update almost every left,righ fields after that node, resulting
in a website performance downgrade 


help? even if thjats the only way, how can i do it? perhaps im getting it
wrong ...


best regards


José Moreira
TEGOPI S.A.
http://www.tegopi.pt









--
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] Help with connecting PHP/MySQL to MS Outlook

2002-12-19 Thread DL Neil
Chris,

 Does anyone know of a way to retrieve MS Outlook data via PHP? I am
creating
 an intrant for my company and want to grab data from the MS Oulook contact
 list on the server to using in my PHP/MySQL intranet project.

 Any help would be most appreciated.


Rather than using PHP to go 'into' Outlook, doesn't OL have an export
function you could use to put it into some mid-step file format and then
read that into PHP?

Regards,
=dn


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




Re: [PHP-DB] picture into mysql (file address)

2002-12-19 Thread Seabird
since this is a local folder (testing on local server) I have complete
access everywhere. I judge from your sample that register_globals are ON and
mine are turned off (for several reasons.

Do I have a typo somewhere? where does my full path start etc.

the actual folder is in: c:\apache\htdocs\seabird.jmtech.ca\otf.com\images

pls help me.
Jacco
--
http://seabird.jmtech.ca

Attitude is Everything!
But Remember, Attitudes are Contagious!
Is Yours worth Catching
Terry Romine [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 One comment is to be sure the destination folder has write privileges
 for world.

 My typical usage is:

  2)  // datafile is field name for image/file upload browser
  $img_dir = ../photos; // must be 777 access
  if($datafile_name != ) {
  if ($datafile_name != none) {
  $newFileName = $datafile_name;
  if (!(copy($datafile, $img_dir/$newFileName))) {
  $errmsg = bcopying $newFileName failed/bbr;
  } else {
  $errmsg = bcopying $newFileName succeeded/bbr;
  }
  }
  }

 On Wednesday, December 18, 2002, at 02:20 PM, Seabird wrote:

  exec(cp $_POST[picture]
  //localhost/seabird.jmtech.ca/OTF.com/images/$_POST[picture_name]);




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




RE: [PHP-DB] extracting data

2002-12-19 Thread Andrew Hill

You can actually do this from any machine, although you will need an ODBC 
driver on the Linux/Mac OS X/Unix side.
Another alternative is to dump the .mdb to mysql format and move it over.

But ODBC is the way to go.  Beginning PHP Databases from Wrox cover this a 
lot, but you can get started with just a DSN and a basic odbc_connect.
Create it as a System DSN - it will cause less problems.

If you are on a *nix or Mac OS X, then you will want to tell the PHP script 
where the files are that contain the DSN (odbc.ini) and the ODBC Driver 
Manager (libiodbc.so).  There are basic examples and explanations in the 
HOWTO at www.iodbc.org.   It's *nix geared, but just remove the putenv()'s 
at the beninning of the examples and they will work fine.

Best regards,
Andrew Hill
Director of Technology Evangelism
OpenLink Software   http://www.openlinksw.com
Virtuoso Universal Server   http://www.openlinksw.com/virtuoso/


At 02:27 PM 12/19/2002, SELPH,JASON (HP-Richardson,ex1) wrote:
If you are on a windows machine, you can create a DSN to the access file and
use odbc from php to connect to it.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 19, 2002 12:59 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] extracting data


I posted this to the php general list also so forgive me if you are seeing
this twice.  Can I use php to extract data from an access db?  The php
script and access db will be local.  I will then upload the file to my
server.

Thanks,
Eddie


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

2002-12-19 Thread Cal Evans
Don't be offended:
SQL For Dummies

One of the best SQL primers I've ever read.  I STILL keep my copy handy.

Once you get through that and a few thousand queries under your belt, Joe
Celko's SQL for Smarties is a great reference. (I recommended it earlier
today to someone, dig that out and it's got a URL)

Depending on the products in your catalog, this could be a daunting. I've
got 1 catalog system that has 10 tables just to describe the products. (All
interrelated, makes for a pretty ER diagram!) But if your needs are simple
AND well defined, it could be a good starter project.

Oh, and don't forget Paul Dubois book on MySQL.  I've not yet purchased a
copy (sorry Paul) but the parts I've leafed through at the bookstore looked
very good.

Also, join the MySQL mailing list. (Paul actually hangs out over there)

=C=

*
* Cal Evans
* The Virtual CIO
* http://www.calevans.com
*


-Original Message-
From: Hynek Semecký ME [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 11, 2002 4:55 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Catalog


Hi list,

I am trying to develop a product catalog using MySQL and PhP.
A long time I was looking for some tips for the database
structure.
The idea is to have a powerfull and as much as possible
universal DB application.

Does anyone have an idea of a book, e-book, site, resource please ?

Thanks
Hynek








--
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] Theory help needed

2002-12-19 Thread Chris Payne
Hi there everyone,

I have a messageboard which works, but what I need is some kind of threading for it.  
Right now I have EXTREMELY basic threading, where you can reply to a message, reply to 
replies etc . and they'll appear in the correct part of the messageboard.  What I 
need though is to be able to do proper threading, where each reply appears under the 
original message and not all over the place, but i'm confused as hell.

Anyway have any experience with this kind of thing and can give me a push in the right 
direction?  I know I need to store the original ID, the forum ID, the message ID of 
the current message and the ID it relates to, but it's getting confusing :-)

Thanks.

Chris



[PHP-DB] Set Logout Time for No Activity

2002-12-19 Thread Allens
Hello,
  Is there a variable in php.ini that will allow you to log someone out 
if there is no activity of 30 minutes or greater from the logged in 
user? Thanks in advance. :)
:)
  Gale L. Allen Jr
  Macintosh Support Specialist
865/947-5740

  Remember, Love wins over all
(:

Re: [PHP-DB] Set Logout Time for No Activity

2002-12-19 Thread Leif K-Brooks
Log out, meaning what?  Using sessions?  Cookies?

Allens wrote:


Hello,
  Is there a variable in php.ini that will allow you to log someone 
out if there is no activity of 30 minutes or greater from the logged 
in user? Thanks in advance. :)
:)
  Gale L. Allen Jr
  Macintosh Support Specialist
865/947-5740

  Remember, Love wins over all
(:


--
The above message is encrypted with double rot13 encoding.  Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law.




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