[PHP-DB] Invitation from Multiply

2012-04-18 Thread MA PROPOSISION ELMAZI (via Multiply)

Check out my Multiply site

I set up a Multiply site with my pictures, videos and blog and I want 
to add you as my friend so you can see it. First, you need to join 
Multiply! Once you join, you can also create your own site and share 
anything you want, with anyone you want.

Here's the link:
http://multiply.com/si/04z4gUvdfAvWOXUCM+Dk+g

Salutations,
Je sais que cette lettre de proposition pourrait vous parvenir comme 
une surprise considérant le fait que nous n'avons aucun lien entre 
vous et moi, ni aucune relation amicale auparavant, mais je crois 
qu'il est seulement un jour que les gens se rencontrent et deviennent 
de grands amis et partenaires d'affaires.
Je suis Mr. ELMAZI SELAM, actuellement Chef des Audits et Comptes 
d'une Banque de bonne réputation. Et je voudrais entrer dans une 
affaire confidentielle avec vous sur votre acceptation à coopérer avec
moi je vous ferai connaitre les détails.Contactez-moi sur mes adresses
e-mails personnelles qui sont: selm...@superposta.com,- 
selam.elm...@yahoo.com
En vous remerciant l'avance et attendant votre prompte réponse.
Cordialement, et espérant une suite de votre part
Mr. ELMAZI SELAM
E-mail: selm...@superposta.com,- selam.elm...@yahoo.com
Merci

Thanks,
MA PROPOSISION







Stop e-mails, view our privacy policy, or report abuse: 
http://multiply.com/bl/04z4gUvdfAvWOXUCM+Dk+g
We haven't added your email address to any lists, nor will we share it
with anyone at any time.
Copyright 2012 Multiply
6001 Park of Commerce Blvd, Boca Raton, FL


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



Re: [PHP-DB] multiple tables and amounts

2004-01-29 Thread ma
hi!

thanks a lot for your answer. i also thought of dividing the problem into
several selects, but the application i'm working with (it's designed by a
friend of mine, which lets you easily generate XML out of an sql) only
accepts one single query..

do you know about any problems using CREATE TEMPORARY TABLE - eg. when there
are a lot of users accessing the page?

thx for your help again!

-mathew


# die welt ist schnell geworden...

 Von: Hutchins, Richard [EMAIL PROTECTED]
 Antworten an: [EMAIL PROTECTED]
 Datum: Thu, 29 Jan 2004 08:25:03 -0500
 An: '[EMAIL PROTECTED]' [EMAIL PROTECTED]
 Betreff: RE: [PHP-DB] multiple tables and amounts
 
 Matt,
 
 What about this (assuming MySQL):
 
 //$photoid is whatever photo you want the details for.
 $sql_a = SELECT id FROM comments WHERE phid = '.$photoid.';
 $sql_b = SELECT id FROM ratings WHERE phid = '.$photoid.';
 
 $result_a = mysql_query($sql_a) or
 die(mysql_error());
 $num_comments = mysql_num_rows($result_a);
 
 $result_b = mysql_query($sql_b) or
 die(mysql_error());
 $num_ratings = mysql_num_rows($result_b);
 
 echo There were .$num_comments. comments and .$num_ratings. for that
 photo.;
 
 Since you're not doing anything really difficult with the queries, you
 probably won't see much of a speed hit by doing back-to-back queries like
 this. Besides, I think doing two straight queries like this is going to be
 faster than creating and deleting temporary tables. Just a guess.

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



Re: [PHP-DB] multiple tables and amounts

2004-01-29 Thread ma
hi!

yes - it seems as if there was no way out. i'll have to render it without
this php-class. i didn't thought that it's not possible to do such queries
in sql - well at least i don't know how to do them?? :/

thx for your answers!

-mathew 

# life would be easier if i knew the source code...

 Von: Robert Sossomon [EMAIL PROTECTED]
 Organisation: Garland C Norris Company
 Antworten an: [EMAIL PROTECTED]
 Datum: Thu, 29 Jan 2004 11:10:04 -0500
 An: [EMAIL PROTECTED]
 Betreff: RE: [PHP-DB] multiple tables and amounts
 
 I may be able to hack the XML code to do it, but with wanting a COUNT of
 each based on the ID, it is going to be difficult to do it in 1 query
 only, in my opinion at least... Is there a way to out-think the XML
 generation to grab the items you need?
 
 
 
 -Original Message-
 From: ma [mailto:[EMAIL PROTECTED]
 Sent: Thursday, January 29, 2004 10:40 AM
 To: PHP-DB
 Subject: Re: [PHP-DB] multiple tables and amounts
 
 
 hi!
 
 thanks a lot for your answer. i also thought of dividing the problem
 into several selects, but the application i'm working with (it's
 designed by a friend of mine, which lets you easily generate XML out of
 an sql) only accepts one single query..
 
 do you know about any problems using CREATE TEMPORARY TABLE - eg. when
 there are a lot of users accessing the page?
 
 thx for your help again!
 
 -mathew
 
 
 # die welt ist schnell geworden...
 
 Von: Hutchins, Richard [EMAIL PROTECTED] Antworten
 an: [EMAIL PROTECTED]
 Datum: Thu, 29 Jan 2004 08:25:03 -0500
 An: '[EMAIL PROTECTED]' [EMAIL PROTECTED]
 Betreff: RE: [PHP-DB] multiple tables and amounts
 
 Matt,
 
 What about this (assuming MySQL):
 
 //$photoid is whatever photo you want the details for.
 $sql_a = SELECT id FROM comments WHERE phid = '.$photoid.'; $sql_b
 
 = SELECT id FROM ratings WHERE phid = '.$photoid.';
 
 $result_a = mysql_query($sql_a) or
 die(mysql_error());
 $num_comments = mysql_num_rows($result_a);
 
 $result_b = mysql_query($sql_b) or
 die(mysql_error());
 $num_ratings = mysql_num_rows($result_b);
 
 echo There were .$num_comments. comments and .$num_ratings. for
 that photo.;
 
 Since you're not doing anything really difficult with the queries, you
 
 probably won't see much of a speed hit by doing back-to-back queries
 like this. Besides, I think doing two straight queries like this is
 going to be faster than creating and deleting temporary tables. Just a
 
 guess.
 
 -- 
 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] multiple tables and amounts

