Re: [PHP-DB] some data output formatting and grouping question...

2002-12-02 Thread David Smith
I don't see an easy way to do this in one SQL statement. But, the
following PHP does the trick for me (assuming MySQL):

// get the list of Y values
$r = mysql_query( "SELECT * FROM table GROUP BY Y" );
while( $y_val = mysql_fetch_array( $r ) )
$y_vals[] = $y_val['Y'];

// For each Y, fetch the Xs from the table
foreach( $y_vals as $y )
{
echo "$y";
// get all the Xs for this Y
$r = mysql_query( "SELECT * FROM table WHERE Y='$y'" );
while( $row = mysql_fetch_array( $r ) )
echo $row['X'] . "";
}

Let us know if this works.

--Dave

On Mon, 2002-12-02 at 00:53, Victor wrote:

> Consider the following table:
> 
> U | X | Y 
> --|---|--
> me|001|0a
> me|002|0a
> me|003|0a
> me|002|0b
> me|003|0b
> me|004|0b
> ..|...|..
> 
> then the code says:
> 
> SELECT * FROM Y WHERE U = me
> 
> So now what?
> - remember I do not know the value of Y, so it has to be an automatic
> thing; I can't just say ... WHERE U = me AND Y = a.
> 
> I want this output:
> 
> 0a
> 001
> 002
> 003
> ___ ()
> 
> 0b
> 002
> 003
> 004 
> 
> How the hell do I do that? I can't think of the goddamn' syntax!
> 
> __ 
> 
> Post your free ad now! http://personals.yahoo.ca
> 
> 
> -- 
> 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] some data output formatting and grouping question...

2002-12-02 Thread Snijders, Mark
I think you should first make a new datamodel, cause if I see this, it isn't
right

(just my 2 cents)

:-)


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




[PHP-DB] ODBC error...please help

2002-12-02 Thread Radim Klasek
Does anybody know, what does it mean:

SQL error: [Microsoft][ODBC Visual FoxPro Driver]File 'datum_format.prg' does not 
exist., SQL state S0002 in SQLExecDirect 

I'm using DATUM_FORMAT function in SQL command and this error is shown.

Thank you, Radim



Re: [PHP-DB] some data output formatting and grouping question...

2002-12-02 Thread Ignatius Reilly
Very simple procedurally (though not in SQL).

Here's the pseudo-code:

Execute:
SELECT * FROM Y WHERE U = 'me'
ORDER BY Y, X

$flag  = "last_y" ; // flag indicating whether or not your
mysql_fetch_array() brings a new value of Y
Loop your query result {
if Y <> $flag['last_y'] {
// this is a new value of Y: trigger a HTML header row
// update $flag['last_y'] = Y
}
// generate the normal HTML row
}

HTH
Ignatius

- Original Message -
From: "Victor" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, December 02, 2002 8:53 AM
Subject: [PHP-DB] some data output formatting and grouping question...


> I just have a fucking mental block; I cannot at all conceive the
> necessary syntax to or even the theoretical algorithm that I need, to do
> the following:
>
> Consider the following table:
>
> U | X | Y
> --|---|--
> me|001|0a
> me|002|0a
> me|003|0a
> me|002|0b
> me|003|0b
> me|004|0b
> ..|...|..
>
> then the code says:
>
> SELECT * FROM Y WHERE U = me
>
> So now what?
> - remember I do not know the value of Y, so it has to be an automatic
> thing; I can't just say ... WHERE U = me AND Y = a.
>
> I want this output:
>
> 0a
> 001
> 002
> 003
> ___ ()
>
> 0b
> 002
> 003
> 004
>
> How the hell do I do that? I can't think of the goddamn' syntax!
>
> __
> Post your free ad now! http://personals.yahoo.ca
>
> --
> 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] mysql - enum

2002-12-02 Thread Bastian Vogt
Hi,

is it possible to get all possible values of an enum-field from a
mysql-table in php?
The values might be changed in the database. Now I've got an
select-field in my php-app where the user can select each value of the
enum-field for a new record befor saving...

Thanks for any reply,
Bastian


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




Re: [PHP-DB] mysql - enum

2002-12-02 Thread Ignatius Reilly
DESCRIBE tbl_name col_name 

Ignatius

- Original Message - 
From: "Bastian Vogt" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, December 02, 2002 1:41 PM
Subject: [PHP-DB] mysql - enum


> Hi,
> 
> is it possible to get all possible values of an enum-field from a
> mysql-table in php?
> The values might be changed in the database. Now I've got an
> select-field in my php-app where the user can select each value of the
> enum-field for a new record befor saving...
> 
> Thanks for any reply,
> Bastian
> 
> 
> -- 
> 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] php session

