[PHP] problem with my recursive function

2005-05-13 Thread p80
you can check it out there: 
http://www.hashmysql.org/paste/viewentry.php?id=249

also here it is:
/*I'm trying to display messages on my forum recursively, each message can 
have answers, the id of the parent post is in parentmessageid, the problem is 
that it only displays post that don't have answers ie post that have 
parentmessageid null*/
 /* here is my table: 
 ++---+-+ 
 | id | title | parentmessageid | 
 ++---+-+ 
 |  1 | a|NULL | 
 |  2 | b|NULL | 
 |  3 | repa  |  1 | 
 ++---+-+ 
 as an example I only get 1 and 2
 */

function DisplayThread($realparentid=) {
$sql=select id,title,parentmessageid from message where parentmessageid;
  if ( $realparentid !==  ) {
//Root message do not have the ParentMessageID set
 $sql.==$realparentid;
  } else
   $sql.= IS NULL;

  $sql.= ORDER BY id ASC;
$Reply = false; //Did we find any messages
$query=mysql_query($sql);
while($row=mysql_fetch_array($query)){
$Reply = true; //Found at least one message
$parentid=$row['0'];
$title =$row['1'];
$Result.=$titlebr /$sqlbr /$parentidbr /;
DisplayThread($parentid);
}

  //Clear the statement handle
  mysql_free_result($query);

  if ($Reply) {
//At least one message was processed
return $Result;
  } else
return ;
}

echo DisplayThread();

thx in advance

Pat

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



[PHP] problem with my recursive function

2005-05-13 Thread p80
I'm trying to display messages on my forum recursively, each message can 
have answers, the id of the parent post is in parentmessageid, the problem is 
that it only displays post that don't have answers ie post that have 
parentmessageid null
 /* here is my table: 
 ++---+-+ 
 | id | title | parentmessageid | 
 ++---+-+ 
 |  1 | a|NULL | 
 |  2 | b|NULL | 
 |  3 | repa  |  1 | 
 ++---+-+ 
 as an example I only get 1 and 2
 */

function DisplayThread($realparentid=) {
$sql=select id,title,parentmessageid from message where parentmessageid;
  if ( $realparentid !==  ) {
//Root message do not have the ParentMessageID set
 $sql.==$realparentid;
  } else
   $sql.= IS NULL;

  $sql.= ORDER BY id ASC;
$Reply = false; //Did we find any messages
$query=mysql_query($sql);
while($row=mysql_fetch_array($query)){
$Reply = true; //Found at least one message
$parentid=$row['0'];
$title =$row['1'];
$Result.=$titlebr /$sqlbr /$parentidbr /;
DisplayThread($parentid);
}

  //Clear the statement handle
  mysql_free_result($query);

  if ($Reply) {
//At least one message was processed
return $Result;
  } else
return ;
}

echo DisplayThread();

thx in advance

Pat
ps:you can check it out there: 
http://www.hashmysql.org/paste/viewentry.php?id=249

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



[PHP] noob need help for sessions

2005-04-06 Thread p80
I'm having problem with my session, when I login my session is registered ok but
when I click on another page it's canceled again.
I use that kind of link:
index.php?menu=voyage#038;sid=$sess_id

then on top of the page I use:


if(session_id()){

session_id(strip_tags($_GET['sid']));
session_start();
 $sess_id = session_id();
 $nom_user = $_SESSION['session_nom'];
 $prenom_user = $_SESSION['session_prenom'];
$bienvenue=Bienvenue $prenom_user $nom_user;
}

 http://81.57.4.105/~pat/alliance/  (user and pass = admin) can someone tell me
how when I click on the top boxes link the session is not kept? here is the
code: http://hashphp.org/pastebin?pid=2354

thanx in advance

Pat

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



[PHP] (noob) listing folder content

2005-04-03 Thread p80
I have a folder let's call it /rep and would like to list all files in it 
and for each file $f I would like to check if $f == $some_value and if it 
does echo $f any idea how to do that?

thanx in advance

Pat

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



[PHP] inserting arabic into mysql

2005-03-13 Thread p80
I have a text area form and when I insert it into mysql I get letters like 
this:
 
 
...
instead of arabic letters. anything I know do to get it right?

thanx in advance