2004-01-29 Thread ma
thx for the query!

unfortunately it does not what i was aiming for... a result like this:

id | img | comments | ratings
---+-+--+
1  | p.jpg   | 0| 1
2  | a.jpg   | 3| 4
3  | v.png   | 2| 0

so the variable to set dynamicall should be compared to gid (id from the
gallery-table).

i found that the problem with two joins is, that the group-by-methods get
applyed to all rows, so i cannot differ the amount of comments and ratings.
the only possibility is to find it out via php, but this is not what i'm
aiming for.. 

thanks for your answer!

-mathew 

# life would be easier if i knew the source code...

 Von: Robert Sossomon [EMAIL PROTECTED]
 Organisation: Garland C Norris Company
 Antworten an: [EMAIL PROTECTED]
 Datum: Thu, 29 Jan 2004 11:17:55 -0500
 An: [EMAIL PROTECTED], 'PHP-DB' [EMAIL PROTECTED]
 Betreff: RE: [PHP-DB] multiple tables and amounts
 
 // This is just 1 query, I have not tested it, but it may work.
 
 $get_Quote = select ph.id, ph.img, cm.id, cm.phid, cm.txt, rt.id,
 rt.phid, rt.text from photos as ph left join comments as cm left join
 ratings as rt on ph.id = cm.phid = rt.phid where id = '$photo_id' order
 by ph.id;
 
 //runs the query
 $get_Quote_res = mysql_query($get_Quote) or die(mysql_error());
 
 
 
 
 -Original Message-
 From: ma [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, January 28, 2004 10:21 PM
 To: PHP-DB
 Subject: [PHP-DB] multiple tables and amounts
 
 
 hi!
 
 i have a weired problem:
 
 there are 3 tables:
 photos (id, img)
 comments (id, phid, text)
 ratings (id, phid, text)
 
 now i tried to create a query returning the amount of ratings and the
 amount of comments for all images in the photo-table.
 
 i tried it with multiple joins, but without success...
 but i ended up using some CREATE TEMPORARY TABLE syntax - is there a way
 to do it one-query?
 
 CREATE TEMPORARY TABLE comments_temp
 SELECT comments.id, comments.phid,
 COUNT(comments.id) AS ratings
 FROM comments
 LEFT JOIN ratings ON ratings.phid=comments.phid
 WHERE comments.phid=1
 GROUP BY comments.phid,
 comments.id;
 
 SELECT photos.*,
 COUNT(photos.id) AS comments,
 comments_temp.ratings
 FROM photos
 LEFT JOIN comments_temp ON comments_temp.phid = photos.id
 WHERE gid=1
 GROUP BY photos.id;
 
 DROP TABLE comments_temp;
 
 as said i would like to do it one-query, because it does not seem to me
 being a simple and beautiful solution??
 
 help would be warmly appretiated... thx alot
 - mathew
 
 # life would be easier if i knew the source code...
 
 -- 
 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



[PHP-DB] multiple tables and amounts

2004-01-28 Thread ma
hi!

i have a weired problem:

there are 3 tables:
photos (id, img)
comments (id, phid, text)
ratings (id, phid, text)

now i tried to create a query returning the amount of ratings and the amount
of comments for all images in the photo-table.

i tried it with multiple joins, but without success...
but i ended up using some CREATE TEMPORARY TABLE syntax - is there a way to
do it one-query?

CREATE TEMPORARY TABLE comments_temp
SELECT comments.id, comments.phid,
COUNT(comments.id) AS ratings
FROM comments
LEFT JOIN ratings ON ratings.phid=comments.phid
WHERE comments.phid=1
GROUP BY comments.phid,
comments.id;

SELECT photos.*,
COUNT(photos.id) AS comments,
comments_temp.ratings
FROM photos
LEFT JOIN comments_temp ON comments_temp.phid = photos.id
WHERE gid=1
GROUP BY photos.id;

DROP TABLE comments_temp;

as said i would like to do it one-query, because it does not seem to me
being a simple and beautiful solution??

help would be warmly appretiated... thx alot
- mathew

# life would be easier if i knew the source code...

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



Re: [PHP-DB] MySQL Insert

2004-01-07 Thread ma
hi

there are several ways of saving the data within a file.
you can save it plain or binary. if you want to save a file in the db i
suggest using the field-type BLOB

short example:

to create the table:

CREATE TABLE `files` (
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`fileName` VARCHAR(255) NOT NULL,
`data` BLOB,
PRIMARY KEY (`id`)
) TYPE=MyISAM

the html-form:

form name=saveFile action=script.php method=post
enctype=multipart/form-data
File: input name=myFile type=file
input type=submit
/form

the php-script:

?php

$con = mysql_connect();
mysql_select_db();

if(isset($_FILES['myFile']) 
is_uploaded_file($_FILES['myFile']['tmp_name'])) {

$data = join('', file($_FILES['myFile']['tmp_name']));
$qry = 'INSERT INTO `files` (filename, data) VALUES
('.$_FILES['myFile']['name'].', '.$data.')';
mysql_query($qry, $con);

}

?

for further info gosee:
http://www.php.net/manual/en/features.file-upload.php


hth?

greetings -ma

# life would be easier, if i knew the source code...

 Von: Will W [EMAIL PROTECTED]
 Antworten an: [EMAIL PROTECTED]
 Datum: Wed, 7 Jan 2004 20:21:15 -0500
 An: PHP DB [EMAIL PROTECTED]
 Betreff: [PHP-DB] MySQL Insert
 
 Hello Everyone,
 Can anyone tell me how to insert a file, say a .doc, .txt or a .rtf file into
 a table from an upload form??
 
 Thanks in advance,
 ~~Will~~
 

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



Re2: [PHP-DB] MySQL Insert

2004-01-07 Thread ma
hi!

just to add:

use file() only if you run php 4.3.0 or higher.

if this is not the case use this syntax (its binary safe):

$fp = fopen($_FILES['myFile']['tmp_name'], 'r'); # on windows use 'rb'
instead of 'r'
$data = fread($fp, file_size($_FILES['myFile']['tmp_name']));
fclose($fp);

instead of $data = join(etc);

greets - ma

# life would be easier if i knew the source code...

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



Re: [PHP-DB] MySQL Insert

2004-01-07 Thread ma
hi!

no problem... people should help each other ;)

