Re: [PHP-DB] Undefined variable

2004-05-26 Thread Viorel Dragomir
echo $_REQUEST['Name'];
  - Original Message - 
  From: Miguel Guirao 
  To: PHP DB List 
  Sent: Wednesday, May 26, 2004 17:47
  Subject: [PHP-DB] Undefined variable


  Hi!!
   
  I have a very simple and smail script with just one input text box and a
  submit button.
  After that, I have an echo function in the same code page that just
  displays the data entered in the text box.
   
  But I'm receiving an undefinied variable error when I execute it!!
   
  Echo ($Name);
   
  I'm using Windows 2000 Server and PHP for Windows.
   
  Regards,
   
  Miguel Guirao
  Servicios Datacard
  www.SIASA.com.mx
   


Re: [PHP-DB] Wrong table name - can it be fixed?

2004-05-17 Thread Viorel Dragomir
Use tablename from mysql command prompt.
Try to use it from phpmyadmin, but I don't know if it works..
And don't post emails with high priority anymore.

  - Original Message - 
  From: Martin E. Koss 
  To: [EMAIL PROTECTED] 
  Sent: Monday, May 17, 2004 11:48
  Subject: [PHP-DB] Wrong table name - can it be fixed?


  I've made a big boo boo when exporting from MS Access to MySql database.
  The table name was '16-05' which obviously is not a good name to have in
  MySql.
  I'm using PhpMyAdmin as I'm not very experienced with sorting out the
  databases any other way. Problem is that I can't access the properties
  of the table in order to rename it, whatever I try to do I get an error
  (which is obviously due to the type of name the table has).
   
  Is there any way I can fix this without getting too complicated?
   
  Cheers.
   
  Martin

  ---
  Outgoing mail is certified Virus Free.
  Checked by AVG anti-virus system (http://www.grisoft.com).
  Version: 6.0.684 / Virus Database: 446 - Release Date: 13/05/2004
   

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


Re: [PHP-DB] Page cannot be displayed problems

2004-04-29 Thread Viorel Dragomir
Nope.
An obsolete standard.

Try use GET or POST instead of PUT.

Cheers
  - Original Message - 
  From: Uzi 
  To: matthew perry ; [EMAIL PROTECTED] 
  Sent: Thursday, April 29, 2004 10:13
  Subject: Re: [PHP-DB] Page cannot be displayed problems


  form action=page2.php method=PUT ???
  is that a new standard?


  - Original Message - 
  From: matthew perry [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: Thursday, April 29, 2004 8:11 AM
  Subject: [PHP-DB] Page cannot be displayed problems


   My bosses computer gets a Page cannot be displayed message when she 
   uses some of my pages.  I have tried to find a pattern as to why this 
   happens on only her computer.  I think the problem only occurs when she 
   links to a page that links to a page.
   
   Say I have 3 pages: page1.php, page2.php, and page3.php
   
   On page1.php
   
   form action=page2.php method=PUT
   input type=submit value=GO
   /form   
   
   
   And on page2.php
   
   meta http-equiv=refresh content=0;URL=page3.php
   
   
   If I click go on page1.php I SOMETIMES get the cannot be displayed 
   message.  SOMETIMES it works even on her computer!
   
   Anyone know why?
   
   - Matthew Perry
   
   -- 
   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] Dynamic Graphing Software

2004-04-29 Thread Viorel Dragomir
jpgraph
:)
  - Original Message - 
  From: Rafi Sheikh 
  To: '[EMAIL PROTECTED]' 
  Sent: Thursday, April 29, 2004 16:18
  Subject: [PHP-DB] Dynamic Graphing Software


  Hi every one!  I am looking for recommendations for using software to
  produce dynamic graphs with a APM solution.  Any suggestions?

  -
  Rafi Sheikh


  This e-mail, including attachments, may include confidential and/or
  proprietary information, and may be used only by the person or entity to
  which it is addressed. If the reader of this e-mail is not the intended
  recipient or his or her authorized agent, the reader is hereby notified that
  any dissemination, distribution or copying of this e-mail is prohibited. If
  you have received this e-mail in error, please notify the sender by replying
  to this message and delete this e-mail immediately.

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