2002-12-02 Thread Ford, Mike [LSS]
> -Original Message-
> From: Chris Barnes [mailto:[EMAIL PROTECTED]]
> Sent: 02 December 2002 02:14
> 
> On Mon, 2002-12-02 at 02:43, John W. Holmes wrote:
> > 
> > No, it shouldn't.
> > 
> > So, the links are correct on one page, and they disappear 
> on the second
> > page? Is there a reason you're passing the SID in the URL 
> and not using
> > cookies? 
> > 
> > Hmmm, found this in the manual. Maybe it applies?
> > 
> > ---
> > The constant SID can also be used to retrieve the current name and
> > session id as a string suitable for adding to URLs. Note that SID is
> > only defined if the client didn't sent the right cookie. See also
> > Session handling. 
> > ---
> > 
> > You may have to call session_id() with the passed value of
> > $_GET['PHPSESSID'] so that PHP knows what session to restart. 
> > 
> > ---John Holmes...
> > 
> 
> The reason I'm not using cookies is because i don't really know enough
> about them yet (i don't really know enough about sessions 
> either :p). Do
> you think it would be better for me to generate my own unique 
> number and
> set that in the cookie? Will i have to keep calling 
> SetCookie() on every
> page?
> 
> One thing i should have mentioned in my previous email, even though it
> isn't that relevant i don't think, is that if i omit the SID constant
> from the URL string then PHP automatically appends the SID to the URL
> its self, but again it disappears after a link has been clicked.

All of the evidence you have presented, and especially this, suggests that
PHP is automatically using cookies to store the SID.  When this is the case,
you see the SID on the first page served by PHP (because it hasn't set the
cookie yet!), but on all subsequent pages it disappears and the SID is
propagated using a cookie.  You *can* configure this to work differently,
but, speaking purely personally, I don't see the point.

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-DB] Max execution time

2002-12-02 Thread Radovan Radic
Hi all

(I post questions although i dont get answers, but i am trying. I must say i
dont give answers because i dont know much about php yet)

I have problems with script exceedded time. Script is executing mssql stored
procedure which executes about 5-6 mins. I need to execute it and then get
results in the file, but i allways get error about max execution time.
Customers wouldnt complain if script is executing too long if they could get
the results. I know i can set max.execution.time from php with ini_set().
But, i think i have read in the manual, that this directive doesnt affect
script execution time if script is running query. So even if i set
max_execution_time to 6mins could the script break? Could someone explain it
to me.

Radovan
PS. What means PHP?




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




RE: [PHP-DB] Max execution time

2002-12-02 Thread Ryan Jameson (USA)
I'd use this:

set_time_limit (3600);

<>< Ryan

-Original Message-
From: Radovan Radic [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 02, 2002 8:42 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Max execution time


Hi all

(I post questions although i dont get answers, but i am trying. I must say i
dont give answers because i dont know much about php yet)

I have problems with script exceedded time. Script is executing mssql stored
procedure which executes about 5-6 mins. I need to execute it and then get
results in the file, but i allways get error about max execution time.
Customers wouldnt complain if script is executing too long if they could get
the results. I know i can set max.execution.time from php with ini_set().
But, i think i have read in the manual, that this directive doesnt affect
script execution time if script is running query. So even if i set
max_execution_time to 6mins could the script break? Could someone explain it
to me.

Radovan
PS. What means 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] Max execution time

2002-12-02 Thread Radovan Radic
Thx for the quick response, i ll see if that helps me

"Ryan Jameson" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
I'd use this:

set_time_limit (3600);

<>< Ryan

-Original Message-
From: Radovan Radic [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 02, 2002 8:42 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Max execution time


Hi all

(I post questions although i dont get answers, but i am trying. I must say i
dont give answers because i dont know much about php yet)

I have problems with script exceedded time. Script is executing mssql stored
procedure which executes about 5-6 mins. I need to execute it and then get
results in the file, but i allways get error about max execution time.
Customers wouldnt complain if script is executing too long if they could get
the results. I know i can set max.execution.time from php with ini_set().
But, i think i have read in the manual, that this directive doesnt affect
script execution time if script is running query. So even if i set
max_execution_time to 6mins could the script break? Could someone explain it
to me.

Radovan
PS. What means 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] Max execution time

2002-12-02 Thread Radovan Radic
another one:
Is there some kind of explorer timeout for scripts that execute too long?

Radovan

"Ryan Jameson" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
I'd use this:

set_time_limit (3600);

<>< Ryan