[PHP] newbie php/mysql need help

2005-03-13 Thread p80

I do a mysql request like this one:

SELECT DISTINCT (brand), COUNT( brand )FROM `machines` where category like 
'sold' group by brand

I get this from mysql:
brand COUNT( brand)
brandx4
brandy12

how can I echo this result in php?

thanx in advance

Pat

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



Re: [PHP] free php live chat with visitor/customer script

2005-03-11 Thread p80
For those of you who might be interested I found this 
http://www.craftysyntax.com/ , it's GPL and it looks pretty updated.

the web page says:

A multi-user, multi-operator, multi-department live help support chat system 
that allows the operators of the websites to monitor their visitors as they 
are browsing the site and proactively open a chat session with the visitor. 
Is in PHP and uses either Mysql or Text based database . Other features 
include AUTO INVITE!, referer tracking, page tracking, chat notification, 
user is typing message, multiple chat sessions, sound alert, leave a message 
if offline, push urls, quick responses, Customizable graphics, and multiple 
operators. runs on your server and is open source GPL. 

cheers

Pat

On Friday 11 March 2005 01:17 am, p80 wrote:
 I was recently visiting a commercial site and suddunly a window chat popped
 up and some assistant asked me if I needed some help. I thought this was
 pretty cool and I was wondering if such a thing existed in php, i know
 there are lots of php live chat script out there but I'm not sure if they
 allow to monitor visitors on your webpage and launch a window chat to the
 visitor of your choice. does anyone know of such a thing in PHP? I think
 the application on that site I visited was a java applet.

 thanx in advance

 Pat

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



[PHP] free php live chat with visitor/customer script

2005-03-10 Thread p80
I was recently visiting a commercial site and suddunly a window chat popped up 
and some assistant asked me if I needed some help. I thought this was pretty 
cool and I was wondering if such a thing existed in php, i know there are 
lots of php live chat script out there but I'm not sure if they allow to 
monitor visitors on your webpage and launch a window chat to the visitor of 
your choice. does anyone know of such a thing in PHP? I think the application 
on that site I visited was a java applet.

thanx in advance

Pat

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



[PHP] [noob] can't submit simple form, need help

2005-03-03 Thread p80
any idea why this simple peace of code is not working?

http://hashphp.org/pastebin?pid=1880

thanx in advance

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



[PHP] upload and resize image script

2005-03-03 Thread p80
hey all
I'm looking for a simple script that would upload an image and resize it to 
thumbnail using a form to upload the picture. anyone has a good script for 
that?

thanx in advance

Pat

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



[PHP] sharing info between websites with XML?

2004-12-12 Thread p80
I have several website that use mysql as a database and I would like them to 
access each other DB. The problem is that I can't connect to each other mysql 
DB so I'm looking for a way to do so. I'm thinking of droping the mysql 
database in xml files that could be parse using php xml parser but I'm not 
sure if this is the best way to do it (sharing db's content). If it's the 
best way to do it tips would be welcome :) and if it's not the best way to do 
it could u please tell me what's the right way?

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



Re: [PHP] sharing info between websites with XML?

2004-12-12 Thread p80
On Sunday 12 December 2004 05:15 pm, Jason Wong wrote:
 On Sunday 12 December 2004 22:33, p80 wrote:
   eg do you want to only make available
   specific pre-defined bits of data to client websites,
 
  yes this is how I'd like to proceed

 OK, if there are only a limited number of these pre-defined bits of data
 then the easiest way is probably just output it as plain text (you don't
 say what kind of data you're sharing) in an easy to parse format (CSV, XML,
 whatever you're comfortable with).
and in case i need it what if it's not pre-defined bits of data, how shoud 
it be handle?

thanx in advance

PAt

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



Re: [PHP] sharing info between websites with XML?

2004-12-12 Thread p80
On Sunday 12 December 2004 03:16 pm, Jason Wong wrote:
 On Sunday 12 December 2004 21:35, p80 wrote:
  I have several website that use mysql as a database and I would like them
  to access each other DB. The problem is that I can't connect to each
  other mysql DB so I'm looking for a way to do so. I'm thinking of droping
  the mysql database in xml files that could be parse using php xml parser
  but I'm not sure if this is the best way to do it (sharing db's content).
  If it's the best way to do it tips would be welcome :) and if it's not
  the best way to do it could u please tell me what's the right way?

 eg do you want to only make available
 specific pre-defined bits of data to client websites,