Re: [PHP-DB] URL Problem

2004-04-21 Thread Viorel Dragomir
Anyway first you have to translate your problem to us.
In plain english. 

But I have spare time, so.. here is the solution for your problem, as I understood it.

from php
?php
$f = file(http://myserver.com/index.asp?pid=;);
print_r($f);
?

In ASP you take the pid do what you want to it and then
%
Response.Write( myResult )
%

The myResult is what the php will be printing and the value you can use.

Use only one Response.Write in entire .asp



Have fun
:)
  - Original Message - 
  From: Chris Payne 
  To: [EMAIL PROTECTED] 
  Sent: Wednesday, April 21, 2004 7:33 PM
  Subject: [PHP-DB] URL Problem


  Hi there everyone,

   

  I have a problem.  Basically this is what I need to do:

   

  Request behind the scenes (PHP) an ASP Url on a different website with the
  value pid=1 (Where 1 is an identifying number).  Then I need PHP to
  listen to the response from that request as ASP will then return a value
  which PHP has to pickup, and I have ZERO idea how to do this :-(  I tried
  something which I though, but that gets the webpage and NOT the url that it
  passes back with its values.

   

  Any help would be greatly appreciated.

   

  So basically I need to request an URL from within PHP, PHP listens to and
  gets the reply URL that is sent back to it with the new value (Which is
  determined by the pid= value).

   

  Thank you everyone.

   

  Chris


  ---
  Outgoing mail is certified Virus Free.
  Checked by AVG anti-virus system (http://www.grisoft.com).
  Version: 6.0.662 / Virus Database: 425 - Release Date: 4/20/2004
   


Re: [PHP-DB] Large Arrays in a batch procedure

2004-04-07 Thread Viorel Dragomir
First it's not such a good idea to show 30k records to a browser.. If you use this 
script in console it's ok.
I don't think that the problems comes from the data size.. check your for.. maybe 
has an infinite loop.

Anyway if the problem comes from the data size you can find out by reading only 1k 
records.

good luck
  - Original Message - 
  From: antonio bernabei 
  To: [EMAIL PROTECTED] 
  Sent: Wednesday, April 07, 2004 11:22 AM
  Subject: [PHP-DB] Large Arrays in a batch procedure


  Hi,
  I have a problem. On a small lan I need to process a table with about 3
  records. The work is to apply a formula to some fields of each record and
  update another field of the same table.
  I run php on a win2000 professional system and the first approach was to
  make a for cycle in which I apply the formula to all records and echo the
  result of the formula, just to show that the work is going on.
  But I get into a timeout of the system after 30 seconds
  Which is the right approach to this type of work, let's call it batch work?
  Thank you
  Antonio Bernabei

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


Re: [PHP-DB] javascript question

2004-03-08 Thread Viorel Dragomir
alert('?=$message?');

// case sensitive

- Original Message - 
From: Gamze Baaran [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, March 08, 2004 4:09 PM
Subject: [PHP-DB] javascript question


When I use this it isn't work an there is error but  can't see it with
internet explorer. I can't catch it :(

Alert('?php echo $message; ?'); or
Alert('?php echo $message; ?');

-- 
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] Need help with MySQL query

2004-03-05 Thread Viorel Dragomir

- Original Message - 
From: Mikhail U. Petrov [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, March 05, 2004 11:38 AM
Subject: [PHP-DB] Need help with MySQL query


 Hi!
 I need help with simple mysql query.
 I have table:
 program{
 program_id,
 partner_id
 }
 partner{
 partner_id,
 parnter_name
 }
 how I can get number of distinct partner_id's where program_id in (
 bla bla bla)?

select distinct a.partner_id, a.partner_name
from partner a, program b
where a.partner_id = b.partner_id
and b.partner_id in (1, 2, 3)

 Best wishes,
 Mikhail U. Petrov.
 
 -- 
 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] Need help with MySQL query

2004-03-05 Thread Viorel Dragomir




 
 - Original Message - 
 From: Mikhail U. Petrov [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Friday, March 05, 2004 11:38 AM
 Subject: [PHP-DB] Need help with MySQL query
 
 
  Hi!
  I need help with simple mysql query.
  I have table:
  program{
  program_id,
  partner_id
  }
  partner{
  partner_id,
  parnter_name
  }
  how I can get number of distinct partner_id's where program_id in (
  bla bla bla)?
 
 select distinct a.partner_id, a.partner_name
 from partner a, program b
 where a.partner_id = b.partner_id
 and b.partner_id in (1, 2, 3) 

sorry for the last line...
and b.program_id in (1, 2, 3)

 
  Best wishes,
  Mikhail U. Petrov.
  
  -- 
  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] Two Column Sort