so: no there is no difference. if you want people to have the possibility to
download the file there are certain things to remember of. just a short
example:

?php

$con = mysql_connect(...);
mysql_select_db();

$file = $_GET['file'];

$qry = 'SELECT `data` FROM `files` WHERE `file`='.addslashes($file).''; //
prevent from sql-injection-attacks
$res = mysql_query($qry);
// errorhandling missing
$data = mysql_fetch_assoc($res);
$data = $data['data'];

$fileInfo = pathinfo($file);

switch($fileInfo['extension']) {
   case pdf: $ctype=application/pdf;  break;
   case exe: $ctype=application/octet-stream;  break;
   case zip: $ctype=application/zip;  break;
   case doc: $ctype=application/msword;break;
   case xls: $ctype=application/vnd.ms-excel;  break;
   case ppt: $ctype=application/vnd.ms-powerpoint; break;
   case gif: $ctype=image/gif;break;
   case png: $ctype=image/png;break;
   case jpg: $ctype=image/jpg;break;
   default:$ctype=application/force-download; break;
}

header('Content-Type: '.$ctype);
header('Content-Disposition: attachment; filename='.$file
header('Content-Transfer-Encoding: binary');
header('Content-Length: '.strlen($data)); // not sure if it works

echo $data;
?

greets -ma

# life would be easier if i knew the source code...

 Von: Will W [EMAIL PROTECTED]
 Antworten an: [EMAIL PROTECTED]
 Datum: Wed, 7 Jan 2004 21:03:40 -0500
 An: [EMAIL PROTECTED]
 Betreff: Re: [PHP-DB] MySQL Insert
 
 Thanks!!! :)
 
 For getting the info from the database is it like all the rest or is there a
 certain way to get those types of files from the database?
 
 Thanks,
 ~~Will~~
 
 - Original Message -
 From: ma [EMAIL PROTECTED]
 To: PHP-DB [EMAIL PROTECTED]
 Sent: Wednesday, January 07, 2004 8:42 PM
 Subject: Re2: [PHP-DB] MySQL Insert
 
 
 hi!
 
 just to add:
 
 use file() only if you run php 4.3.0 or higher.
 
 if this is not the case use this syntax (its binary safe):
 
 $fp = fopen($_FILES['myFile']['tmp_name'], 'r'); # on windows use 'rb'
 instead of 'r'
 $data = fread($fp, file_size($_FILES['myFile']['tmp_name']));
 fclose($fp);
 
 instead of $data = join(etc);
 
 greets - ma
 
 # life would be easier if i knew the source code...
 
 --
 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] MySQL Insert via SQL?

2004-01-07 Thread ma
hi!

just a question: don't know it exactly: isn't it possible that the sql-user
on the server may not have enough rights to read the file?

anyway, i would save the file elsewhere on the server, because there are
remarkable performance-issues with big data (tried it once with storing
images for a photo-gallery). it is much faster saving the file in some
directory and just save the path to the file in the db; which on the other
hand, can lead to synchronisation-problems. what do you think about this
topic?

thx -ma

# life would be easier if i knew the source code...

 Von: John W. Holmes [EMAIL PROTECTED]
 Antworten an: [EMAIL PROTECTED]
 Datum: Wed, 07 Jan 2004 21:29:20 -0500
 An: Will W [EMAIL PROTECTED]
 Cc: PHP DB [EMAIL PROTECTED]
 Betreff: Re: [PHP-DB] MySQL Insert
 
 Will W wrote:
 
 Can anyone tell me how to insert a file,
 say a .doc, .txt or a .rtf file into a table from an upload form??
 
 How about just this:
 
 $query = INSERT INTO Table (orig_name, size, mime_type, data) VALUES
 ('{$_FILES['userfile']['name']}', '{$_FILES['userfile']['size']}',
 '{$_FILES['userfile']['type']}',LOAD_FILE('{$_FILES['userfile']['tmp_name']}')
 );
 
 Adapt to your needs. No need for PHP to read the file when you can just
 let MySQL do it. :)
 
 -- 
 ---John Holmes...
 
 Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
 
 php|architect: The Magazine for PHP Professionals ­ www.phparch.com
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

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



Re: [PHP-DB] MySQL Insert via SQL?

2004-01-07 Thread ma
hi!

thx for your feedback! just wondered about the sql-documentation saying that
the file must be readable t all users. (at least session-files are only
read/write-able to the php-user. so i was uncertain.. imho your solution is
much nicer for saving the file in the db (allthough it may be a bad idea).

you're right ;) sometimes arguing can get anoying (e.g. which distribution
of linux is best and so on...)

greets ma


# life would be easier if i knew the source code...

 Von: John W. Holmes [EMAIL PROTECTED]
 Antworten an: [EMAIL PROTECTED]
 Datum: Wed, 07 Jan 2004 21:52:23 -0500
 An: [EMAIL PROTECTED]
 Cc: PHP-DB [EMAIL PROTECTED]
 Betreff: Re: [PHP-DB] MySQL Insert via SQL?
 
 ma wrote:
 
 just a question: don't know it exactly: isn't it possible that the sql-user
 on the server may not have enough rights to read the file?
 
 Yeah, could be. The uploaded file is already somewhere that PHP can
 write to, though, so it's more than likely available for reading by any
 other user.
 
 anyway, i would save the file elsewhere on the server, because there are
 remarkable performance-issues with big data (tried it once with storing
 images for a photo-gallery). it is much faster saving the file in some
 directory and just save the path to the file in the db; which on the other
 hand, can lead to synchronisation-problems. what do you think about this
 topic?
 
 I agree entirely. I wouldn't put the file in the database either. I gave
 up on arguing that though since people seem so determined to do it. :)
 
 -- 
 ---John Holmes...
 
 Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
 
 php|architect: The Magazine for PHP Professionals ­ www.phparch.com
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

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



[PHP-DB] LOCK TABLES with registry?

2004-01-06 Thread ma
Hi folks!