-Original Message-
From: Radovan Radic [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 02, 2002 8:42 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Max execution time


Hi all

(I post questions although i dont get answers, but i am trying. I must say i
dont give answers because i dont know much about php yet)

I have problems with script exceedded time. Script is executing mssql stored
procedure which executes about 5-6 mins. I need to execute it and then get
results in the file, but i allways get error about max execution time.
Customers wouldnt complain if script is executing too long if they could get
the results. I know i can set max.execution.time from php with ini_set().
But, i think i have read in the manual, that this directive doesnt affect
script execution time if script is running query. So even if i set
max_execution_time to 6mins could the script break? Could someone explain it
to me.

Radovan
PS. What means 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] Re: Max execution time

2002-12-02 Thread Mike Mannakee
PHP meant Personal Home Page to the guy who originated it.  Later people
then decided to get cute and have redefined it to mean Php Hypertext
Preprocessor.  Take your pick.

As for the max execution time, you're fine as long as the script completes
what it's doing within the allotted time.  If your query takes longer, then
you're hosed, so the best bet is to set the max execution for long enough
that you're in no danger, like 10 minutes.

HTH

Mike


"Radovan Radic" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi all
>
> (I post questions although i dont get answers, but i am trying. I must say
i
> dont give answers because i dont know much about php yet)
>
> I have problems with script exceedded time. Script is executing mssql
stored
> procedure which executes about 5-6 mins. I need to execute it and then get
> results in the file, but i allways get error about max execution time.
> Customers wouldnt complain if script is executing too long if they could
get
> the results. I know i can set max.execution.time from php with ini_set().
> But, i think i have read in the manual, that this directive doesnt affect
> script execution time if script is running query. So even if i set
> max_execution_time to 6mins could the script break? Could someone explain
it
> to me.
>
> Radovan
> PS. What means PHP?
>
>
>



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




[PHP-DB] Refining my search app..

2002-12-02 Thread Ryan Christensen
Here's the skinny:

I'm starting development on a small search application & need some input
on a small roadblock I've run into..

What I need:

 - Script needs to be able to search database for matching queries in a
specified column. (Ex: from a dropdown list the user selects "foo" and
types in "bar" for a query.. we need to return all results matching
"bar" from the "foo" column.) Pretty basic, with the exception of the
second part:

 - Depending on the column-to-search they select from the drop-down
list, I need to change the structure of the query. This is needed
because SOME queries will need to be structured to select all records
from a column greater than / less than (insert number here) as opposed
to a standard select * where 'x' like '%y%' type query.

I would LIKE to keep the code relatively clean & don't want to flood it
with tons of "if" statements if at all possible.. which is why I'm
asking for your help. Any thoughts on a simple way to accomplish this?..
anyone tried something of this nature before?

Thank you in advance! Please let me know if you need additional detail..

Ryan


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




Re: [PHP-DB] Refining my search app..

2002-12-02 Thread Adam Voigt




A little cleaner:



switch($_POST[column])

{

case("foo"):$query = mysql_query("WHATVER");break;

case("too"):$query = mysql_query("BLAH");break;

default:$query = mysql_query("DOH");break;

}



while($row = mysql_fetch_array($query))

{

// DO SOMETHING

}





-- 
Adam Voigt ([EMAIL PROTECTED])
The Cryptocomm Group
My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc








signature.asc
Description: This is a digitally signed message part


[PHP-DB] Fulltext matching

2002-12-02 Thread Peter Beckman
Is there any way in PHP and MySQL to find out the most used words in a full
text index?  Is there access to the index?  In the index I want to show the
words that occur the most in descending order limit 50.

In addition, is there any way to search for, without boolean (using
3.23.??), words in a row?  I've tried searching for "print pal" (which I
know exists) but only get print and pal returned as two separate words, and
since pal is 3 letters or less, it isn't indexed.

This doesn't work:

select id, match(body) against ('"print pal"') from body where match(body) against 
('"print pal"');

Peter
---
Peter Beckman  Internet Guy
[EMAIL PROTECTED] http://www.purplecow.com/
---

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




[PHP-DB] Call to undefined function: dbmopen()

2002-12-02 Thread vernon
I'm getting the "Fatal error: Call to undefined function: dbmopen()" error
after defining a path and calling the dbmopen() funtion in the following
code:

function getcoor($zip){
$path = "/home/penpals/pub/cgi-bin/zipdb.db";
$dbm = dbmopen("$path", "r");

Does php have to be compiled with something in order for this to work?

Thanks



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




Re: [PHP-DB] mysql - enum

2002-12-02 Thread Ruth Zhai
This is what I use:

SHOW COLUMNS FROM table LIKE "field"

I use the query result for a select field in HTML table.
Ruth
- Original Message - 
From: "Bastian Vogt" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, December 02, 2002 11:41 PM
Subject: [PHP-DB] mysql - enum


> Hi,
> 
> is it possible to get all possible values of an enum-field from a
> mysql-table in php?
> The values might be changed in the database. Now I've got an
> select-field in my php-app where the user can select each value of the
> enum-field for a new record befor saving...
> 
> Thanks for any reply,
> Bastian
> 
> 
> -- 
> 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] Parse Error...

2002-12-02 Thread Chase
When trying to execute the following script to send the contents of a table
via "mail()" I am getting this error...

Parse error: parse error, unexpected T_STRING in FILENAME.PHP on line 36

The portion of this code inside the HTML tags works great for displaying the
table on the screen, but when I include it in the larger script for sending
a mail message, I get this error.

I am sure that it is something simple that I have been too stupid to catch,
but any help would be great!

Chase


Code Follows  --->



" . ", " ;
$to .= "Chase <[EMAIL PROTECTED]>";

$subject = "Price File Access History";

$message = '

Price File Access





  Date / Time


  Logged IP Address


  Logged Username



$link = mysql_connect("$server", "$user", "$pass");
mysql_select_db("$db", $link);