2004-03-04 Thread Viorel Dragomir
Check for NULL values.

- Original Message - 
From: Ford, Mike [LSS] [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Thursday, March 04, 2004 12:55 PM
Subject: RE: [PHP-DB] Two Column Sort


 On 03 March 2004 17:07, [EMAIL PROTECTED] wrote:

  I'm re-raising an issue I never quite resolved which has become more
  critical.  I want to sort a table on two columns.  There are
  about 440
  rows of which about 400 are blank in the first sort column (CBC); the
  other rows show B in that column.  When I use the coding
  below, the two
  column sort takes place but the rows designated B are at the
  bottom of the
  (long) table and I want them at the top.  Neither asc nor desc
  accomplishes this (just reverses the second factor order,
  still at the
  bottom below the blanks).
 
  Here's the php code for the sort command:
 
  echo tddiv align='center'font size='3'bCBC a
  href='contributions22504.php?sort_field=cbc,
  net_receiptssort_order=desc'
  target='_self'font size='2'Sort/a/b/font/div/td\n;
 
  Here's the basic setup that begins the script:
 
  # get sort order (if any) passed to script
  $sort_field = $_REQUEST['sort_field'];
  if (! $sort_field) {$sort_field = State;}
  $sort_order = $_REQUEST['sort_order'];
  if (! $sort_order) {$sort_order = asc;}

 Well, your going to need an order phrase that looks like this:

 ORDER BY CBC DESC, NET_RECEIPTS ASC

 so you may need a little rethink about how you're passing those arguments.

 Cheers!

 Mike

 -
 Mike Ford,  Electronic Information Services Adviser,
 Learning Support Services, Learning  Information Services,
 JG125, James Graham Building, Leeds Metropolitan University,
 Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
 Email: [EMAIL PROTECTED]
 Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211

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

2004-01-28 Thread Viorel Dragomir
Please do NOT open attachments files without having an Antivirus installed.
Like this guys did.

Sending emails with attachments to a list is not a common behaviour.
Thanks


- Original Message - 
From: David T-G [EMAIL PROTECTED]
To: PHP DB list [EMAIL PROTECTED]
Cc: Florian Habegger [EMAIL PROTECTED]
Sent: Wednesday, January 28, 2004 16:25
Subject: Re: [PHP-DB] test

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



Re: [PHP-DB] Problem with passing variables

2004-01-27 Thread Viorel Dragomir

- Original Message - 
From: Phil Matt [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, January 27, 2004 17:08
Subject: [PHP-DB] Problem with passing variables


 Hello to all.

 I am a relative newcomer to PHP. I am trying to pass the value of a
variable from a
 MySQL database from one PHP page to another PHP page. On the first page,
I've made
 the connection to the database, and the query works just fine, displaying
the correct
 values from the $myrow fields.

 This is the code to that point:

 ?
 $db = mysql_connect(ip address here,user here,password here) or die
(Unable to
 connect to SQL server);
 mysql_select_db(databasename,$db);
 ;
 $result= mysql_query(SELECT * FROM databasename WHERE ID20,$db);
 echo'table

thtrtdName/tdtdTitle/tdtdPhone/tdtdE-mail/td/tr/th';
 while ($myrow = mysql_fetch_row($result)){
 echo'tr
 td'. $myrow[0].'/td
 td'. $myrow[1].'/td
 td'. $myrow[2].'/td

 This works just fine. Then I try to pass the variable $myrow[0] to a
second page, where
 the value of the variable (a string that contains a name) is supposed to
appear. Here's
 the line of code:


*Maybe this will help. I'll presume the next statement is not included in a
print command
 tda href=email.php?recip=$myrow[0]img src=graphics/mail.gif
class=imglink

use ?recip=?=$myrow[0]?.


 alt=Click to send mail to this person //a/td/tr';


 The page receiving this variable, email.php, uses this to retrieve the
value of $myrow[0]:

 Send e-mail to ?php $recip=$_GET['recip']; echo $recip; ?


 However, all this manages to do is to print out this:

 Send e-mail to $myrow[0]

 Instead of the VALUE contained in the variable!

 What am I doing wrong?

 TIA --- Phil Matt






 -- 
 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] Results with ledger stripes?

2004-01-26 Thread Viorel Dragomir
Hi Dan,


 Hello all,

 I'm in the midst of creating an internet speed test system thingamabob for
 my website.  It's basically finished...but ugly as sin.  What I'd like to
do
 is have the results (an average of each domain tested) listed in a nice
 pretty table with alternating background colors, kinda like a ledger.  How
 on earth do I do this?

 Here's what I've got thus far:

 ?php
 echo Average speeds of each domain tested:br;
 $mongo = @mysql_query (SELECT
 substring_index(name,'.',-2),ROUND(AVG(speed),1) FROM `readings` GROUP BY
 substring_index(name,'.',-2) ORDER BY substring_index(name,'.',-2) ASC);
 echo tabletrtdDomain/tdtdAverage Speed/td/tr\n;
 while ($mongorow = mysql_fetch_array($mongo, MYSQL_NUM)) { echo
 trtd$mongorow[0]/tdtd$mongorow[1]/td/tr\n;}
 echo /table;
 ?

You must use a counter in while.
Let's change your code like:

$counter = 0;
while(){
// here actually is your while where I add this lines
$counter++;
$counter%=2;
if($counter)$bgcolor=red;
else$bgcolor=green;

// change in echo command:
echo tr bgcolor=$bgcolor
}

// I just hope u don't use red and green through :)


 And I'd like it to spit out something along these lines:
 table
 tr bgcolor=#ddtddomain1.com/tdtd666.6 kbps/td/tr
 tr bgcolor=#fftddomain2.com/tdtd3000.0 kbps/td/tr
 repeat until done
 /table

 The gizmo is up and running at
 http://www.dibcomputers.com/bandwidthmeter/index.php if you care to have a
 gander.
 Thanks a bunch,
 Dan








 -- 
 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] Results with ledger stripes?

2004-01-26 Thread Viorel Dragomir
This is the best contact description that I found so far on the net !

To contact Dan, the owner and lead technician, please email him at
[EMAIL PROTECTED] In case of dire emergency, crashed network, or other
pressing need you may also contact him 24 hours a day via cell phone at
xxx-xxx-xx. Please be nice, though, as he does like to sleep once in a
while! :)
http://www.dibcomputers.com/contact.html;