I use a registry in my webapp which holds an instance of my sql-class.
within my application i _only_ use this instance to do queries.

first of all i lock all my tables with

LOCK TABLES tableName WRITE;

Later in the progrmm i try to do a SELECT `menue` as `first` ... but i
get:
Table 'first' was not locked with LOCK TABLES


what do i do wrong?

# die welt ist schnell geworden...

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



Re: [PHP-DB] nested sets?

2003-11-21 Thread ma
hi!

thx for the answer! in fact i'm just searching for a query to desend a
defined path in the structure, but left others alone. e.g.

path: about/company
structure:

about
company
history
today
employees
intern
extern
products
...

should end in

about
company
history
today
employees
products


i think of buying the book. its better to have a good reference.

thx -ma


# life would be easier if i knew the source code...

 Von: Cal Evans [EMAIL PROTECTED]
 Datum: Fri, 21 Nov 2003 11:24:52 -0600
 An: ma [EMAIL PROTECTED]
 Cc: PHP-DB [EMAIL PROTECTED]
 Betreff: Re: [PHP-DB] nested sets?
 
 Chapter 28 (or 29) in Joe Celko's SQL for Smarites. The chapter on
 nested sets alone is worth the price of the book.  At the very end of
 the chapter (after taking you through the details of a nested set) he
 gives a very simple and easy to implement solution for nested sets.
 
 Let me know how I may be of service,
 =C=
 * Cal Evans
 * http://www.eicc.com
 * We take care of your IT,
 * So you can take care of your business.
 *
 * I think inside the sphere.
 
 
 ma wrote:
 hi everybody!
 
 i try to make a clickable menu. it should be outputed as XML. i found a
 solution to make it possible to decend only the selected menues. but is
 there a easier solution?
 my goal is to first show only the first (level=0) level. if the user clicks
 on the menu it should select the second (level=1) level, but only from the
 menu he clicked. (so HAVING level=1 doesn't help :( )
 does anybody know a solution or a good reference for nested sets?
 (don't have the possibility to use pear - unfortunately cause there are some
 great tools)
 
 here's my db-structure:
 
 id (int) unsigned auto_increment
 left (int) unsigned
 right (int) unsigned
 level (int) unsigned (default: 0)
 title (varchar)
 link (varchar)
 menu (int) unsigned (default: 0)
 
 heres my solution (using singleton registry pattern and a sql-class working
 with adodb-functions):
 
 ###
 
 $reg = registry::instance();
 $sql = $reg::getEntry('sql');
 
 # $_GET['menu'] = 'About/Company/History' // - something like this
 
 $qry ='SELECT
 `first`.`left`,
 `first`.`id`,
 `first`.`link`,
 `first`.`title`,
 `first`.`level`,
 ROUND((`first`.`right`-`first`.`left`-1)/2) AS `children`
 FROM
 `'.$grz-cnf['tablePluginPrefix'].'menu` AS `first`,
 `'.$grz-cnf['tablePluginPrefix'].'menu` AS `second`
 ';
 $open = array();
 if(isset($_GET['menu'])) {
 $open = explode(';', $_GET['menu']);
 $or = join(' OR `third`.`id`=', $open);
 $qry .=',`'.$grz-cnf['tablePluginPrefix'].'menu` AS `third`
 WHERE
 (`first`.`left` BETWEEN `second`.`left` AND
 `second`.`right`
 AND `first`.`left` BETWEEN `third`.`left` AND
 `third`.`right`
 AND `first`.`level`=`third`.`level`+1
 AND (`third`.`id`='.$or.'))
 OR
 (`first`.`left` BETWEEN `second`.`left` AND
 `second`.`right`
 AND `first`.`level`=0)
 ';
 } else {
 $qry .='WHERE
 `first`.`left` BETWEEN `second`.`left` AND
 `second`.`right`
 AND `first`.`level`=0
 ';
 }
 $qry .='AND `first`.`menu`='.$menuID.'
 GROUP BY
 `first`.`left`
 ORDER BY
 `first`.`left`
 ';
 
 $res = $sql-query($qry);
 
 ###
 
 thx a lot for taking your time,
 help would be warmly appretiated...
 
 -ma
 
 # life would be easier if i knew the source code...
 
 
 -- 
 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] nested sets?

2003-11-20 Thread ma
hi everybody!