yes this is how I'd like to proceed
 does the client 
 website have any need to change the data
no it doesn't need to change it, only access it.

 does the data have to be 
 encrypted whilst in transit
I'm not sure about this yet. I know XML is pretty unsecure when it's not 
encrypted as it's only text. does php provide functions to ecrypt XML while 
on transit or should I use other technics than XML?

 are all the websites under your control (more 
 specifically can they be trusted), etc.
yes they can be trusted as they are partenairs but they are not all under my 
control

thanx in advance

Pat

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


Re: [PHP] sharing info between websites with XML?

2004-12-12 Thread p80
 I have several website that use mysql as a database and I would like them
to access each other DB. The problem is that I can't connect to each other
mysql
 DB so I'm looking for a way to do so.

Why aren't you able to connect to the other databases?
cause hosters forbid it.

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


Re: [PHP] PHP Working With Excel File ?

2004-11-03 Thread p80
With excel, export your exel file to CSV (by doing save as...) then you can 
import your CSV file to mysql using the phpmyadmin import interface


On Tuesday 02 November 2004 04:11 am, Sejati Opreker wrote:
 Yes, I'm planning to work with MySQL, but the problem
 accour from the first time, 'cause the source is in
 Excel file, is MySQL able to read the CVS format ?,
 and can you please show me some PHP script that make
 outputs the contents of report to a CSV from MySQL ?

 --- Ben Ramsey [EMAIL PROTECTED] wrote:
  Matt M. wrote:
  Can PHP work with Excel files as database ?
  If not, how can I conver it to MySQL format and
  reconvert it to Excel 'coz I need it to report it
  in Excel format,
  
   if you are on windows you could use a com object.
  
   if you have access to perl, you could use

 http://search.cpan.org/~kwitknr/Spreadsheet-ParseExcel-0.2603/ParseExcel.pm

  You could also just use the MySQL database and have
  a PHP script that
  outputs the contents of your report to a CSV
  (comma-separated value)
  file with an extension of .csv. Excel will
  automatically open these
  files without problem.
 
  --
  Ben Ramsey
  Zend Certified Engineer
  http://benramsey.com
 
  ---
  Atlanta PHP - http://www.atlphp.org/
  The Southeast's premier PHP community.
  ---
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php

 __
 Do you Yahoo!?
 Check out the new Yahoo! Front Page.
 www.yahoo.com

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



Re: [PHP] PHP Working With Excel File ?

2004-10-31 Thread p80
On Monday 01 November 2004 02:58 am, Sejati Opreker wrote:
 Hi,
 Can PHP work with Excel files as database ?
 If not, how can I conver it to MySQL format and
 reconvert it to Excel 'coz I need it to report it
 in Excel format,

With exel, export your exel file to CSV (by doing save as...) then you can 
import your CSV file to mysql using the phpmyadmin import interface.

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



Re: [PHP] PHP Working With Excel File ?

2004-10-31 Thread p80
On Monday 01 November 2004 02:58 am, Sejati Opreker wrote:
 Hi,
 Can PHP work with Excel files as database ?
 If not, how can I conver it to MySQL format and
 reconvert it to Excel 'coz I need it to report it
 in Excel format,
 Thx

With exel, export your exel file to CSV (by doing save as...) then you can 
import your CSV file to mysql using the phpmyadmin import interface.

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



[PHP] need advice on an i18n english to arabic function

2004-06-02 Thread p80
I have a website in English, it is translated in many languages already 
(Spanish, french, German...), and i wanna translate it in Arabic, everytime i 
have a word in English i use a function like this i18n(MyEnglishWord) and the 
i18n function look up in an arabic.inc that contains a list of English words 
translated in Arabic such as:
$this = ;
$house =;

etc...

that works Ok but the problem is that Arabic reads from right to left so i 
need to redo my php and html code. is there a way to do this easily or is 
there any method I should know of to ease my task?

thanx in advance

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



[PHP] writing meta information into png

2004-03-07 Thread p80
is there a class or a function that makes it possible to write meta
information into a png or jpeg image?

any suggestion?

thanx in advance

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