- Original Message - 
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, January 26, 2004 03:42
Subject: [PHP-DB] Results with ledger stripes?


 Hello all,

 I'm in the midst of creating an internet speed test system thingamabob for
 my website.  It's basically finished...but ugly as sin.  What I'd like to
do
 is have the results (an average of each domain tested) listed in a nice
 pretty table with alternating background colors, kinda like a ledger.  How
 on earth do I do this?

 Here's what I've got thus far:

 ?php
 echo Average speeds of each domain tested:br;
 $mongo = @mysql_query (SELECT
 substring_index(name,'.',-2),ROUND(AVG(speed),1) FROM `readings` GROUP BY
 substring_index(name,'.',-2) ORDER BY substring_index(name,'.',-2) ASC);
 echo tabletrtdDomain/tdtdAverage Speed/td/tr\n;
 while ($mongorow = mysql_fetch_array($mongo, MYSQL_NUM)) { echo
 trtd$mongorow[0]/tdtd$mongorow[1]/td/tr\n;}
 echo /table;
 ?

 And I'd like it to spit out something along these lines:
 table
 tr bgcolor=#ddtddomain1.com/tdtd666.6 kbps/td/tr
 tr bgcolor=#fftddomain2.com/tdtd3000.0 kbps/td/tr
 repeat until done
 /table

 The gizmo is up and running at
 http://www.dibcomputers.com/bandwidthmeter/index.php if you care to have a
 gander.
 Thanks a bunch,
 Dan








 -- 
 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] Windows 2003 Server