i try to make a clickable menu. it should be outputed as XML. i found a
solution to make it possible to decend only the selected menues. but is
there a easier solution?
my goal is to first show only the first (level=0) level. if the user clicks
on the menu it should select the second (level=1) level, but only from the
menu he clicked. (so HAVING level=1 doesn't help :( )
does anybody know a solution or a good reference for nested sets?
(don't have the possibility to use pear - unfortunately cause there are some
great tools)

here's my db-structure:

id (int) unsigned auto_increment
left (int) unsigned
right (int) unsigned
level (int) unsigned (default: 0)
title (varchar)
link (varchar)
menu (int) unsigned (default: 0)

heres my solution (using singleton registry pattern and a sql-class working
with adodb-functions):

###

$reg = registry::instance();
$sql = $reg::getEntry('sql');

# $_GET['menu'] = 'About/Company/History' // - something like this

$qry ='SELECT
`first`.`left`,
`first`.`id`,
`first`.`link`,
`first`.`title`,
`first`.`level`,
ROUND((`first`.`right`-`first`.`left`-1)/2) AS `children`
FROM
`'.$grz-cnf['tablePluginPrefix'].'menu` AS `first`,
`'.$grz-cnf['tablePluginPrefix'].'menu` AS `second`
';
$open = array();
if(isset($_GET['menu'])) {
$open = explode(';', $_GET['menu']);
$or = join(' OR `third`.`id`=', $open);
$qry .=',`'.$grz-cnf['tablePluginPrefix'].'menu` AS `third`
WHERE
(`first`.`left` BETWEEN `second`.`left` AND
`second`.`right`
AND `first`.`left` BETWEEN `third`.`left` AND
`third`.`right`
AND `first`.`level`=`third`.`level`+1
AND (`third`.`id`='.$or.'))
OR
(`first`.`left` BETWEEN `second`.`left` AND
`second`.`right`
AND `first`.`level`=0)
';
} else {
$qry .='WHERE
`first`.`left` BETWEEN `second`.`left` AND
`second`.`right`
AND `first`.`level`=0
';
}
$qry .='AND `first`.`menu`='.$menuID.'
GROUP BY
`first`.`left`
ORDER BY
`first`.`left`
';

$res = $sql-query($qry);

###

thx a lot for taking your time,
help would be warmly appretiated...

-ma

# life would be easier if i knew the source code...

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



Re: [PHP-DB] Select Value with 's

2003-11-05 Thread ma
hi!

do not quite understand your problem.. pls post some code?
heres a small snippet that should work well...

$qry = 'SELECT `customer` FROM `customerList` ORDER BY `customer`';
$res = mysql_query($qry);
while($customer = mysql_fetch_object($res)) {
echo stripslashes($res-customer).'br'.\n;
}

hth?

_ma

# life would be easier if i knew the source code...

 Von: Aleks @ USA.net [EMAIL PROTECTED]
 Datum: Wed, 5 Nov 2003 13:12:45 -0500
 An: [EMAIL PROTECTED]
 Betreff: [PHP-DB] Select Value with 's
 
 This is a basic question but I am all messed up and need to be straightened
 out..
 
 Have a select field called customer that works great except when there is a
 '  in the customer name.
 Have tried addslash and stripslashes but I think I might be using them
 wrong.
 
 If I addslash to the select value, the value received but the result page is
 truncated up to the point of
 the '   .
 
 Can someone refresh me on the correct use of add and strip slashes...
 please??
 
 Thanks
 
 Aleks
 

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



Re: [PHP-DB] Select Value with 's

2003-11-05 Thread ma
hi

think you should use ' when you create the query and  in the SQL-statement
for comparison:

$qry = 'SELECT *
FROM customer
WHERE customer.customer LIKE '.$FF.'';

_ma 

# life would be easier if i knew the source code...

 Von: Aleks @ USA.net [EMAIL PROTECTED]
 Datum: Wed, 5 Nov 2003 13:52:51 -0500
 An: 'CPT John W. Holmes' [EMAIL PROTECTED], 'ma'
 [EMAIL PROTECTED], 'PHP-DB' [EMAIL PROTECTED]
 Betreff: RE: [PHP-DB] Select Value with 's
 
 Thanks John for the answer But...
 
 Now my select statement on the Result.php page errors out when
 The value has the [']in it. What the select statement looks like now
 Is 
 
 Select *
 From customer
 Where customer.customer LIKE 'St Mary's Hospital'
 
 Error message is
 
 Warning mysql_fetch_array(): supplied argument is not a valid MySQL result
 
 
 
 
 
 -Original Message-
 From: CPT John W. Holmes [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, November 05, 2003 1:45 PM
 To: Aleks @ USA.net; 'ma'; 'PHP-DB'
 Subject: Re: [PHP-DB] Select Value with 's
 
 From: Aleks @ USA.net [EMAIL PROTECTED]
 First I build my select list:
 
 SELECT NAME=Cid size=1
 OPTION Selected VALUE=All Customers/OPTION
 
 ?
  While ($Site = mysql_fetch_array($S))  {
   $Sid = $Site[CID];
   $SName = htmlspecialchars($Site[Customer]);
   echo(option value='$SName'$SName/options\n);
 
 Easy fix: echo(option value=\$SName\$SName/options\n);
 
 Long version:
 
 htmlspecialchars() does not change single quotes unless you pass ENT_QUOTES
 as the second parameter. What you're ending up with is a value such as:
 
 value='St. Mary's'
 
 which, HTML will interpret as a value of St. Mary and an unknown s'
 attribute. So,
 
 $SName = htmlspecialchars($Site[Customer], ENT_QUOTES); echo(option
 value='$SName'$SName/options\n);
 
 will convert single quotes to HTML entities and not affect the value.
 
 The easy fix above works because it uses double quotes around the value
 and htmlspecialchars() already changes double quotes by default.
 
 ---John Holmes...
 

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



Re: [PHP-DB] Select Value with 's

2003-11-05 Thread ma
hi

ok - than make it this way:

$info = mysql_query( Select * From customer Where customer.customer LIKE St
Mary's Hospital);

anyways - shouldn't it be like this?:

$FF = St Mary's Hospital;
$info = mysql_query('Select * From customer Where customer.customer LIKE
'.$FF.'');

_ma

# life would be easier if i knew the source code...

 Von: Aleks @ USA.net [EMAIL PROTECTED]
 Datum: Wed, 5 Nov 2003 14:01:37 -0500
 An: 'ma' [EMAIL PROTECTED], 'PHP-DB' [EMAIL PROTECTED]
 Betreff: RE: [PHP-DB] Select Value with 's
 
 Sorry I left out the exact form
 
 It is
 
 $info = mysql_query( Select * From customer Where customer.customer LIKE 'St
 Mary's Hospital');
 
 
 
 -Original Message-
 From: ma [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, November 05, 2003 1:56 PM
 To: PHP-DB
 Subject: Re: [PHP-DB] Select Value with 's
 
 hi
 
 think you should use ' when you create the query and  in the SQL-statement
 for comparison:
 
 $qry = 'SELECT *
 FROM customer
 WHERE customer.customer LIKE '.$FF.'';
 
 _ma 
 
 # life would be easier if i knew the source code...
 
 Von: Aleks @ USA.net [EMAIL PROTECTED]
 Datum: Wed, 5 Nov 2003 13:52:51 -0500
 An: 'CPT John W. Holmes' [EMAIL PROTECTED], 'ma'
 [EMAIL PROTECTED], 'PHP-DB' [EMAIL PROTECTED]
 Betreff: RE: [PHP-DB] Select Value with 's
 
 Thanks John for the answer But...
 
 Now my select statement on the Result.php page errors out when The
 value has the [']in it. What the select statement looks like now
 Is
 
 Select *
 From customer
 Where customer.customer LIKE 'St Mary's Hospital'
 
 Error message is
 
 Warning mysql_fetch_array(): supplied argument is not a valid MySQL
 result
 
 
 
 
 
 -Original Message-
 From: CPT John W. Holmes [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, November 05, 2003 1:45 PM
 To: Aleks @ USA.net; 'ma'; 'PHP-DB'
 Subject: Re: [PHP-DB] Select Value with 's
 
 From: Aleks @ USA.net [EMAIL PROTECTED]
 First I build my select list:
 
 SELECT NAME=Cid size=1
 OPTION Selected VALUE=All Customers/OPTION
 
 ?
  While ($Site = mysql_fetch_array($S))  {
   $Sid = $Site[CID];
   $SName = htmlspecialchars($Site[Customer]);
   echo(option value='$SName'$SName/options\n);
 
 Easy fix: echo(option value=\$SName\$SName/options\n);
 
 Long version:
 
 htmlspecialchars() does not change single quotes unless you pass
 ENT_QUOTES as the second parameter. What you're ending up with is a value
 such as:
 
 value='St. Mary's'
 
 which, HTML will interpret as a value of St. Mary and an unknown s'
 attribute. So,
 
 $SName = htmlspecialchars($Site[Customer], ENT_QUOTES);
 echo(option value='$SName'$SName/options\n);
 
 will convert single quotes to HTML entities and not affect the value.
 
 The easy fix above works because it uses double quotes around the
 value and htmlspecialchars() already changes double quotes by default.
 
 ---John Holmes...
 
 
 --
 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] Select Value with 's

2003-11-05 Thread ma
hi

hm - it would help if you'd send us the code where you generate the query

_ma

# life would be easier if i knew the source code...

 Von: Aleks @ USA.net [EMAIL PROTECTED]
 Datum: Wed, 5 Nov 2003 14:23:06 -0500
 An: 'ma' [EMAIL PROTECTED], 'PHP-DB' [EMAIL PROTECTED]
 Betreff: RE: [PHP-DB] Select Value with 's
 
 Tried both... Still no joy...
 
 The statement becomes
 $info = mysql_query('Select * From customer Where customer.customer LIKE St
 Mary's Hospital');
 
 Maybe I need to be a little clearer... Seem that the sql statement is now
 getting the correct value
 But the extra ['] is confusing it
 
 
 -Original Message-
 From: ma [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, November 05, 2003 2:07 PM
 To: PHP-DB
 Subject: Re: [PHP-DB] Select Value with 's
 
 hi
 
 ok - than make it this way:
 
 $info = mysql_query( Select * From customer Where customer.customer LIKE St
 Mary's Hospital);
 
 anyways - shouldn't it be like this?:
 
 $FF = St Mary's Hospital;
 $info = mysql_query('Select * From customer Where customer.customer LIKE
 '.$FF.'');
 
 _ma
 
 # life would be easier if i knew the source code...
 
 Von: Aleks @ USA.net [EMAIL PROTECTED]
 Datum: Wed, 5 Nov 2003 14:01:37 -0500
 An: 'ma' [EMAIL PROTECTED], 'PHP-DB' [EMAIL PROTECTED]
 Betreff: RE: [PHP-DB] Select Value with 's
 
 Sorry I left out the exact form
 
 It is
 
 $info = mysql_query( Select * From customer Where customer.customer
 LIKE 'St Mary's Hospital');
 
 
 
 -Original Message-
 From: ma [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, November 05, 2003 1:56 PM
 To: PHP-DB
 Subject: Re: [PHP-DB] Select Value with 's
 
 hi
 
 think you should use ' when you create the query and  in the
 SQL-statement for comparison:
 
 $qry = 'SELECT *
 FROM customer
 WHERE customer.customer LIKE '.$FF.'';
 
 _ma
 
 # life would be easier if i knew the source code...
 
 Von: Aleks @ USA.net [EMAIL PROTECTED]
 Datum: Wed, 5 Nov 2003 13:52:51 -0500
 An: 'CPT John W. Holmes' [EMAIL PROTECTED], 'ma'
 [EMAIL PROTECTED], 'PHP-DB' [EMAIL PROTECTED]
 Betreff: RE: [PHP-DB] Select Value with 's
 
 Thanks John for the answer But...
 
 Now my select statement on the Result.php page errors out when The
 value has the [']in it. What the select statement looks like now
 Is
 
 Select *
 From customer
 Where customer.customer LIKE 'St Mary's Hospital'
 
 Error message is
 
 Warning mysql_fetch_array(): supplied argument is not a valid MySQL
 result
 
 
 
 
 
 -Original Message-
 From: CPT John W. Holmes [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, November 05, 2003 1:45 PM
 To: Aleks @ USA.net; 'ma'; 'PHP-DB'
 Subject: Re: [PHP-DB] Select Value with 's
 
 From: Aleks @ USA.net [EMAIL PROTECTED]
 First I build my select list:
 
 SELECT NAME=Cid size=1
 OPTION Selected VALUE=All Customers/OPTION
 
 ?
  While ($Site = mysql_fetch_array($S))  {
   $Sid = $Site[CID];
   $SName = htmlspecialchars($Site[Customer]);
   echo(option value='$SName'$SName/options\n);
 
 Easy fix: echo(option value=\$SName\$SName/options\n);
 
 Long version:
 
 htmlspecialchars() does not change single quotes unless you pass
 ENT_QUOTES as the second parameter. What you're ending up with is a
 value
 such as:
 
 value='St. Mary's'
 
 which, HTML will interpret as a value of St. Mary and an unknown s'
 attribute. So,
 
 $SName = htmlspecialchars($Site[Customer], ENT_QUOTES);
 echo(option value='$SName'$SName/options\n);
 
 will convert single quotes to HTML entities and not affect the value.
 
 The easy fix above works because it uses double quotes around the
 value and htmlspecialchars() already changes double quotes by default.
 
 ---John Holmes...
 
 
 --
 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
 
 -- 
 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] Unique user ID?

2003-09-06 Thread .ma
hi!

the only possibility i can think of is the following:
force the users to bookmark the site with a given id (as get-parameter).
once an id is used it is stored in a db or something else.

but this is _no_ proper solution!

ciao ma

 Von: John W. Holmes [EMAIL PROTECTED]
 Organisation: U.S. Army
 Antworten an: [EMAIL PROTECTED]
 Datum: Sat, 06 Sep 2003 09:05:42 -0400
 An: Floris [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Betreff: Re: [PHP-DB] Unique user ID?
 
 Floris wrote:
 
 Ehm, you could use the user's ip address, and hope it isn't a dynamic one.
 Or you'll just have to use a cookie.
 
 
 That's the problem i can't use a cookie. And everyone with a telephone like
 connection is the ip-adres dynamic. I can't use a cookie during privacy
 settings of most users.
 
 Then no, there's no way to identify a user when they return except for
 having them log in.
 
 -- 
 ---John Holmes...
 
 Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
 
 php|architect: The Magazine for PHP Professionals ­ www.phparch.com
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

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



[PHP-DB] Re: [PHP-INST] Installing PHP on LINUX with options other than standard

2003-07-13 Thread . ma
hi

there are many tutorials out there how to compile PHP under linux. to 
use these extensions you first have to install them on your computer. 
eg you have to install the gdlib for gd-support, the zlib for 
tlib-support, oracle-drivers for oci8-support and so on. just take a 
look at

http://at.php.net/manual/en/install.apache.php

(in this example apache is builded from source too - its possible that 
this is not required on your computer because it may be installed in 
the right configuration (with apxs))

hope this helps .ma

e: [EMAIL PROTECTED]
w: http://www.abendstille.at
# life would be easier if i knew the source code

Am Sonntag, 13.07.03 um 20:10 Uhr schrieb Jack van Zanen:

Hi,

Newbie to LINNUX and never compiled source code yet.

Can somebody give me the step by step instructions on how to 
make/compile
PHP on LINUX (or sent me URL where to find such)

On my windows I have the following dll's included:
php_gd.dll
php_oci8.dll
php_sockets.dll
php_zlib.dll
And that seems to suit my purpose. It needs to work with apache

TIA

Jack



--
PHP Install 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] phpMyAdmin-Problem

2003-07-10 Thread . ma
hi!

i have mysql 3.23.38 running on a IIS4 and php 4.3.2
i used phpmyadmin 2.3.2 with cookie authentication and everything 
worked well. until i wanted to upgrade phpmyadmin to 2.5.1 (last stable 
release).
i configured everything inside config.inc.php (added a controluser, 
etc) but now i cannot login anymore by cookie-authenticaion. i do not 
even get a wrong password or username-error
the phpmyadmin-faq contains this question:

 [1.3] I'm running phpMyAdmin with cookie authentication mode under 
PHP 4.2.0 or 4.2.1 loaded as an Apache 2+ module but can't enter the 
script: I'm always displayed the login screen.
This is a known PHP bug (see this bug report) from the official PHP bug 
database. It means there is and won't be any phpMyAdmin fix against it 
because there is no way to code a fix.

is this the same for php 4.3.2 and IIS4 ?

thx in advance .ma



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


Fwd: [PHP-DB] PHP, MySQL and Flash

2003-07-09 Thread . ma
hi!

flash offers some great actionscript-functions to work with php (or any 
other serversided language) over http

there is an object called LoadVars - i do not exactly know how to 
handle it within flash, but it can access php-scripts over http and 
send some post or get variables to it. in this script you can connect 
to the sql-db and update it using the information provided by the swf.

maybe there are ready drag'n'drop-components: 
http://www.macromedia.com/devnet/mx/flash/components.html
(specally http://www.macromedia.com/devnet/mx/flash/php.html)

or take a short look at http://www.flashkit.com (maybe you find some 
resources there)

hope this helps? .ma

Am Mittwoch, 09.07.03 um 14:36 Uhr schrieb Rankin, Randy:

Does anyone know of any articles on integrating PHP, MySQL and Flash to
perform a drag and drop routine for updating a db?
Specifically, I have a client who is _INSISTING_ that I integrate a 
drag and
drop feature into his railcar storage application. He wants to be able 
to
view two railcar storage tracks, Track A and Track B, then drag and 
drop
cars from Track A to Track B ( or Track B to Track A ). Once he 
positions (
orders ) all the cars properly on each track, I need to update a MySQL 
db to
reflect the changes.

I have already developed the above feature so that he can do this
'textually', but he is _determined_ that he must have the graphic 
'drag and
drop' feature.

There may be another method ( Javascript ? ) to accomplish the same 
effect.
I am certainly open to any advice and/or opinions. Any pointers would 
be
_greatly_ appreciated.

Thanks,

Randy Rankin




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


Fwd: [PHP-DB] Calculating Time

2003-06-16 Thread . ma
take a look at http://www.php.net/function.mktime

.ma

e: [EMAIL PROTECTED]
w: http://www.abendstille.at
# life would be easier if i knew the source code

Am Montag, 16.06.03 um 11:21 Uhr schrieb Delz:

Hi All,

How do I calculate time using php? Let's say I want to know the 
difference
between 12:30PM  13:30PM?
Hope someone can give me an idea?

Delz



--
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] setting session variables via a form

2003-06-16 Thread . ma
hi

maybe try the invers (anyways you havn't defined an action-attribute - 
maybe this is a problem?):

if(!isset($_SESSION['item_details']) || ( 
isset($_SESSION['item_details']  $_SESSION['item_details']) {
	echo		'form name=myForm method=post 
action='.basename($_SERVER['PHP_SELF']).''.
			'input  name=view_details type=hidden value=yes'.
			'input type=submit value=View Descriptions'.
			'/form';
else
	$_SESSION['item_details'] = 'yes';

hope i understood you right and this helps?

.ma

e: [EMAIL PROTECTED]
w: http://www.abendstille.at
# life would be easier if i knew the source code

Am Montag, 16.06.03 um 17:16 Uhr schrieb Becoming Digital:

Despite my best efforts, I can't seem to set session variables via a 
basic form.
I'm trying to use a button to alter display settings, which should be 
a simple
task, but apparently it is not.  Here's the code I'm working with.

?
if( (!isset( $_POST['view_details'] ))  ($_SESSION['item_details'] 
!= yes) )
{
print form method=\post\;
print input type=\button\ name=\view_details\ 
value=\View
Descriptions\ /;
print /form;
}
else
$_SESSION['item_details'] = yes;
?

My session I have tried a number of different solutions, including 
removing
session_start() from its calling function and various things I might 
otherwise
overlook.  I'm sure that I'm overlooking something easy but I can't 
figure out
what it is.  The session variable simply isn't being set, as confirmed 
by
printing its value (and by things not working!).  Thanks a lot for any 
and all
suggestions.

Edward Dudlik
Becoming Digital
www.becomingdigital.com


--
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] setting session variables via a form

2003-06-16 Thread . ma
hi!

i know that it sends everything to itself if you omitt the 
action-attribute, but it isn't propper html strict anymore... (ok - 
thats not a big problem *g*)

maybe it helps if you put the testing in a place of the script where 
there was no output yet (also no whitespaces)? at least this is a 
requirement for session_start(). probably similar things have to be 
considerd vor $_SESSION['foo'] = 'bar';

.ma

e: [EMAIL PROTECTED]
w: http://www.abendstille.at
# life would be easier if i knew the source code

Am Montag, 16.06.03 um 20:04 Uhr schrieb Becoming Digital:

maybe try the invers (anyways you havn't defined an action-attribute -
maybe this is a problem?):
Not declaring an action attribute automatically makes the form submit 
to itself.
When a URL query string is involved, this works much better than
$_SERVER['PHP_SELF'], which reduces the URL to its basic format.


'input  name=view_details type=hidden value=yes'.
'input type=submit value=View Descriptions'.
That helped, to a degree.  The submit button was key to getting the 
form to
register (hiding the button) but it's still not registering the session
variable.

Edward Dudlik
Becoming Digital
www.becomingdigital.com
- Original Message -
From: .ma [EMAIL PROTECTED]
To: PHP-DB [EMAIL PROTECTED]
Sent: Monday, 16 June, 2003 11:57
Subject: Re: [PHP-DB] setting session variables via a form
hi

maybe try the invers (anyways you havn't defined an action-attribute -
maybe this is a problem?):
if(!isset($_SESSION['item_details']) || (
isset($_SESSION['item_details']  $_SESSION['item_details']) {
echo 'form name=myForm method=post
action='.basename($_SERVER['PHP_SELF']).''.
'input  name=view_details type=hidden value=yes'.
'input type=submit value=View Descriptions'.
'/form';
else
$_SESSION['item_details'] = 'yes';
hope i understood you right and this helps?

.ma

e: [EMAIL PROTECTED]
w: http://www.abendstille.at
# life would be easier if i knew the source code

Am Montag, 16.06.03 um 17:16 Uhr schrieb Becoming Digital:

Despite my best efforts, I can't seem to set session variables via a
basic form.
I'm trying to use a button to alter display settings, which should be
a simple
task, but apparently it is not.  Here's the code I'm working with.
?
if( (!isset( $_POST['view_details'] ))  ($_SESSION['item_details']
!= yes) )
{
print form method=\post\;
print input type=\button\ name=\view_details\
value=\View
Descriptions\ /;
print /form;
}
else
$_SESSION['item_details'] = yes;
?
My session I have tried a number of different solutions, including
removing
session_start() from its calling function and various things I might
otherwise
overlook.  I'm sure that I'm overlooking something easy but I can't
figure out
what it is.  The session variable simply isn't being set, as confirmed
by
printing its value (and by things not working!).  Thanks a lot for any
and all
suggestions.
Edward Dudlik
Becoming Digital
www.becomingdigital.com


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


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


Re: [PHP-DB] Is it worth upgrading Mysql on linux?

2003-06-06 Thread . ma
hi!

if you upgrade i'd say upgrade to 4.1 which provides the IN()-method 
which allows komplex subselects. But may be this is not a very good 
idea cause 4.1 is only alpha afaik

.ma

e: [EMAIL PROTECTED]
w: http://www.abendstille.at

Life would be easier if i knew the source code.
@06.06.03 [21:31] Chris Payne wrote:

Hi there everyone,

I run a server from a great company which gives everything you need 
from $99 a month (450 gigs bandwidth, PHP, MySQL, SSL etc ...)

Anyway, I currently run one of the latest builds of PHP but MySQL is 
only version 3.23.56 (Or something similar) - does anyone see any 
advantages of upgrading to 4.0 ?   Will I need to recompile PHP to use 
MySQL 4?  This kind of thing is new to me (Linux as I used to use 
Windows).

Thanks for everything.

Chris


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


Re: [PHP-DB] How to find the last ID?

2003-06-06 Thread . ma
hi

you can easily do this by using

mysql_insert_id();

see
http://www.php.net/manual/en/function.mysql-insert-id.php
.ma

e: [EMAIL PROTECTED]
w: http://www.abendstille.at
/***/
life would be easier if i knew the source code.
Am Freitag, 06.06.03 um 23:16 Uhr schrieb Chris Payne:

Hi there everyone,

I'm creating a new entry using the following:

mysql_query (INSERT INTO agents (agent_name)
   VALUES ('$agentname')
but I need to find out the ID value it created, how can I do this 
easily?

Thanks

Chris




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


[PHP-DB] same connection to access two different database?

2002-01-29 Thread Vincent Ma

Hi everyone:

  is it possible to use one connect to access two database in postgreq,
because i would like to use subquery to do same search.  on the fly in
postgreq must faster a lot than evaluate in php code...

A, B belong to different database...
sql :  select * from A in ( select * B)

Vincent Ma



-- 
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] PostgreSql query help....

2001-11-19 Thread Vincent Ma

Hi everybody:

  I would like to ask why the error occur when retrieve current sequence
number.  Eg. select currval('student_id_seq') is not working, and warning
prompt student_id_seq.currval is not yet defined in this session.

However, this is work for the select nextval();

do anyone know how to get current sequence number, in php.  Thank for your
help

Vincent Ma



-- 
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-PostgreSQL] table field name case senstive problem

2001-11-13 Thread Vincent Ma

Hi everyone:

I found the problem when retrieve data from table or field which are
mix-case.  I means table or field name like accommdationType. contain
lower and upper case character.

For example:
Query select compID from table
after pg_exec()  -- select compid from table

Thus, I got error message said no attribute **compid***.  the field or
table become lower case.

 Is anyone know how to prevent pg_exec case conversion.  I guess may put
some special character around the field name.

Thank for any help

Vincent Ma



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