$result = mysql_query("SELECT * FROM $table ORDER BY 'view_date'
DESC",$link);
$num_rows = mysql_num_rows($result);

if($num_rows) {
//   print("");
   while($row = mysql_fetch_row($result))

   {

  print("");
  print("$row[0]");
  print("$row[1]");
  print("$row[2]");
  print("");


   }
   print("");
 } else {
   print("No Files To Show!!");

 }



';

$headers  = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";

$headers .= "From: MIC Price File Monitor <[EMAIL PROTECTED]>\r\n";

mail($to, $subject, $message, $headers);

?>




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




Re: [PHP-DB] Parse Error...

2002-12-02 Thread Micah Stevens
There aren't any closing quotes on your $message variable or semicolon
to tell the parser that you're done with the assignment statement.

-Micah





On Mon, 2002-12-02 at 15:05, Chase wrote:
> When trying to execute the following script to send the contents of a table
> via "mail()" I am getting this error...
> 
> Parse error: parse error, unexpected T_STRING in FILENAME.PHP on line 36
> 
> The portion of this code inside the HTML tags works great for displaying the
> table on the screen, but when I include it in the larger script for sending
> a mail message, I get this error.
> 
> I am sure that it is something simple that I have been too stupid to catch,
> but any help would be great!
> 
> Chase
> 
> 
> Code Follows  --->
> 
>  $server = "";
> $user = "";
> $pass = "";
> $db = "";
> $table = "";
> ?>
> 
>  $to  = "CKnott <[EMAIL PROTECTED]>" . ", " ;
> $to .= "Chase <[EMAIL PROTECTED]>";
> 
> $subject = "Price File Access History";
> 
> $message = '
> 
> Price File Access
> 
> 
> 
> 
> 
>   Date / Time
> 
> 
>   Logged IP Address
> 
> 
>   Logged Username
> 
> 
> 
> $link = mysql_connect("$server", "$user", "$pass");
> mysql_select_db("$db", $link);
> 
> $result = mysql_query("SELECT * FROM $table ORDER BY 'view_date'
> DESC",$link);
> $num_rows = mysql_num_rows($result);
> 
> if($num_rows) {
> //   print("");
>while($row = mysql_fetch_row($result))
> 
>{
> 
>   print("");
>   print("$row[0]");
>   print("$row[1]");
>   print("$row[2]");
>   print("");
> 
> 
>}
>print("");
>  } else {
>print("No Files To Show!!");
> 
>  }
> 
> 
> 
> ';
> 
> $headers  = "MIME-Version: 1.0\r\n";
> $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
> 
> $headers .= "From: MIC Price File Monitor <[EMAIL PROTECTED]>\r\n";
> 
> mail($to, $subject, $message, $headers);
> 
> ?>
> 
-- 
Raincross Technologies
Development and Consulting Services
http://www.raincross-tech.com



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




Re: [PHP-DB] Parse Error...

2002-12-02 Thread Chase
  There is a single quote and semicolon on the line under  that I
thought would be defining the end of the assignment.
  Should I have used double quotes instead of single?

Chase


"Micah Stevens" <[EMAIL PROTECTED]> wrote in message
1038870535.23725.123.camel@tyrell">news:1038870535.23725.123.camel@tyrell...
> There aren't any closing quotes on your $message variable or semicolon
> to tell the parser that you're done with the assignment statement.
>
> -Micah
>
>
>
>
>
> On Mon, 2002-12-02 at 15:05, Chase wrote:
> > When trying to execute the following script to send the contents of a
table
> > via "mail()" I am getting this error...
> >
> > Parse error: parse error, unexpected T_STRING in FILENAME.PHP on line 36
> >
> > The portion of this code inside the HTML tags works great for displaying
the
> > table on the screen, but when I include it in the larger script for
sending
> > a mail message, I get this error.
> >
> > I am sure that it is something simple that I have been too stupid to
catch,
> > but any help would be great!
> >
> > Chase
> >
> >
> > Code Follows  --->
> >
> >  > $server = "";
> > $user = "";
> > $pass = "";
> > $db = "";
> > $table = "";
> > ?>
> >
> >  > $to  = "CKnott <[EMAIL PROTECTED]>" . ", " ;
> > $to .= "Chase <[EMAIL PROTECTED]>";
> >
> > $subject = "Price File Access History";
> >
> > $message = '
> > 
> > Price File Access
> >
> > 
> > 
> > 
> > 
> >   Date / Time
> > 
> > 
> >   Logged IP Address
> > 
> > 
> >   Logged Username
> > 
> > 
> >
> > $link = mysql_connect("$server", "$user", "$pass");
> > mysql_select_db("$db", $link);
> >
> > $result = mysql_query("SELECT * FROM $table ORDER BY 'view_date'
> > DESC",$link);
> > $num_rows = mysql_num_rows($result);
> >
> > if($num_rows) {
> > //   print("");
> >while($row = mysql_fetch_row($result))
> >
> >{
> >
> >   print("");
> >   print("$row[0]");
> >   print("$row[1]");
> >   print("$row[2]");
> >   print("");
> >
> >
> >}
> >print("");
> >  } else {
> >print("No Files To Show!!");
> >
> >  }
> >
> > 
> > 
> > ';
> >
> > $headers  = "MIME-Version: 1.0\r\n";
> > $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
> >
> > $headers .= "From: MIC Price File Monitor <[EMAIL PROTECTED]>\r\n";
> >
> > mail($to, $subject, $message, $headers);
> >
> > ?>
> >
> --
> Raincross Technologies
> Development and Consulting Services
> http://www.raincross-tech.com
>
>



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




Re: [PHP-DB] Parse Error...

2002-12-02 Thread Jim Hunter
In that case, your logic is not going to work. You have live PHP code inside
a string. You are going to need to build the $message in pieces. Start with
the HTML, then add the result from each itteration of your PHP loop to
$message then add the trailing HTML to form the complete $message. 

Your close, but it's just not going to work like you think it will.

Jim

 
---Original Message---
 
From: Chase
Date: Monday, December 02, 2002 04:34:18 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Parse Error...
 
There is a single quote and semicolon on the line under  that I
thought would be defining the end of the assignment.
Should I have used double quotes instead of single?

Chase


"Micah Stevens" <[EMAIL PROTECTED]> wrote in message
1038870535.23725.123.camel@tyrell">news:1038870535.23725.123.camel@tyrell...
> There aren't any closing quotes on your $message variable or semicolon
> to tell the parser that you're done with the assignment statement.
>
> -Micah
>
>
>
>
>
> On Mon, 2002-12-02 at 15:05, Chase wrote:
> > When trying to execute the following script to send the contents of a
table
> > via "mail()" I am getting this error...
> >
> > Parse error: parse error, unexpected T_STRING in FILENAME.PHP on line 36
> >
> > The portion of this code inside the HTML tags works great for displaying
the
> > table on the screen, but when I include it in the larger script for
sending
> > a mail message, I get this error.
> >
> > I am sure that it is something simple that I have been too stupid to
catch,
> > but any help would be great!
> >
> > Chase
> >
> >
> > Code Follows --->
> >
> >  > $server = "";
> > $user = "";
> > $pass = "";
> > $db = "";
> > $table = "";
> > ?>
> >
> >  > $to = "CKnott <[EMAIL PROTECTED]>" . ", " ;
> > $to .= "Chase <[EMAIL PROTECTED]>";
> >
> > $subject = "Price File Access History";
> >
> > $message = '
> > 
> > Price File Access
> >
> > 
> > 
> > 
> > 
> > Date / Time
> > 
> > 
> > Logged IP Address
> > 
> > 
> > Logged Username
> > 
> > 
> >
> > $link = mysql_connect("$server", "$user", "$pass");
> > mysql_select_db("$db", $link);
> >
> > $result = mysql_query("SELECT * FROM $table ORDER BY 'view_date'
> > DESC",$link);
> > $num_rows = mysql_num_rows($result);
> >
> > if($num_rows) {
> > // print("");
> > while($row = mysql_fetch_row($result))
> >
> > {
> >
> > print("");
> > print("$row[0]");
> > print("$row[1]");
> > print("$row[2]");
> > print("");
> >
> >
> > }
> > print("");
> > } else {
> > print("No Files To Show!!");
> >
> > }
> >
> > 
> > 
> > ';
> >
> > $headers = "MIME-Version: 1.0\r\n";
> > $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
> >
> > $headers .= "From: MIC Price File Monitor <[EMAIL PROTECTED]>\r\n";
> >
> > mail($to, $subject, $message, $headers);
> >
> > ?>
> >
> --
> Raincross Technologies
> Development and Consulting Services
> http://www.raincross-tech.com
>
>



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

. 


Re: [PHP-DB] Parse Error...

2002-12-02 Thread Chase
  Okay, you just jumped WAY outside my basic knowledge...  However, it does
make perfect sense, so I am off to the library...

Chase


"Jim Hunter" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
In that case, your logic is not going to work. You have live PHP code inside
a string. You are going to need to build the $message in pieces. Start with
the HTML, then add the result from each itteration of your PHP loop to
$message then add the trailing HTML to form the complete $message.

Your close, but it's just not going to work like you think it will.

Jim


---Original Message---

From: Chase
Date: Monday, December 02, 2002 04:34:18 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Parse Error...

There is a single quote and semicolon on the line under  that I
thought would be defining the end of the assignment.
Should I have used double quotes instead of single?

Chase


"Micah Stevens" <[EMAIL PROTECTED]> wrote in message
1038870535.23725.123.camel@tyrell">news:1038870535.23725.123.camel@tyrell...
> There aren't any closing quotes on your $message variable or semicolon
> to tell the parser that you're done with the assignment statement.
>
> -Micah
>
>
>
>
>
> On Mon, 2002-12-02 at 15:05, Chase wrote:
> > When trying to execute the following script to send the contents of a
table
> > via "mail()" I am getting this error...
> >
> > Parse error: parse error, unexpected T_STRING in FILENAME.PHP on line 36
> >
> > The portion of this code inside the HTML tags works great for displaying
the
> > table on the screen, but when I include it in the larger script for
sending
> > a mail message, I get this error.
> >
> > I am sure that it is something simple that I have been too stupid to
catch,
> > but any help would be great!
> >
> > Chase
> >
> >
> > Code Follows --->
> >
> >  > $server = "";
> > $user = "";
> > $pass = "";
> > $db = "";
> > $table = "";
> > ?>
> >
> >  > $to = "CKnott <[EMAIL PROTECTED]>" . ", " ;
> > $to .= "Chase <[EMAIL PROTECTED]>";
> >
> > $subject = "Price File Access History";
> >
> > $message = '
> > 
> > Price File Access
> >
> > 
> > 
> > 
> > 
> > Date / Time
> > 
> > 
> > Logged IP Address
> > 
> > 
> > Logged Username
> > 
> > 
> >
> > $link = mysql_connect("$server", "$user", "$pass");
> > mysql_select_db("$db", $link);
> >
> > $result = mysql_query("SELECT * FROM $table ORDER BY 'view_date'
> > DESC",$link);
> > $num_rows = mysql_num_rows($result);
> >
> > if($num_rows) {
> > // print("");
> > while($row = mysql_fetch_row($result))
> >
> > {
> >
> > print("");
> > print("$row[0]");
> > print("$row[1]");
> > print("$row[2]");
> > print("");
> >
> >
> > }
> > print("");
> > } else {
> > print("No Files To Show!!");
> >
> > }
> >
> > 
> > 
> > ';
> >
> > $headers = "MIME-Version: 1.0\r\n";
> > $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
> >
> > $headers .= "From: MIC Price File Monitor <[EMAIL PROTECTED]>\r\n";
> >
> > mail($to, $subject, $message, $headers);
> >
> > ?>
> >
> --
> Raincross Technologies
> Development and Consulting Services
> http://www.raincross-tech.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] Parse Error...

2002-12-02 Thread Micah Stevens
Remember, the print() function sends stuff to the browser. If you wish
to make the code output to the $message variable, you must use
additional assignment statements. 

I made some quick changes to the code below, try that:



" . ", " ;
$to .= "Chase <[EMAIL PROTECTED]>";

$subject = "Price File Access History";

$message = '

Price File Access





  Date / Time


  Logged IP Address


  Logged Username


';

$link = mysql_connect("$server", "$user", "$pass");
mysql_select_db("$db", $link);

$result = mysql_query("SELECT * FROM $table ORDER BY 'view_date'
DESC",$link);
$num_rows = mysql_num_rows($result);

if($num_rows) {
//   print("");
   while($row = mysql_fetch_row($result))

   {

  $message .= "";
  $message .= "$row[0]";
  $message .= "$row[1]";
  $message .= "$row[2]";
  $message .= "";


   }
   $message .= "";
 } else {
   $message .= "No Files To Show!!";

 }
$message .= "

";

$headers  = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";

$headers .= "From: MIC Price File Monitor <[EMAIL PROTECTED]>\r\n";

mail($to, $subject, $message, $headers);

?>



On Mon, 2002-12-02 at 16:30, Chase wrote:
>   There is a single quote and semicolon on the line under  that I
> thought would be defining the end of the assignment.
>   Should I have used double quotes instead of single?
> 
> Chase
> 
> 
> "Micah Stevens" <[EMAIL PROTECTED]> wrote in message
> 1038870535.23725.123.camel@tyrell">news:1038870535.23725.123.camel@tyrell...
> > There aren't any closing quotes on your $message variable or semicolon
> > to tell the parser that you're done with the assignment statement.
> >
> > -Micah
> >
> >
> >
> >
> >
> > On Mon, 2002-12-02 at 15:05, Chase wrote:
> > > When trying to execute the following script to send the contents of a
> table
> > > via "mail()" I am getting this error...
> > >
> > > Parse error: parse error, unexpected T_STRING in FILENAME.PHP on line 36
> > >
> > > The portion of this code inside the HTML tags works great for displaying
> the
> > > table on the screen, but when I include it in the larger script for
> sending
> > > a mail message, I get this error.
> > >
> > > I am sure that it is something simple that I have been too stupid to
> catch,
> > > but any help would be great!
> > >
> > > Chase
> > >
> > >
> > > Code Follows  --->
> > >
> > >  > > $server = "";
> > > $user = "";
> > > $pass = "";
> > > $db = "";
> > > $table = "";
> > > ?>
> > >
> > >  > > $to  = "CKnott <[EMAIL PROTECTED]>" . ", " ;
> > > $to .= "Chase <[EMAIL PROTECTED]>";
> > >
> > > $subject = "Price File Access History";
> > >
> > > $message = '
> > > 
> > > Price File Access
> > >
> > > 
> > > 
> > > 
> > > 
> > >   Date / Time
> > > 
> > > 
> > >   Logged IP Address
> > > 
> > > 
> > >   Logged Username
> > > 
> > > 
> > >
> > > $link = mysql_connect("$server", "$user", "$pass");
> > > mysql_select_db("$db", $link);
> > >
> > > $result = mysql_query("SELECT * FROM $table ORDER BY 'view_date'
> > > DESC",$link);
> > > $num_rows = mysql_num_rows($result);
> > >
> > > if($num_rows) {
> > > //   print("");
> > >while($row = mysql_fetch_row($result))
> > >
> > >{
> > >
> > >   print("");
> > >   print("$row[0]");
> > >   print("$row[1]");
> > >   print("$row[2]");
> > >   print("");
> > >
> > >
> > >}
> > >print("");
> > >  } else {
> > >print("No Files To Show!!");
> > >
> > >  }
> > >
> > > 
> > > 
> > > ';
> > >
> > > $headers  = "MIME-Version: 1.0\r\n";
> > > $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
> > >
> > > $headers .= "From: MIC Price File Monitor <[EMAIL PROTECTED]>\r\n";
> > >
> > > mail($to, $subject, $message, $headers);
> > >
> > > ?>
> > >
> > --
> > Raincross Technologies
> > Development and Consulting Services
> > http://www.raincross-tech.com
> >
> >
-- 
Raincross Technologies
Development and Consulting Services
http://www.raincross-tech.com



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




Re: [PHP-DB] Parse Error...

2002-12-02 Thread Chase
Thank you!!  This appears to have solved it...  I didn't even think of using
the "$message" variable instead of the "print()"...  Sheesh...  I still have
LOTS to learn!!

Chase


"Micah Stevens" <[EMAIL PROTECTED]> wrote in message
1038878012.23696.129.camel@tyrell">news:1038878012.23696.129.camel@tyrell...
> Remember, the print() function sends stuff to the browser. If you wish
> to make the code output to the $message variable, you must use
> additional assignment statements.
>
> I made some quick changes to the code below, try that:
>
>  $server = "";
> $user = "";
> $pass = "";
> $db = "";
> $table = "";
> ?>
>
>  $to  = "CKnott <[EMAIL PROTECTED]>" . ", " ;
> $to .= "Chase <[EMAIL PROTECTED]>";
>
> $subject = "Price File Access History";
>
> $message = '
> 
> Price File Access
>
> 
> 
> 
> 
>   Date / Time
> 
> 
>   Logged IP Address
> 
> 
>   Logged Username
> 
> 
> ';
>
> $link = mysql_connect("$server", "$user", "$pass");
> mysql_select_db("$db", $link);
>
> $result = mysql_query("SELECT * FROM $table ORDER BY 'view_date'
> DESC",$link);
> $num_rows = mysql_num_rows($result);
>
> if($num_rows) {
> //   print("");
>while($row = mysql_fetch_row($result))
>
>{
>
>   $message .= "";
>   $message .= "$row[0]";
>   $message .= "$row[1]";
>   $message .= "$row[2]";
>   $message .= "";
>
>
>}
>$message .= "";
>  } else {
>$message .= "No Files To Show!!";
>
>  }
> $message .= "
> 
> ";
>
> $headers  = "MIME-Version: 1.0\r\n";
> $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
>
> $headers .= "From: MIC Price File Monitor <[EMAIL PROTECTED]>\r\n";
>
> mail($to, $subject, $message, $headers);
>
> ?>
>
>
>
> On Mon, 2002-12-02 at 16:30, Chase wrote:
> >   There is a single quote and semicolon on the line under  that I
> > thought would be defining the end of the assignment.
> >   Should I have used double quotes instead of single?
> >
> > Chase
> >
> >
> > "Micah Stevens" <[EMAIL PROTECTED]> wrote in message
> > 1038870535.23725.123.camel@tyrell">news:1038870535.23725.123.camel@tyrell...
> > > There aren't any closing quotes on your $message variable or semicolon
> > > to tell the parser that you're done with the assignment statement.
> > >
> > > -Micah
> > >
> > >
> > >
> > >
> > >
> > > On Mon, 2002-12-02 at 15:05, Chase wrote:
> > > > When trying to execute the following script to send the contents of
a
> > table
> > > > via "mail()" I am getting this error...
> > > >
> > > > Parse error: parse error, unexpected T_STRING in FILENAME.PHP on
line 36
> > > >
> > > > The portion of this code inside the HTML tags works great for
displaying
> > the
> > > > table on the screen, but when I include it in the larger script for
> > sending
> > > > a mail message, I get this error.
> > > >
> > > > I am sure that it is something simple that I have been too stupid to
> > catch,
> > > > but any help would be great!
> > > >
> > > > Chase
> > > >
> > > >
> > > > Code Follows  --->
> > > >
> > > >  > > > $server = "";
> > > > $user = "";
> > > > $pass = "";
> > > > $db = "";
> > > > $table = "";
> > > > ?>
> > > >
> > > >  > > > $to  = "CKnott <[EMAIL PROTECTED]>" . ", " ;
> > > > $to .= "Chase <[EMAIL PROTECTED]>";
> > > >
> > > > $subject = "Price File Access History";
> > > >
> > > > $message = '
> > > > 
> > > > Price File Access
> > > >
> > > > 
> > > > 
> > > > 
> > > > 
> > > >   Date / Time
> > > > 
> > > > 
> > > >   Logged IP Address
> > > > 
> > > > 
> > > >   Logged Username
> > > > 
> > > > 
> > > >
> > > > $link = mysql_connect("$server", "$user", "$pass");
> > > > mysql_select_db("$db", $link);
> > > >
> > > > $result = mysql_query("SELECT * FROM $table ORDER BY 'view_date'
> > > > DESC",$link);
> > > > $num_rows = mysql_num_rows($result);
> > > >
> > > > if($num_rows) {
> > > > //   print("");
> > > >while($row = mysql_fetch_row($result))
> > > >
> > > >{
> > > >
> > > >   print("");
> > > >   print("$row[0]");
> > > >   print("$row[1]");
> > > >   print("$row[2]");
> > > >   print("");
> > > >
> > > >
> > > >}
> > > >print("");
> > > >  } else {
> > > >print("No Files To Show!!");
> > > >
> > > >  }
> > > >
> > > > 
> > > > 
> > > > ';
> > > >
> > > > $headers  = "MIME-Version: 1.0\r\n";
> > > > $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
> > > >
> > > > $headers .= "From: MIC Price File Monitor
<[EMAIL PROTECTED]>\r\n";
> > > >
> > > > mail($to, $subject, $message, $headers);
> > > >
> > > > ?>
> > > >
> > > --
> > > Raincross Technologies
> > > Development and Consulting Services
> > > http://www.raincross-tech.com
> > >
> > >
> --
> Raincross Technologies
> Development and Consulting Services
> http://www.raincross-tech.com
>
>



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