2004-01-19 Thread Viorel Dragomir
Nu cred ca te pot ajuta cu ceva.
:))

So why don't you use English?

- Original Message - 
From: Andrea Fenilxxx [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, January 19, 2004 13:08
Subject: Re: [PHP-DB] Windows 2003 Server


 Sto realizzando una pagina di invio mail per una mailing list.
 La mail parte regolarmente.
 Sul mio pc (Win Xp si vede bene, così come su molti altri pc)
 Qualcuno sa spiegarmi perchè, su alcuni windows ('98), invece dell'html mi
 genera una mail NON html (quindi si vede solo il codice... una
 schifezza!!!).
 Forse sbaglio charset=iso-8859???

 Sono stressato!
 $messaggio è una concatenazioni di header.$corpo.footer
 Il corpo è generato da una textarea
 ---


 ?php

 $oggetto=Newsletter 4winds - OFFERTE di VIAGGIO;
 $messaggio= '
  html
  head
   titleTitolo/title
  /head
  body
 Corpo header
 /body
  /html
  '
   .$corpo.

  '
  html
  head
  /head
  body
  Corpo footer
  /body
  /html
  ';

 // l'intestazione Content-type per inviare email in formato HTML
 $intestazioni  = MIME-Version: 1.0\r\n;
 $intestazioni .= Content-type: text/html; charset=iso-8859-1\r\n;

 // intestazioni addizionali - From
 $intestazioni .= gestore mailing list ;

 //destinatari
 $to =  - destinatari - ;

 mail($to, $oggetto, $messaggio, $intestazioni);

 ?

 -- 
 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] csv export...?

2004-01-09 Thread Viorel Dragomir
You didn't try to hard isn't it! :)
If you want to save a file as csv just save the vars like this
1,2,3
4,5,6
...
0,0,0

If you want to link a csv file for download put a
href='file.csv'download/a.
It's not so hard after all. :)

Or I didn't get your message.
Anyway, good luck!


- Original Message - 
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, January 09, 2004 17:35
Subject: [PHP-DB] csv export...?


 Google is not my friend today...
 I have a reportng tool on a database i have, and I want to be able to
 exort the selected results (I've saved the SQL query as a session variable
 for ease of use)
 and save that data as a csv file... with headers if possible...

 Now I have found loadsa sites that let me upload a csv file, but not the
 other way around...

 Anyone care to help?

 *
 The information contained in this e-mail message is intended only for
 the personal and confidential use of the recipient(s) named above.
 If the reader of this message is not the intended recipient or an agent
 responsible for delivering it to the intended recipient, you are hereby
 notified that you have received this document in error and that any
 review, dissemination, distribution, or copying of this message is
 strictly prohibited. If you have received this communication in error,
 please notify us immediately by e-mail, and delete the original message.
 ***



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



Re: [PHP-DB] csv export...?

2004-01-09 Thread Viorel Dragomir
It looks like is not so simple. But is not difficult at all..

Try to make something like:
?php

header(Content-type: text/csv);

$query = SELECT * FROM tables;
$result = mysql_query($query);
while($row = mysql_fetch_row($result)){
print implode(,, $row);
}
mysql_free_result($result);

?

Check if functions like implode has the correct arguments.
Anyway hopes it gives you a clue about what is going on.
Don't forget to connect to database first of all.




- Original Message - 
From: [EMAIL PROTECTED]
To: Viorel Dragomir [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Friday, January 09, 2004 17:52
Subject: Re: [PHP-DB] csv export...?


 Cheers for prompt reply...
 But.. what?
 I need to take an SQL query, and export teh results to a csv file...
 Are you really sure that simply pointing to a non existant csv file does
 that?
 I don't see it somehow...?

 I'm sorry if I'm wrong...




 Viorel Dragomir [EMAIL PROTECTED]
 09/01/2004 15:50

 To
 [EMAIL PROTECTED], [EMAIL PROTECTED]
 cc

 Subject
 Re: [PHP-DB] csv export...?






 You didn't try to hard isn't it! :)
 If you want to save a file as csv just save the vars like this
 1,2,3
 4,5,6
 ...
 0,0,0

 If you want to link a csv file for download put a
 href='file.csv'download/a.
 It's not so hard after all. :)

 Or I didn't get your message.
 Anyway, good luck!


 - Original Message - 
 From: [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Friday, January 09, 2004 17:35
 Subject: [PHP-DB] csv export...?


  Google is not my friend today...
  I have a reportng tool on a database i have, and I want to be able to
  exort the selected results (I've saved the SQL query as a session
 variable
  for ease of use)
  and save that data as a csv file... with headers if possible...
 
  Now I have found loadsa sites that let me upload a csv file, but not the
  other way around...
 
  Anyone care to help?
 
  *
  The information contained in this e-mail message is intended only for
  the personal and confidential use of the recipient(s) named above.
  If the reader of this message is not the intended recipient or an agent
  responsible for delivering it to the intended recipient, you are hereby
  notified that you have received this document in error and that any
  review, dissemination, distribution, or copying of this message is
  strictly prohibited. If you have received this communication in error,
  please notify us immediately by e-mail, and delete the original message.
  ***
 
 

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




 *
 The information contained in this e-mail message is intended only for
 the personal and confidential use of the recipient(s) named above.
 If the reader of this message is not the intended recipient or an agent
 responsible for delivering it to the intended recipient, you are hereby
 notified that you have received this document in error and that any
 review, dissemination, distribution, or copying of this message is
 strictly prohibited. If you have received this communication in error,
 please notify us immediately by e-mail, and delete the original message.
 ***



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



Re: [PHP-DB] Re: Sessions and MySQL?

2003-10-16 Thread Viorel Dragomir
I'm not sure that this code will work.
Try to use $_SESSION['..'] and (..). [Don't use the {, } for this purposes.


vio-
- Original Message - 
From: pete M [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, October 16, 2003 4:02 PM
Subject: [PHP-DB] Re: Sessions and MySQL?


 might seem a bit long winded but this is how I would code it

 $sql = INSERT INTO $table ( salutation, name, city} VALUES {
 $sql .= '.$_SESSION{'salutation'].', 
 $sql .= '.$_SESSION{'name'].', 
 $sql .= '.$_SESSION{'city'].' ) 

 mysql_query($sql);

 regards
 pete

mysql_query(INSERT INTO $table (
   salutation,
   name,
   city
   } VALUES {
   \$_SESSION['salutation'];\,
   \$_SESSION['name'];\,
   \$_SESSION['city'];\
   }
  


 Tristan Pretty wrote:

  Not sure if this is a MySQL Q. or a PHP one, but here goes...
 
  I'm just learning sessions...
  And I'm trying to add a session variable to a MySQL database.
  I've done this page that takes the results from a previous form...
  But I get this error:
  Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or
  `T_NUM_STRING'
  On line 83
  Which is the line that relates to the line:
  \$_SESSION['salutation'];\,
 
  I've tried removing the ';' but it change nothing...?
  Can anyone see my error?
 
  =
  ?
  session_start();
  header(Cache-control: private);
 
 $_SESSION['salutation'] = $_POST['salutation'];
 
  //MySQL connection stuff
  mysql_query(INSERT INTO $table (
  salutation,
  name,
  city
  } VALUES {
  \$_SESSION['salutation'];\,
  \$_SESSION['name'];\,
  \$_SESSION['city'];\
  }
 
  ?
  //Rest of page... thanks etc...
  =
 
  *
  The information contained in this e-mail message is intended only for
  the personal and confidential use of the recipient(s) named above.
  If the reader of this message is not the intended recipient or an agent
  responsible for delivering it to the intended recipient, you are hereby
  notified that you have received this document in error and that any
  review, dissemination, distribution, or copying of this message is
  strictly prohibited. If you have received this communication in error,
  please notify us immediately by e-mail, and delete the original message.
  ***
 
 

 -- 
 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] Photo Gallery Comments.. NOT WORKING

2003-09-25 Thread Viorel Dragomir
Hi,

I see that you try to use $result, which is a resource [i think], as a
normal string.
Try to use the fetch data instead of the resource.


vio-
- Original Message - 
From: Adam Symonds [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, September 23, 2003 9:14 AM
Subject: [PHP-DB] Photo Gallery Comments.. NOT WORKING


 Hi I have the following code which is a photo gallery, I have set it up so
 users
 can add comments to the photos, what I want to happen is in the gallery if
a
 user
 has posted a comment on the photo, I want it to say comments under the
photo
 in the gallery, I have tried doing this using  IN_ARRAY but I am getting
an
 error msg,

 Warning: in_array(): Wrong datatype for second argument
 on line 203

 line 203 is this: if(in_array($images[$i],$result))echo brfont
 class=blueComments/font;
 will have a play around with a few things and left yuo know if I suceed b4
 you get back.

 Can someone see what I am doing wrong with the in_array..

 Thanx In advance
 Adam

 ==

 ?PHP
 //start of comments selection...
$mysql_access = mysql_connect(localhost, username, password) or
 DIE(mysql_error());
mysql_select_db(database, $mysql_access) or DIE(mysql_error());
 $query = SELECT * FROM comphotolink WHERE comphotolink.PhotoPath =
 $PathVar;
$result = mysql_query($query, $mysql_access) or DIE(mysql_error());
 if ($result) {
 while ($r = mysql_fetch_array($result))
 { // Begin While
 extract($r);
 $PhotoName = $PhotoName;
 //echo $PhotoName br;
 } //End While
 } else {
 echo no commentsbrbr;
 }

 //end of comments selection

 //page vars
 $total = count($images);
 $limit = 15;
 $page = $_GET['page'];
 $num_prow=3;

 //$offset = ($page - 1) * $limit;

 //$jpgs=0;
 $handle=opendir($PathVar);
 $index=0;
 $images;
 $last_updated;

 while($file=readdir($handle)){

 if($file!='.'  $file!='..'){
 $myfile=explode(.,$file);

 if($myfile[1]=='jpg' || $myfile[1]=='JPG'){
 $images[$index]=$file;
 //$size[$index]=filesize($file);
 //$date[$index]=filemtime($file);
 $thumb[$index]=$file;
 $index++;
 $jpgs++;
 }
 }
 }

 if(!$images){
 print ::BWarning/b::brThis folder contains no allowed image
files.;
 exit;
 }

 $total=count($images);

 $numPages = ceil($total / $limit);


 $j=0;

 // Set first set of pictures
 if(!isset($pics)){$pics=$page * $limit;}

 //$pics = $page * $limit;


 $from = $pics-$limit;
 $pp = $pics+$limit;
 // =OUTPUT=

 $query2 = SELECT * FROM eventlistings WHERE PhotoPath = $PathVar;
$result2 = mysql_query($query2, $mysql_access) or DIE(mysql_error());
 if ($result2) {
 while ($r = mysql_fetch_array($result2))
 { // Begin While
 extract($r);
 echo ;
 }} //End While

 echo div align=centerstrong$EventName - $EventDate/strong br
 Directory contains a total of .count($images). image files /divBR;

 echo div align=centertable cellspacing=10 cellpadding=10
 bordercolor=#CC33CC border=1 class=txttr bordercolor=#00
 bgcolor=White;

 for($i = $from; $i  $pics  $i  $total; $i++){

 if($j == $num_prow){
 echo 
 tr bordercolor=#00 bgcolor=Whitetd align=center valign=topa
 href=\MainPhoto.php?Image=$thumb[$i]PhotoPath=$PathVar\
 !-- $images[$i]BRBR --
 img border=0 src=\$PathVar/thumb/$thumb[$i]\/a;
 if(in_array($images[$i],$result))echo brfont
 class=blueComments/font;
 echo /td;
 //
 $j = 1;

 }else{
 echo td align=center valign=topa

href=\MainPhoto.php?Image=$images[$i]PhotoPath=$PathVar\!--$images[$i]
 BRBR --img border=0 src=\$PathVar/thumb/$thumb[$i]\/a;
 //
 if(in_array($images[$i],$result))echo brfont
 class=blueComments/font;//

 $j++;

 }
 }
 echo /tr/tableBRBRBR;

 if ($page == 1) // this is the first page - there is no previous page
 echo Previous;
 else// not the first page, link to the previous page
 echo a href=\Gallery.php?PathVar=$PathVarpage= . ($page - 1)
.
 \ class=cssbtnPrevious/a;

 for ($i = 1; $i = $numPages; $i++) {
 echo  | ;
 if ($i == $page)
 echo $i;
 else
 echo a
href=\Gallery.php?PathVar=$PathVarpage=$i\$i/a;
 }

 if ($page == $numPages) // this is the last page - there is no next
page
 echo  | Next;
 else// not the last page, link to the next page
 echo  | a href=\Gallery.php?PathVar=$PathVarpage= . ($page +
1)
 . \ class=cssbtnNext/a;
 /*
 if($i  $total){echo a
 href=\.$PHP_SELF.?PathVar=$PathVarpage=$pp\Next/a;}
 if($page != $total){echo  a
 href=\.$PHP_SELF.?PathVar=$PathVarpage=$total\Last/a/div;}
 */
 echo brbr/body/html;

 closedir($handle);
 ?

 -- 
 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] Storing Session Variables

2003-09-24 Thread Viorel Dragomir
You don't have too worry about the overload of the server.
I presume that you don't have a genuine 486DX4 with 66Mhz.
The windows is lowsy on this machines. :


vio-
- Original Message - 
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, September 24, 2003 7:20 PM
Subject: Re: [PHP-DB] Storing Session Variables


  Get serious for a second here... Why not explain why you're asking this
  question? If you're going to store a huge amount of data in a session,
  explain why.

 OK. Today I'm working on a prototype GUI for a medical setting ( the
 production GUI will be done in C++, I believe). The GUI must keep track of
 a patient's name, prescriptions, and diagnoses, as well as things like
 what treatment room the patient will be seen in. Because different
 treatment rooms have different equipment, and so are used for different
 purposes, the user of the GUI will
 begin by selecting a treatment room, which pulls up from the DB all the
 patients scheduled for that room on that day. There are 6 treatment rooms,
 and if a user has navigated 3 or 4 steps into the GUI then decides to
 select a different treatment room ( and a different patient ), then
 everything gets reset.

 Most of these variables are getting stored as session variables so that
 the data persists as the user navigates further into the application.
 Including things like username, password, permissions, login flag,
 database, hostname, patientID, prescriptionID(s), diagnoses, treatment
 room, and several other variables, I'm using about 15 session variables.
 As I debug, I'm needing to sort through a growing number of variables to
 see what values have been stored in them. This is getting tedious because
 the list scrolls off the page. But as I develop more of the app, the need
 for more persisting variables has grown, and I guess I just had a moment
 of panic that I was gonna hit some limit of persisting variables.

 BTW, this GUI is for an intranet site, with perhaps 20 users max.

 You've been extremely helpful to me and many other listers here, John, and
 I did not mean to perturb you in any way by my initial question.


 David

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