Re: [PHP-DB] PHP and MySQL queries...

2001-10-24 Thread Russ Michell

How about using 3 select menus:

* One for the day called 'dayselect'
* One for the month called 'monthselect;
* One for the year called 'yearselect'

When you get the values from the selects to perform query's upon, re-arrange the order 
the dates 
come in:

In your form they'll be in the order: day,month,year
To perform queries into a MySQL DB re-arrange them:

$date = $yearselect . "-" . $monthselect . "-" . $yearselect;

HTH
Russ

On Tue, 23 Oct 2001 10:52:41 -0600 Jason <[EMAIL PROTECTED]> wrote:

> I am having a hard time setting up a form for users to enter a date in the
> format of 00/00/ (of course they would use an actual date).  My form is
> as follows...
> 
>   *I.E. - Format is 04/01/2001*
>   Search for Ads by date:
> 
>   
>   
>  value="Submit">
> 
>   
> 
> 
> On my search.php page I have the following MySQL connection and search
> parameters...
>  
> mysql_connect ("db_hostname", "db_username", "db_password");
> 
> mysql_select_db ("db_name");
> 
> if ($date == "")
> {$date = '%';}
> 
> $result = mysql_query ("SELECT
> fname,lname,address,city,state,zip,phonea,phone,email,crty,crnum,crmo,cryr,w
> eeks,ogden,rock,logan,ipaddress,ad,total,num,date,time
>   FROM ads WHERE date LIKE '%$date%' LIMIT 0, 30 ");
> $count = -1;
> if ($row = mysql_fetch_array($result)) {
> $count ++;
> do {
> echo "Name: ";
> printf(mysql_result($result,$count,"fname"));
> echo " ";
> printf(mysql_result($result,$count,"lname"));
> echo "\n";
> 
> echo "Address: ";
> printf(mysql_result($result,$count,"address"));
> echo "\n";
> 
> echo "City: ";
> printf(mysql_result($result,$count,"city"));
> echo "\n";
> 
> echo "State: ";
> printf(mysql_result($result,$count,"state"));
> echo "\n";
> 
> echo "Zip: ";
> printf(mysql_result($result,$count,"zip"));
> echo "\n";
> 
> echo "Phone: (";
> printf(mysql_result($result,$count,"phonea"));
> echo ") ";
> printf(mysql_result($result,$count,"phone"));
> echo "\n";
> 
> echo "Email: ";
> printf(mysql_result($result,$count,"email"));
> echo "\n";
> 
> echo "Credit Type: ";
> printf(mysql_result($result,$count,"crty"));
> echo "\n";
> 
> echo "Credit Number: ";
> printf(mysql_result($result,$count,"crnum"));
> echo "\n";
> 
> echo "Credit Card Date: ";
> printf(mysql_result($result,$count,"crmo"));
> echo " ";
> printf(mysql_result($result,$count,"cryr"));
> echo "\n";
> 
> echo "Weeks: ";
> printf(mysql_result($result,$count,"weeks"));
> echo "\n";
> 
> echo "town1: ";
> printf(mysql_result($result,$count,"town1"));
> echo "\n";
> 
> echo "town2: ";
> printf(mysql_result($result,$count,"town2"));
> echo "\n";
> 
> echo "town3: ";
> printf(mysql_result($result,$count,"town3"));
> echo "\n";
> 
> echo "IP Address: ";
> printf(mysql_result($result,$count,"ipaddress"));
> echo "\n";
> 
> echo "Ad: ";
> 
> $ad[$count] = (mysql_result($result,$count,"ad"));
> 
> $ad[$count] = ereg_replace ("&a&", "'", $ad[$count]);
> $ad[$count] = ereg_replace ("&q&", "\"", $ad[$count]);
> $ad[$count] = ereg_replace ("&p&", "%", $ad[$count]);
> $ad[$count] = ereg_replace ("&bs&", "\\", $ad[$count]);
> 
> 
> echo $ad[$count];
> echo "\n";
> 
> echo "Total: ";
> printf(mysql_result($result,$count,"total"));
> echo "\n";
> 
> echo "Ad Number: ";
> printf(mysql_result($result,$count,"num"));
> echo "\n";
> 
> echo "Date: ";
> printf(mysql_result($result,$count,"date"));
> echo "\n";
> 
> echo "Time: ";
> printf(mysql_result($result,$count,"time"));
> echo "\n";
> 
> } while($row = mysql_fetch_array($result));
> 
> } else {print "Sorry, no records were found!";}
> 
> ?>
> So far I have come to the conclusion that the input from the user is
> probably where my problem is because I am assuming it is taking the "/" in
> the date they enter and doing something I don't want it to.  In any event if
> someone could give me a clue as to how to resolve this issue it would be
> greatly appreciated.
> 
> 
> 
> -- 
> 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]
> 

#---#

  "Believe nothing - consider everything"   
  
  Russ Michell
  Anglia Polytechnic University Webteam
  Room 1C 'The Eastings' East Road, Cambridge
  
  e: [EMAIL PROTECTED]
  w: www.apu.ac.uk/webteam

  www.theruss.com

#---#


-- 
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] Re: ADORecordset Equivalent in PHP?

2001-10-24 Thread John Lim

Try http://php.weblogs.com/adodb

This is a database wrapper library which is very similar to M'soft ADO. Very
fast and full featured.

"Mrbaseball34" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I know about mysql_fetch_array but how would I do it for
> each row into a "recordset" that I can use instead?



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




Re: RE: [PHP-DB] looped insert

2001-10-24 Thread Mike Frazer

Just thought this would be helpful...

I've found the occassional problem with trying to insert a script-generated
null value (rare but it does happen).  If this becomes a problem, remember
that NULL is just another word for "nothing".  MySQL will accept either of
the following:

INSERT INTO table VALUES ('value1', 'value2', NULL, 'value3');
INSERT INTO table VALUES ('value1', 'value2', , 'value3');

NOTE: I didn't read the entire post below...it's too early in the morning to
think about code.  I'm off to populate some site content until my brain
catches up with the clock.

Mike Frazer




"Russ Michell" <[EMAIL PROTECTED]> wrote in message
news:SIMEON.10110231044.D@k1c. anglia.ac.uk...
> Hi Rick:
>
> Cheers for the info. Thwe following code almost does it, however, the NULL
value isn't inserted, if
> checkboxes are != to 'yes':
>
> //If submit button selected, process those ticked checkbox categories:
> if(isset($submit)) {
> //Start off sql
> $sql = "INSERT INTO $myanet02
(staffdev,strategies,rules,news,information,policies) VALUES(";
> //loop while categories have been ticked
> for($i=0;$i if($category[$names] == 'yes') {
> $sql .= "'$email',";
> }
> else {
> $sql .= "NULL,";
> }
> }
> //Remove the last comma
> $sql = substr($sql,0,-1).")";
> //$query = mysql_query($sql,$connect) or die(mysql_error());
> echo $sql;
> }
>
> I believe the problem to be this line:
> 'if($category[$names] == 'yes') {' //Use this and NULL values aren't
inserted
>
> 'if($HTTP_POST_VARS["category${$i}"] == 'yes') {' //Use this and ONLY NULL
values are inserted
>
> The values are taken from the checkboxes thus:
>
> //Get all table column names, dynamically display them and use to process
subscriptions:
> $fields = mysql_list_fields("$dbName", "myanet_categories", $connect);
> $columns = mysql_num_fields($fields);
> for ($i=0; $i<$columns; $i++) {
> $names = mysql_field_name($fields, $i) . "\n";
> $catselect .= "$names \n";
> }
>
> You can see it happening at:
> http://gertrude.anglia.ac.uk/intranet/myanet/index.php
>
> Many thanks.
> Russ
>
>
>
>
> On Mon, 22 Oct 2001 12:28:38 -0500 Rick Emery <[EMAIL PROTECTED]> wrote:
>
> > Construct your INSERT a piece at a time.  Something like:
> >
> > $sql = "INSERT INTO $myanet02
> > (staffdev,strategies,rules,news,information,policies) VALUES(";
> >
> > for($i=0;$i > if($HTTP_POST_VARS["category{$i}"] == 'yes') {
> > $sql .= "\'$email\',";
> > }
> > else {
> > $sql .= "NULL,";
> > }
> > }
> > $sql = substring($sql,0,-1).")";
> > //$query = mysql_query($sql,$connect) or die(mysql_error());
> > echo $sql;
> >
> > -Original Message-
> > From: Russ Michell [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, October 22, 2001 11:23 AM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP-DB] looped insert
> >
> >
> > Hi everyone:
> >
> > I've been fiddling with this all day, and well - if it was working you
> > wouldn't be reading this right now! ;-)
> > My script should take the selections made by users and process them via
> > straightforward MySQL inserts:
> >
> > //Get all table column names, dynamically display them as checkboxes.
Use to
> > process subscriptions:
> > $fields = mysql_list_fields("$dbName", "myanet_categories", $connect);
> > $columns = mysql_num_fields($fields);
> > for ($i=0; $i<$columns; $i++) {
> > $names = mysql_field_name($fields, $i) . "\n";
> > $catselect .= "$names  > name=\"category[$names]\" value=\"yes\">\n";
> > }
> >
> >
> > //If submit button selected, process those ticked checkbox categories:
> > if(isset($submit)) {
> > //loop while categories have been ticked
> > for($i=0;$i > if($HTTP_POST_VARS["category{$i}"] == 'yes') { //Not sure
> > about this bit...
> > $sql = "INSERT INTO $myanet02
> > (staffdev,strategies,rules,news,information,policies)
> > VALUES('$email','$email','$email','$email','$email','$email')";
> > //$query = mysql_query($sql,$connect) or
> > die(mysql_error());
> > echo $sql;
> > }
> > }
> > }
> >
> > At the moment not even echoing my $sql works. I know this aint gonna
work as
> > it is, because what I really need to know is:
> >
> > * How do I insert into only those categories that have been checked?
> > (default is 'null' in a VARCHAR(50) field)
> > * How do I only declare '$email' a single time as this is the only value
> > being inserted?
> >
> > Many thanks:
> > Russ
> >
> > #---#
> >
> >   "Believe nothing - consider everything"
> >
> >   Russ Michell
> >   Anglia Polytechnic University Webteam
> >   Room 1C 'The Eastings' East Road, Cambridge
> >
> >   e: [EMAIL PROTECTED]
> >   w: www.apu.ac.uk/webteam
> >
> >   www.theruss.com
> >
> > #---#
> >
> >
> > --
> > 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 Database Mailing List (http://www.ph

Re: RE: [PHP-DB] looped insert

2001-10-24 Thread Russ Michell

> NOTE: I didn't read the entire post below...it's too early in the morning to
> think about code.
haha I did that the other day when I tried (and failed) to help out someone else - 
damn tired, 
hadn't even had a whiff of beer...

Cheers for your help!
Russ

On Wed, 24 Oct 2001 09:10:59 -0400 Mike Frazer <[EMAIL PROTECTED]> wrote:

> Just thought this would be helpful...
> 
> I've found the occassional problem with trying to insert a script-generated
> null value (rare but it does happen).  If this becomes a problem, remember
> that NULL is just another word for "nothing".  MySQL will accept either of
> the following:
> 
> INSERT INTO table VALUES ('value1', 'value2', NULL, 'value3');
> INSERT INTO table VALUES ('value1', 'value2', , 'value3');
> 
> NOTE: I didn't read the entire post below...it's too early in the morning to
> think about code.  I'm off to populate some site content until my brain
> catches up with the clock.
> 
> Mike Frazer
> 
> 
> 
> 
> "Russ Michell" <[EMAIL PROTECTED]> wrote in message
> news:SIMEON.10110231044.D@k1c. anglia.ac.uk...
> > Hi Rick:
> >
> > Cheers for the info. Thwe following code almost does it, however, the NULL
> value isn't inserted, if
> > checkboxes are != to 'yes':
> >
> > //If submit button selected, process those ticked checkbox categories:
> > if(isset($submit)) {
> > //Start off sql
> > $sql = "INSERT INTO $myanet02
> (staffdev,strategies,rules,news,information,policies) VALUES(";
> > //loop while categories have been ticked
> > for($i=0;$i > if($category[$names] == 'yes') {
> > $sql .= "'$email',";
> > }
> > else {
> > $sql .= "NULL,";
> > }
> > }
> > //Remove the last comma
> > $sql = substr($sql,0,-1).")";
> > //$query = mysql_query($sql,$connect) or die(mysql_error());
> > echo $sql;
> > }
> >
> > I believe the problem to be this line:
> > 'if($category[$names] == 'yes') {' //Use this and NULL values aren't
> inserted
> >
> > 'if($HTTP_POST_VARS["category${$i}"] == 'yes') {' //Use this and ONLY NULL
> values are inserted
> >
> > The values are taken from the checkboxes thus:
> >
> > //Get all table column names, dynamically display them and use to process
> subscriptions:
> > $fields = mysql_list_fields("$dbName", "myanet_categories", $connect);
> > $columns = mysql_num_fields($fields);
> > for ($i=0; $i<$columns; $i++) {
> > $names = mysql_field_name($fields, $i) . "\n";
> > $catselect .= "$names  name=\"category[$names]\" value=\"yes\">\n";
> > }
> >
> > You can see it happening at:
> > http://gertrude.anglia.ac.uk/intranet/myanet/index.php
> >
> > Many thanks.
> > Russ
> >
> >
> >
> >
> > On Mon, 22 Oct 2001 12:28:38 -0500 Rick Emery <[EMAIL PROTECTED]> wrote:
> >
> > > Construct your INSERT a piece at a time.  Something like:
> > >
> > > $sql = "INSERT INTO $myanet02
> > > (staffdev,strategies,rules,news,information,policies) VALUES(";
> > >
> > > for($i=0;$i > > if($HTTP_POST_VARS["category{$i}"] == 'yes') {
> > > $sql .= "\'$email\',";
> > > }
> > > else {
> > > $sql .= "NULL,";
> > > }
> > > }
> > > $sql = substring($sql,0,-1).")";
> > > //$query = mysql_query($sql,$connect) or die(mysql_error());
> > > echo $sql;
> > >
> > > -Original Message-
> > > From: Russ Michell [mailto:[EMAIL PROTECTED]]
> > > Sent: Monday, October 22, 2001 11:23 AM
> > > To: [EMAIL PROTECTED]
> > > Subject: [PHP-DB] looped insert
> > >
> > >
> > > Hi everyone:
> > >
> > > I've been fiddling with this all day, and well - if it was working you
> > > wouldn't be reading this right now! ;-)
> > > My script should take the selections made by users and process them via
> > > straightforward MySQL inserts:
> > >
> > > //Get all table column names, dynamically display them as checkboxes.
> Use to
> > > process subscriptions:
> > > $fields = mysql_list_fields("$dbName", "myanet_categories", $connect);
> > > $columns = mysql_num_fields($fields);
> > > for ($i=0; $i<$columns; $i++) {
> > > $names = mysql_field_name($fields, $i) . "\n";
> > > $catselect .= "$names  > > name=\"category[$names]\" value=\"yes\">\n";
> > > }
> > >
> > >
> > > //If submit button selected, process those ticked checkbox categories:
> > > if(isset($submit)) {
> > > //loop while categories have been ticked
> > > for($i=0;$i > > if($HTTP_POST_VARS["category{$i}"] == 'yes') { //Not sure
> > > about this bit...
> > > $sql = "INSERT INTO $myanet02
> > > (staffdev,strategies,rules,news,information,policies)
> > > VALUES('$email','$email','$email','$email','$email','$email')";
> > > //$query = mysql_query($sql,$connect) or
> > > die(mysql_error());
> > > echo $sql;
> > > }
> > > }
> > > }
> > >
> > > At the moment not even echoing my $sql works. I know this aint gonna
> work as
> > > it is, because what I really need to know is:
> > >
> > > * How do I insert into only those categories that have been checked?
> > > (default is 'null' in a VARCHAR(50) field)
> > > * How do I only declare '$email' a single time as this is the only value
> > > being inserted?
> > >
> > > Many thanks:
> > > Russ
> > >
> > > #---

[PHP-DB] Stuck

2001-10-24 Thread Ryan Marrs

I'm attempting to do basic authentication through PHP and am having little
success.  I have a login screen which requests a username and password, and
I need to have that check against a Windows domain.  IE:

Domain:  ALPHA
Login:  testusername
Password: TestPassword



Then PHP needs to check against the ALPHA domain if the username and
password is correct.  Is there anyway to do this without popping up a
standard basic authentication form box?

Thanks!

Ryan

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




Re: [PHP-DB] Stuck

2001-10-24 Thread Russ Michell

>Is there anyway to do this without popping up a standard basic authentication form 
>box?
Sure! Are you making use of a databsae for this? MySQL per chance?
If so I may be able to help you out..

* Simply query the fields: 'username' 'password' 'domain' from a DB table called: 
'users'
* SELECT these on the basis that the data in the DB reflects thatwhich was inputed via 
login form
* If they details exist - login
* If not refuse

Cheers
Russ.

On Wed, 24 Oct 2001 09:33:21 -0400 Ryan Marrs <[EMAIL PROTECTED]> wrote:

> I'm attempting to do basic authentication through PHP and am having little
> success.  I have a login screen which requests a username and password, and
> I need to have that check against a Windows domain.  IE:
> 
> Domain:  ALPHA
> Login:  testusername
> Password: TestPassword
> 
> 
> 
> Then PHP needs to check against the ALPHA domain if the username and
> password is correct.  Is there anyway to do this without popping up a
> standard basic authentication form box?
> 
> Thanks!
> 
> Ryan
> 
> -- 
> 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]
> 

#---#

  "Believe nothing - consider everything"   
  
  Russ Michell
  Anglia Polytechnic University Webteam
  Room 1C 'The Eastings' East Road, Cambridge
  
  e: [EMAIL PROTECTED]
  w: www.apu.ac.uk/webteam

  www.theruss.com

#---#


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

2001-10-24 Thread Jacob Singh

What is everyone's favorite abstraction layer?
--
Jacob Singh, [EMAIL PROTECTED] on 10/24/2001




--
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] RE: [PHP-DEV] Re: [PHP-DB] PHP and MySQL queries...

2001-10-24 Thread Robinson, Mike
Title: RE: [PHP-DEV] Re: [PHP-DB] PHP and MySQL queries...





In these days and times, conservation of a meg of disk
space is really not a consideration. Not the primary one anyway.
The data should be stored in a format such that the
storage itself and then retrieval can be executed with a
minimum of handling/intervention other than the required
sanity-checking.


I've found that a set of date/time select controls and storage
in a datetime field have been optimal. Insertion requires
no parsing or complex handling (just some gluing of array
elements) and retrieval with mysql's date-related functions
means I don't need to touch the data one bit to display
it in a meaningful way.


For me, having to parse information before insertion,
or after retrieval in order to display it, wastes far
more resources than storing dates in a format other than
an int.



 Mike Robinson
 IT / Developer - Toronto Star TV
 Phone: 416.945.8786
 Fax: 416.869.4566
 Email: [EMAIL PROTECTED]



> -Original Message-
> From: Mike Frazer [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, October 24, 2001 8:54 AM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: [PHP-DEV] Re: [PHP-DB] PHP and MySQL queries...
> 
> 
> Agreed.  This is especially useful when you need to conserve 
> every byte you
> can; a timestamp of "10/24/2001" or something similar is 
> going to take 10
> bytes as a string and an indeterminate number of bytes for an actual
> timestamp because of system variations, whereas an integer 
> value of 10242001
> will take you 2-4 bytes depending on the type of int you 
> declare.  Not a lot
> of space, but assume for a second you have 30 fields in your 
> database and 5
> million rows...suddenly those 6-8 bytes have multiplied on 
> this one field
> alone.  Space and speed are important in DBs :)
> 
> Mike Frazer
 




http://www.torontostartv.com - Webcasting & Production
http://www.tmgtv.ca - Hometown Television
http://www.thestar.com - Canada’s largest daily newspaper, The Toronto Star, online



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


RE: [PHP-DB] Using A Query Results Multiple Times

2001-10-24 Thread Adam Douglas

Yes, I had the right code just was missing the mysql_data_seek. Thanks for
the help.


> -Original Message-
> From: Rick Emery [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, October 23, 2001 1:09 PM
> To: 'Adam Douglas'; PHP-DB (mailing list) (E-mail)
> Subject: RE: [PHP-DB] Using A Query Results Multiple Times
> 
> 
> You're on the right track.  Did you try?:
> 
> while( $row[] = mysql_fetch_array($result) );
> 
> This should load each result row into a row of a 
> multi-dimensional array.
> 
> You would then access it with:
> 
> $row[0]['colname']
> 
> -Original Message-
> From: Adam Douglas [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, October 23, 2001 1:48 PM
> To: PHP-DB (mailing list) (E-mail); PHP-General (mailing 
> list) (E-mail)
> Subject: [PHP-DB] Using A Query Results Multiple Times
> 
> 
>   I have an instance where I have to query my MySQL 
> database and then
> use the multiple row results to create multiple pull down 
> menus on a web
> page. My problem is how can I take the results of the query 
> and use them
> more the once to create pull down menus? I've always used a 
> while look to
> fetch each row of the results and have it create the pull 
> down menu as it
> goes through each row. But doing it this way only stores one 
> row of results
> in a variable. Is there a way I can grab all the results from 
> a query that
> would go into an array so I could use it multiple times? I've looking
> briefly for a function to MySQL that would allow me to do 
> this but haven't
> found anything unless I misunderstand mysql_fetch_array 
> function. At first I
> thought I could loop through my while loop and have it put 
> the results from
> the query of each row in to a multidimensional array. But 
> then how would I
> add to the array after the initial row?
> 
> BTW, I'm using PHP 3.0.16 so I can't use the added array 
> functions that
> PHP 4 has. I do plan on upgrading soon.
> 
> 
> -- 
> 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 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 will only work with anonymous (IUSR_XXX) user

2001-10-24 Thread Duane Cox

I have my php script working correctly with IIS 5 and SQL 7 (2 seperate
machines) as long as the user is anonymous. (the page is running as
IUSR_XXX)
But if you require the user to login, and use a username... even
administrator, the php will return " can not connect to database"

Help please

Duane Cox
[EMAIL PROTECTED]




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

2001-10-24 Thread gerald . clerc

how can i select records from mysql and store them in a text or 
spreadsheet file format?

thanks for reply

php 4 on win32

gerald clerc


RE: [PHP-DB] export

2001-10-24 Thread Rick Emery

Do you mean via PHP or directly at the MySQL command line?

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, October 24, 2001 10:12 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] export


how can i select records from mysql and store them in a text or 
spreadsheet file format?

thanks for reply

php 4 on win32

gerald clerc


-- 
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] it works but i don't uderstand

2001-10-24 Thread Bas Jobsen

Hello,

I'm building some database class, so i can reuse my code when using a not
mysql database system.

I'm implementing a free_result now;

some code of my class

class database
{

function free_result($result)
{
mysql_free_result($result);
return;
}
..
}
?>

some of the code:

include ("class_mysql.php");
$db= new database();
$db->connect();
$result=$db->select_query("SELECT * FROM users");
echo mysql_num_rows($result);
$db->free_result($result);
echo mysql_num_rows($result);

Running this will give:
2 and "Warning: 2 is not a valid MySQL result resource"
So this seems to work, but why? Why is $result handled as it is a global
var?

I should think it must be something like:

function free_result(&$result)
{
mysql_free_result($result);
return;
}

But this don't work.

Thanks,

Bas




-- 
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] Re: Html email

2001-10-24 Thread Jason Wood

Hello-
I've always had this type of mail statement work for me:

mail($to, $Subject, $Body, "From: $From\r\nContent-Type: text/html;
charset=iso-8859-1");

My guess is that Outlook doesnt know what to do with the header you're
sending it (maybe too much info for outlook??)...
Other than that I've got no idea =)


--
Jason Wood
Chief Technology Officer
Expressive Tek, Inc.
407 Kehrs Mill Road
Ballwin, MO 63011
Phone 636.256.1362
www.expressivetek.com



"Benny" <[EMAIL PROTECTED]> wrote in message
001501c15c1d$7f2f5560$0b01a8c0@ISKAT">news:001501c15c1d$7f2f5560$0b01a8c0@ISKAT...
>
> Please help me. I have problem with html email. I send email to 3 email
> address : [EMAIL PROTECTED], [EMAIL PROTECTED] and [EMAIL PROTECTED]
>
> The email client for yahoo & eudoramail is their web. And for the last
> destination, the email client is ms outlook.
>
> The html email for yahoo & eudoramail are well received. But for the
> last destination the ms outlook display the wrong result like encrypted
> text. Below is my code and the result in ms outlook.
>
> My code :
>
> $s_to = '[EMAIL PROTECTED]';
> $s_subject = 'Subject xxx';
> $s_headers = "From: [EMAIL PROTECTED]\r\n";
> $s_headers .= "MIME-Version: 1.0\r\n";
> $s_boundary = uniqid("id");
> $s_headers .= "Content-Type: multipart/alternative" .
>"; boundary = $s_boundary\r\n\r\n";
> $s_headers .= "This is a MIME encoded message.\r\n\r\n";
>
> $s_headers .= "--$s_boundary\r\n" .
> $s_headers .=   "Content-Type: text/html; charset=\"iso-8859-1\"\r\n" .
>"Content-Transfer-Encoding: base64\r\n\r\n";
>
> $s_headers2 = chunk_split(base64_encode("bla...bla..."bla..."));
> $s_headers = $s_headers.$s_headers2.'--'.$s_boundary.'--';
> @mail ($s_to, $s_subject,"", $s_headers);
>
>
>
> Result in ms outlook :
>
> Return-Path: <[EMAIL PROTECTED]>
> Delivered-To: [EMAIL PROTECTED]
> Received: (qmail 2773 invoked by uid 252); 22 Oct 2001 23:35:00 -
> Date: 22 Oct 2001 23:35:00 -
> Message-ID: <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: Subject xxx
> From: [EMAIL PROTECTED]
> MIME-Version: 1.0
> Content-Type: multipart/alternative; boundary = id3bd4ad2486465 This is
> a MIME encoded message.
>
>
> --id3bd4ad2486465
> Content-Type: text/html; charset="iso-8859-1"
> Content-Transfer-Encoding: base64
>
>
> PGZvbnQgZmFjZT0iVmVyZGEhlbHZldGljYSwgc2Fucy1zZXJpZiIgc2l6ZT0i
>
> aXY+PC9mb250C90cj48L3RhYmxlPg==
>
> --id3bd4ad2486465--
>
>
> Regards;
>
> Benny.
>
>



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




Re: [PHP-DB] Re: Html email

2001-10-24 Thread Richard S. Crawford

Chances are that Outlook is just looking for some Outlook-only headers.  I 
wound up using the MIME::Lite Perl module when creating a program to send 
HTML-enabled e-mail.

How about a vote: who else thinks that HTML e-mail just plain sucks?

At 08:56 AM 10/24/2001, Jason Wood wrote:
>My guess is that Outlook doesnt know what to do with the header you're
>sending it (maybe too much info for outlook??)...
>Other than that I've got no idea =)


Sliante,
Richard S. Crawford

http://www.mossroot.com
mailto:[EMAIL PROTECTED]
AIM: Buffalo2K   ICQ: 11646404  Y!: rscrawford
"It is only with the heart that we see rightly; what is essential is 
invisible to the eye."  --Antoine de Saint Exupéry

"Push the button, Max!"


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

2001-10-24 Thread Terry Romine

I have a small situation where it would be good to be able to embed a 
perl routing in a php script. Is this possible? Or do I need to pass 
control from php to a perl script and return?

A quick synopsis would be (in pseudo code)




Alternatively, is there a module that can take a pdf file and make a 
thumbnail of the first page?


Thanks,
Terry


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




Re: [PHP-DB] Embedding Perl

2001-10-24 Thread Andrey Hristov

: There is a solution but I don't know how good is it?
I'm not sure but the name of the project is PHPerl or something about it.


-- 
Andrey Hristov
Web Developer
Icygen Corporation
BUILDING SOLUTIONS
http://www.icygen.com

On Wednesday 24 October 2001 12:05 pm, you wrote:
> I have a small situation where it would be good to be able to embed a
> perl routing in a php script. Is this possible? Or do I need to pass
> control from php to a perl script and return?
>
> A quick synopsis would be (in pseudo code)
>
>if($theFileType == "pdf" {
>   // call convert.pl to get a thumbnail
>   }
>   else {
>   // other file type processing
>   }
> ?>
>
>
> Alternatively, is there a module that can take a pdf file and make a
> thumbnail of the first page?
>
>
> Thanks,
> Terry


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

2001-10-24 Thread Harpreet

I am using concat in my sql and it runs fine on mysql client. But when used
in php it gives me an error:
Supplied argument is not a valid MySQL result resource in
/var/www/html/scripts/cfg_code_delete.php on line <


$ssql="select concat(category, "-", code) as fill_column, code_id as
submit_column from sys_code_tbl order by category";
echo "";
$result = mysql_query($ssql);
while ($row = mysql_fetch_array($result))
  {
  echo "'".$row["fill_column"]."'";
  }

Help is appreciated.

Regards,
Harpreet Kaur
Software Developer
Crispin Corporations Inc.


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




Re: [PHP-DB] Concatenating fields

2001-10-24 Thread Richard S. Crawford

Try escaping the quotes:

$ssql="select concat(category, \"-\", code) as ..."

Either that, or try surrounding the - with single quotes, as in '-'.

What's probably happening is that the query is being rendered as "select 
concat (category, ", which isn't a valid query.


At 10:15 AM 10/24/2001, you wrote:
>I am using concat in my sql and it runs fine on mysql client. But when used
>in php it gives me an error:
>Supplied argument is not a valid MySQL result resource in
>/var/www/html/scripts/cfg_code_delete.php on line <
>
>
>$ssql="select concat(category, "-", code) as fill_column, code_id as
>submit_column from sys_code_tbl order by category";
>echo "";
>$result = mysql_query($ssql);
>while ($row = mysql_fetch_array($result))
>   {
>   echo "value='".$row["submit_column"]."'>'".$row["fill_column"]."'";
>   }
>
>Help is appreciated.
>
>Regards,
>Harpreet Kaur
>Software Developer
>Crispin Corporations Inc.
>
>
>--
>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]


Sliante,
Richard S. Crawford

http://www.mossroot.com
mailto:[EMAIL PROTECTED]
AIM: Buffalo2K   ICQ: 11646404  Y!: rscrawford
"It is only with the heart that we see rightly; what is essential is 
invisible to the eye."  --Antoine de Saint Exupéry

"Push the button, Max!"


--
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] W2k IIS PHP Paradox (PARADOX.NET., SQL state S1000 in SQLConnect)

2001-10-24 Thread Bruno Gimenes Pereti

Hi,

I have a php web page that query a paradox DB (via odbc) and show me the
information I need. It's running on Windows 2000 server with IIS 5.0 and PHP
4.0.6. Today morning I installed SevicePack 2 and hotfix
q300972_W2k_sp3_x86_br.exe and my php can't access the paradox DB. The error
is:

Warning: SQL error: [Microsoft][Driver ODBC para Paradox] Não foi possível
abrir PARADOX.NET., SQL state S1000 in SQLConnect in
c:\inetpub\wwwroot\zeus.php on line 2

hhmm... In english: [.snip.] Can't open PARADOX.NET., [.snip.]
There is no PARADOX.NET file in my system.

Does any one have an idea how can I resolve this. I you need more
information please tell me.

Thank you.

Bruno Gimenes Pereti.


-- 
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] RE:PHP and SNMP please help.

2001-10-24 Thread buckwheat

I have the following installed on RH 7.1
php-4.0.4pl1-9
php-ldap-4.0.4pl1-9
php-manual-4.0.4pl1-9
php-common-4.0.5-0.3
php-imap-4.0.4pl1-9
php-mysql-4.0.4pl1-9
ucd-snmp-devel-4.2-12
ucd-snmp-4.2-12
ucd-snmp-utils-4.2-12

and I cannot seem to use the PHP  snmpget() commands
this is a sample php_test.php file





PHP Test






I get the following responce

Fatal error: Call to undefined function: snmpget() in
/var/www/html/root/php_test.php on line 9

please help





-- 
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] PhpLib, PEAR DB, Metabase, ADODB and Native MySQL benchmarks

2001-10-24 Thread John Lim

Someone asked me to benchmark PHPLib also.
Here is the revised benchmarks, with some minor speedups for
PEAR DB and Metabase.

Benchmark was to select 82 rows from the products table 200 times.
The tests were repeated 5 times. Connection times were excluded
from the benchmark. Lower values are better. All numbers are in
seconds.

MySQL  1.12 1.12 1.17 1.15 1.14
ADODB  1.43 1.47 1.47 1.44 1.45
PhpLib 1.53 1.62 1.64 1.64 1.57
PEAR   2.91 2.90 2.85 2.83 2.84 (fetchInto)
PEAR   3.14 3.13 3.22 3.12 3.16 (fetchRow)
M'base 4.51 4.55 4.46 4.54 4.52 (numeric columns)
M'base 4.99 4.72 4.71 4.71 4.72 (named columns)

  Average  Overhead
MySQL  1.14   -
ADODB  1.45   27%
PhpLib 1.60   40%
PEAR   2.87  152% (fetchInto)
PEAR   3.15  176% (fetchRow)
M'base 4.52  296% (numeric cols)
M'base 4.77  318% (named cols)

Methodology

Results on Pentium 800 Mhz running Win 2000, PHP 4.0.6 ISAPI on IIS5
with MySQL 3.23, all on the same machine. PEAR DB from PHP 4.0.6,
ADODB 1.40, PhpLib 7.2d and Metabase 1.57 were used.

Code revised on 22nd October 2001. PhpLib tests added 24th October 2001.

Source code for these tests is available from http://phplens.com/lens/adodb/









-- 
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] ERWin 3.5.2 and MySQL

2001-10-24 Thread Adv. Systems Design

Is there anyone using ERWin 3.5.2 to design/maintain
data dictionaries/schema for MySQL db's?

I would like to hear from you what kinds of strategies
you are using...

Thanks

Luis

__
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com

-- 
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] Re: Newbie in Need of Assistance

2001-10-24 Thread Carlos Augusto Abarca

It´s very easy and to tell you the truth I descovered it by accident:

Lets say you have a variable with the dynamic variable name (ej. $var_name =
"game1";)

if you want to create this variable ($game1) then you can write:
$$var_name
And that´s it.

try it.

"Jmack" <[EMAIL PROTECTED]> escribió en el mensaje
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Greetings.  I have been playing around with PHP this week, programming a
> football pool.  I have hit a small snag that I would like some assistance
> with, if anyone knows the answer -- it's probably very simple, but my
Intro
> to PHP book does not tell me how to do it.
>
> I have an HTML form in a PHP page, with several controls on it.  I am
> dynamically generating the names for these controls.  Here is the
example --
> for each game, the user selects the winner in a  control.  It's
set
> up to not care how many games there are for each week, just dynamically
> build the form/controls and name them "pick1", "pick2", etc.
>
> In my function that handles the form and uploads the user's picks to the
> database (MySQL), I need to also dynamically generate the variable names
> that refer to these controls.  I have them all declared as global
variables,
> since I know there will never be more than 15 games in a given week.  But,
I
> want to iterate through a loop for each game and update the database.  As
I
> loop through for each game, and try to dynamically generate the vaiable
> names for $pick1, $pick2, etc.  I end up trying to update the DB by
sending
> in the string "$pick1" instead of the value from the form control for
pick1.
>
> I have attached the PHP file in question.  The code is not very clean,
> especially the part where I am having problems, but hopefully, someone
will
> have some time to help me with this problem.  Please respond to this
> newsgroup or directly to me at [EMAIL PROTECTED]  Thank you.
>
> Joe Mack
>
>
>
>



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




Re: [PHP-DB] array-problems

2001-10-24 Thread Bruno Gimenes Pereti

It looks like you need only one array, $date[begin] = $date[end].
Let's see, I think it'll work. I'll write it in your code then you try:

$i=0;
$result = mysql_query ("SELECT DISTINCT date FROM linktracker WHERE name
LIKE '$PHP_AUTH_USER' ORDER BY date");
if ($row = mysql_fetch_array($result)) {
  do {
$date[$i] = $row["date"]);
$i++;
  } while ($row = mysql_fetch_array($result));
} else {print ("Sorry, no record were found.");
} file://end else $result

print("BegindateEnddate\n".
"".
"".
"");

$i = 0;
while ($date[$i]) {
  echo "" . $date_begin .
  "\n";
  $i++;
}

print("");

$i--;
while ($date[$i]) {
  echo "" . $date_end .
  "\n";
  $i--;
}

print("\n".
"".
"");

mysql_free_result ($result);
mysql_close();


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




Re: [PHP-DB] array-problems

2001-10-24 Thread Jim Lucas


- Original Message -
From: "Jim Lucas" <[EMAIL PROTECTED]>
To: "Bart Verbeek" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, October 24, 2001 12:42 PM
Subject: Re: [PHP-DB] array-problems


> Try this:
>
> <<< BEGIN:PHP-CODE >>>
>
> $result = mysql_query ("SELECT DISTINCT date FROM linktracker WHERE name
> LIKE '$PHP_AUTH_USER' GROUP BY date ORDER BY date");
> if (mysql_num_rows($result))
> {
>   for($i=0;$i   {
> $date = array(
>   "begin" => array($i => $row["date"]),
>   "end" => array($i => $row["date"])
>   );
>   }
> } else {
>   print ("Sorry, no record were found.");
> }
>
> function drawSelect($which)
> {
>   global $date;
>   foreach($date[$which] AS $date_begin)
>   {
> ?>
> 
>}
>
> }
>
> ?>
> 
>   
> Begindate
> Enddate
>   
>   
> 
> 
> 
>  drawSelect("begin");
> ?>
> 
> 
> 
>  rsort($date[end]);
>
> drawSelect("end");
> ?>
> 
> 
>   
>   
>  value="Submit">
>   
>
> <<< END:PHP-CODE >>>
>
> btw - you need to watch your closing '>'  you are missing a few.  Plus to
> get distince to work right you need to use the "GROUP BY" clause.
>
> Jim
>
> - Original Message -
> From: "Bart Verbeek" <[EMAIL PROTECTED]>
> To: "Php-General-list" <[EMAIL PROTECTED]>; "PHP-DB mailinglist"
> <[EMAIL PROTECTED]>
> Sent: Wednesday, October 24, 2001 12:23 PM
> Subject: [PHP-DB] array-problems
>
>
> > Hello,
> > Can anyone help me with this script I'm using?
> >
> > I've saved dates in a database and want to make two select-lists of
these
> > dates in a html-form.
> > I want to select each unique date one time (no doubles).
> > List 1 is used to set the begin-date of the query for the report, List 2
> > will
> > set the end-date and must be reversed.
> > When the form is processed the data selected between the begin-date and
> the
> > end-date has to be show.
> >
> > I can't seem to get my code to work: the select-lists stay empty after
> > processing the code below.
> >
> > Can anyone help? Tips...
> >
> > regards,
> >
> > Bart
> >
> >
> > <<< BEGIN:PHP-CODE >>>
> > $i=0;
> >  $result = mysql_query ("SELECT DISTINCT date FROM linktracker WHERE
name
> > LIKE '$PHP_AUTH_USER' ORDER BY date");
> >  if ($row = mysql_fetch_array($result)) {
> > do {
> >   $date = array(
> > "begin" => array($i => $row["date"]),
> > "end" => array($i => $row["date"])
> > );
> > $i++;
> > } while ($row = mysql_fetch_array($result));
> >  } else {print ("Sorry, no record were found.");
> >  } //end else $result
> >
> > print("BegindateEnddate\n".
> > " > name=\"date_select\">".
> > " > value=\"date_select\">".
> > "");
> >
> > while (list($key, $date_begin) = each($date[begin])) {
> > echo "" . $date_begin .
> > "\n";
> > }
> >
> > print("");
> >
> > rsort($date[end]);
> >
> > while (list($key, $date_end) = each($date[end])) {
> >   echo "" . $date_end .
> > "\n";
> > }
> >
> > print("\n".
> >   "".
> >   "");
> >
> > mysql_free_result ($result);
> > mysql_close();
> > <<< END:PHP-CODE >>>
> >
> >
> > --
> > 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 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]




Re: [PHP-DB] Embedding Perl

2001-10-24 Thread Terry Romine

Ok, I found snippets that talk about using either exec() or backticks. 
The problem is that it still doesn't call the perl script. Or at least 
doesn't seem to.

exec("convert-pdf.pl Blank.gif",$out);
echo(implode("\n",$out));
$out = `convert-pdf.pl Blank.gif`;
echo($out);

If I run
perl convert-pdf.pl Blank.gif
from the shell, it responds with 135x105 and creates a secondary file. 
This is what the script is meant to do. Calling it in either of the 
example above, results in either an Array or nothing being displayed. No 
secondary file gets created.


On Wednesday, October 24, 2001, at 11:05 AM, Terry Romine wrote:

> I have a small situation where it would be good to be able to embed a 
> perl routing in a php script. Is this possible? Or do I need to pass 
> control from php to a perl script and return?
>
> A quick synopsis would be (in pseudo code)
>
>if($theFileType == "pdf" {
>   // call convert.pl to get a thumbnail
>   }
>   else {
>   // other file type processing
>   }
> ?>
>
>
> Alternatively, is there a module that can take a pdf file and make a 
> thumbnail of the first page?
>
>
> Thanks,
> Terry


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




Re: [PHP-DB] Embedding Perl

2001-10-24 Thread Sheridan Saint-Michel

You have to put the actual command in the exec or backticks as you would
type it in your shell, not just the filename.  So instead of

$out = `convert-pdf.pl Blank.gif`;

Try

$out = `perl convert-pdf.pl Blank.gif`;

Sheridan Saint-Michel
Website Administrator
FoxJet, an ITW Company
www.foxjet.com


- Original Message -
From: "Terry Romine" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, October 24, 2001 3:23 PM
Subject: Re: [PHP-DB] Embedding Perl


> Ok, I found snippets that talk about using either exec() or backticks.
> The problem is that it still doesn't call the perl script. Or at least
> doesn't seem to.
>
> exec("convert-pdf.pl Blank.gif",$out);
> echo(implode("\n",$out));
> $out = `convert-pdf.pl Blank.gif`;
> echo($out);
>
> If I run
> perl convert-pdf.pl Blank.gif
> from the shell, it responds with 135x105 and creates a secondary file.
> This is what the script is meant to do. Calling it in either of the
> example above, results in either an Array or nothing being displayed. No
> secondary file gets created.
>
>
> On Wednesday, October 24, 2001, at 11:05 AM, Terry Romine wrote:
>
> > I have a small situation where it would be good to be able to embed a
> > perl routing in a php script. Is this possible? Or do I need to pass
> > control from php to a perl script and return?
> >
> > A quick synopsis would be (in pseudo code)
> >
> >  > if($theFileType == "pdf" {
> > // call convert.pl to get a thumbnail
> > }
> > else {
> > // other file type processing
> > }
> > ?>
> >
> >
> > Alternatively, is there a module that can take a pdf file and make a
> > thumbnail of the first page?
> >
> >
> > Thanks,
> > Terry
>
>
> --
> 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 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] MySQL Last Modified

2001-10-24 Thread Sheridan Saint-Michel

Is there any way to tell when a TABLE in MySQL was last modified?
I don't want to add a timestamp field as there are thousands of rows, 
and I just need to know when ANYTHING in the table was last modified.

I haven't been able to find anything on this, and thought I would ask before
kludging together a workaround  =P

Sheridan Saint-Michel
Website Administrator
FoxJet, an ITW Company
www.foxjet.com



RE: [PHP-DB] MySQL Last Modified

2001-10-24 Thread Rick Emery

MySQL command:  show table status

This command returns multiple fields, including date/time of last update,
for each table in the selected database.
Call it with mysql_query("show table status")

Check the MySQL manual for more information

-Original Message-
From: Sheridan Saint-Michel [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, October 24, 2001 4:07 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] MySQL Last Modified


Is there any way to tell when a TABLE in MySQL was last modified?
I don't want to add a timestamp field as there are thousands of rows, 
and I just need to know when ANYTHING in the table was last modified.

I haven't been able to find anything on this, and thought I would ask before
kludging together a workaround  =P

Sheridan Saint-Michel
Website Administrator
FoxJet, an ITW Company
www.foxjet.com


-- 
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] Hmmm? PHP+PostgreSQL

2001-10-24 Thread Alexey Prohorenko

I've installed PostgreSQL into /usr/local/pgsql, then I tried
to include into my PHP support for PostgreSQL and made next:
(I had pre-compiled support for mySQL before that)

make clean
./configure --with-apxs=/usr/local/apache/bin/apxs --enable-versioning 
--enable-track-vars --with-pgsql --with-mysql
make
make install

(I have mySQL, too)
Compilation process was great, no errors. 
Nevertheless, next little PHP script:



testing needed functions of current-gtlg with PHP+PostgreSQL






still says:
Fatal error: Call to undefined function: pg_connect() in 
/usr/local/apache/htdocs/pg-php/index.php on line 7

What I did wrong, guys?

Will be looking forward your answer,
please, CC: to [EMAIL PROTECTED]

Thanks.

-- 
green
[http://www.extrasy.net] 

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




Re: [PHP-DB] Hmmm? PHP+PostgreSQL

2001-10-24 Thread Meir Kriheli

On Wednesday 24 October 2001 23:21, Alexey Prohorenko wrote:
> I've installed PostgreSQL into /usr/local/pgsql, then I tried
>   to include into my PHP support for PostgreSQL and made next:
>   (I had pre-compiled support for mySQL before that)
>
> make clean
> ./configure --with-apxs=/usr/local/apache/bin/apxs --enable-versioning
> --enable-track-vars --with-pgsql --with-mysql make

> make install

Did you restart apache after the installation ?
You can also try to compile with --with-pgsql=/usr/local/pgsql

--
Meir Kriheli

>   (I have mySQL, too)
>   Compilation process was great, no errors.
>   Nevertheless, next little PHP script:
>
> 
> 
> testing needed functions of current-gtlg with PHP+PostgreSQL
> 
> 
>  $conn = pg_connect ("host=localhost port=5432 dbname=test user=postgres");
> ?>
> 
> 
>
>   still says:
> Fatal error: Call to undefined function: pg_connect() in
> /usr/local/apache/htdocs/pg-php/index.php on line 7
>
>   What I did wrong, guys?
>
>   Will be looking forward your answer,
>   please, CC: to [EMAIL PROTECTED]
>
>   Thanks.

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




RE: [PHP-DB] Re: Newbie in Need of Assistance

2001-10-24 Thread Beau Lebens

carols - true, but to avoid confusion and problem sif your names get more
complex (i.e. i think $$some_name will go crazy, you should always do it
like this

$var_name = "game1";
${$var_name}

cheers guys


// -Original Message-
// From: Carlos Augusto Abarca [mailto:[EMAIL PROTECTED]]
// Sent: Thursday, 25 October 2001 3:19 AM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] Re: Newbie in Need of Assistance
// 
// 
// It´s very easy and to tell you the truth I descovered it by accident:
// 
// Lets say you have a variable with the dynamic variable name 
// (ej. $var_name =
// "game1";)
// 
// if you want to create this variable ($game1) then you can write:
// $$var_name
// And that´s it.
// 
// try it.
// 
// "Jmack" <[EMAIL PROTECTED]> escribió en el mensaje
// [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
// > Greetings.  I have been playing around with PHP this week, 
// programming a
// > football pool.  I have hit a small snag that I would like 
// some assistance
// > with, if anyone knows the answer -- it's probably very 
// simple, but my
// Intro
// > to PHP book does not tell me how to do it.
// >
// > I have an HTML form in a PHP page, with several controls 
// on it.  I am
// > dynamically generating the names for these controls.  Here is the
// example --
// > for each game, the user selects the winner in a  
// control.  It's
// set
// > up to not care how many games there are for each week, 
// just dynamically
// > build the form/controls and name them "pick1", "pick2", etc.
// >
// > In my function that handles the form and uploads the 
// user's picks to the
// > database (MySQL), I need to also dynamically generate the 
// variable names
// > that refer to these controls.  I have them all declared as global
// variables,
// > since I know there will never be more than 15 games in a 
// given week.  But,
// I
// > want to iterate through a loop for each game and update 
// the database.  As
// I
// > loop through for each game, and try to dynamically 
// generate the vaiable
// > names for $pick1, $pick2, etc.  I end up trying to update the DB by
// sending
// > in the string "$pick1" instead of the value from the form 
// control for
// pick1.
// >
// > I have attached the PHP file in question.  The code is not 
// very clean,
// > especially the part where I am having problems, but 
// hopefully, someone
// will
// > have some time to help me with this problem.  Please 
// respond to this
// > newsgroup or directly to me at [EMAIL PROTECTED]  Thank you.
// >
// > Joe Mack
// >
// >
// >
// >
// 
// 
// 
// -- 
// 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 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]




Re: [PHP-DB] Hmmm? PHP+PostgreSQL

2001-10-24 Thread Daniel Barton

Have you checked if all modules are being loaded (obviously, PHP is being loaded into 
apache...but
is PHP loading mysql.so and pgsql.so?

Cheers,
Dan

Alexey Prohorenko wrote:

> I've installed PostgreSQL into /usr/local/pgsql, then I tried
> to include into my PHP support for PostgreSQL and made next:
> (I had pre-compiled support for mySQL before that)
>
> make clean
> ./configure --with-apxs=/usr/local/apache/bin/apxs --enable-versioning 
>--enable-track-vars --with-pgsql --with-mysql
> make
> make install
>
> (I have mySQL, too)
> Compilation process was great, no errors.
> Nevertheless, next little PHP script:
>
> 
> 
> testing needed functions of current-gtlg with PHP+PostgreSQL
> 
> 
>  $conn = pg_connect ("host=localhost port=5432 dbname=test user=postgres");
> ?>
> 
> 
>
> still says:
> Fatal error: Call to undefined function: pg_connect() in 
>/usr/local/apache/htdocs/pg-php/index.php on line 7
>
> What I did wrong, guys?
>
> Will be looking forward your answer,
> please, CC: to [EMAIL PROTECTED]
>
> Thanks.
>
> --
> green
> [http://www.extrasy.net]
>
> --
> 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]

--
--
Dan Barton
Terrestrial Program Biologist
Asst. Data Manager
Point Reyes Bird Observatory
http://www.prbo.org
[EMAIL PROTECTED]
[EMAIL PROTECTED]



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




RE: [PHP-DB] Using A Query Results Multiple Times

2001-10-24 Thread Adam Douglas

Thanks for the help. I had all the code right just had to add the
mysql_data_seek. Wasn't aware it operated in this manner.


> -Original Message-
> From: Peter Lovatt [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, October 23, 2001 3:41 PM
> To: Adam Douglas; PHP-DB (mailing list) (E-mail); PHP-General (mailing
> list) (E-mail)
> Subject: RE: [PHP-DB] Using A Query Results Multiple Times
> 
> 
> Hi
> 
> while(...)
> {
> do whatever
> }
> 
> mysql_data_seek ($mysqlresultid, 0)
> 
> while(...)
> {
> do whatever
> }
> 
> mysql_data_seek ($mysqlresultid, 0)
> etc
> 
> will set the pointer back to the beginning of the result set, 
> so you can
> scan through it as many times as you need to, without needing 
> to repeat the
> query.
> 
> 
> HTH
> 
> Peter
> 
> > -Original Message-
> > From: Adam Douglas [mailto:[EMAIL PROTECTED]]
> > Sent: 23 October 2001 19:48
> > To: PHP-DB (mailing list) (E-mail); PHP-General (mailing 
> list) (E-mail)
> > Subject: [PHP-DB] Using A Query Results Multiple Times
> >
> >
> > I have an instance where I have to query my MySQL 
> database and then
> > use the multiple row results to create multiple pull down 
> menus on a web
> > page. My problem is how can I take the results of the query 
> and use them
> > more the once to create pull down menus? I've always used a 
> while look to
> > fetch each row of the results and have it create the pull 
> down menu as it
> > goes through each row. But doing it this way only stores one row
> > of results
> > in a variable. Is there a way I can grab all the results 
> from a query that
> > would go into an array so I could use it multiple times? 
> I've looking
> > briefly for a function to MySQL that would allow me to do 
> this but haven't
> > found anything unless I misunderstand mysql_fetch_array function.
> > At first I
> > thought I could loop through my while loop and have it put the
> > results from
> > the query of each row in to a multidimensional array. But 
> then how would I
> > add to the array after the initial row?
> >
> > BTW, I'm using PHP 3.0.16 so I can't use the added array
> > functions that
> > PHP 4 has. I do plan on upgrading soon.
> >
> >
> > --
> > 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 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]




Re: [PHP-DB] Re: Html email

2001-10-24 Thread Andrey Hristov

H, try not to set your encoding to base64. I think that Outlooks works 
find and decodes the base64 stream but this stream is a normal text, so with 
this in header you make obfuscating. You pass "fox jumps over a lazy dog" and 
Outlook thinks that is base64, so it decodes to "blablaba...".

-- 
Andrey Hristov
Web Developer
Icygen Corporation
BUILDING SOLUTIONS
http://www.icygen.com


-=-=-=--==--==--=-=-=-=-=-=-=-=-=-==--=-=-=-=-==--=-=
Hello-
    I've always had this type of mail statement work for me:

mail($to, $Subject, $Body, "From: $From\r\nContent-Type: text/html;
charset=iso-8859-1");

My guess is that Outlook doesnt know what to do with the header you're
sending it (maybe too much info for outlook??)...
Other than that I've got no idea =)


--
Jason Wood
Chief Technology Officer
Expressive Tek, Inc.
407 Kehrs Mill Road
Ballwin, MO 63011
Phone 636.256.1362
www.expressivetek.com



"Benny" <[EMAIL PROTECTED]> wrote in message
001501c15c1d$7f2f5560$0b01a8c0@ISKAT">news:001501c15c1d$7f2f5560$0b01a8c0@ISKAT...
>
> Please help me. I have problem with html email. I send email to 3 email
> address : [EMAIL PROTECTED], [EMAIL PROTECTED] and [EMAIL PROTECTED]
>
> The email client for yahoo & eudoramail is their web. And for the last
> destination, the email client is ms outlook.
>
> The html email for yahoo & eudoramail are well received. But for the
> last destination the ms outlook display the wrong result like encrypted
> text. Below is my code and the result in ms outlook.
>
> My code :
>
> $s_to = '[EMAIL PROTECTED]';
> $s_subject = 'Subject xxx';
> $s_headers = "From: [EMAIL PROTECTED]\r\n";
> $s_headers .= "MIME-Version: 1.0\r\n";
> $s_boundary = uniqid("id");
> $s_headers .= "Content-Type: multipart/alternative" .
>    "; boundary = $s_boundary\r\n\r\n";
> $s_headers .= "This is a MIME encoded message.\r\n\r\n";
>
> $s_headers .= "--$s_boundary\r\n" .
> $s_headers .=   "Content-Type: text/html; charset=\"iso-8859-1\"\r\n" .
>    "Content-Transfer-Encoding: base64\r\n\r\n";
>
> $s_headers2 = chunk_split(base64_encode("bla...bla..."bla..."));
> $s_headers = $s_headers.$s_headers2.'--'.$s_boundary.'--';
> @mail ($s_to, $s_subject,"", $s_headers);
>
>
>
> Result in ms outlook :
>
> Return-Path: <[EMAIL PROTECTED]>
> Delivered-To: [EMAIL PROTECTED]
> Received: (qmail 2773 invoked by uid 252); 22 Oct 2001 23:35:00 -
> Date: 22 Oct 2001 23:35:00 -
> Message-ID: <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: Subject xxx
> From: [EMAIL PROTECTED]
> MIME-Version: 1.0
> Content-Type: multipart/alternative; boundary = id3bd4ad2486465 This is
> a MIME encoded message.
>
>
> --id3bd4ad2486465
> Content-Type: text/html; charset="iso-8859-1"
> Content-Transfer-Encoding: base64
>
>
> PGZvbnQgZmFjZT0iVmVyZGEhlbHZldGljYSwgc2Fucy1zZXJpZiIgc2l6ZT0i
>
> aXY+PC9mb250C90cj48L3RhYmxlPg==
>
> --id3bd4ad2486465--
>
>
> Regards;
>
> Benny.
>
>



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

2001-10-24 Thread Bart Verbeek

Hello,
Can anyone help me with this script I'm using?

I've saved dates in a database and want to make two select-lists of these
dates in a html-form.
I want to select each unique date one time (no doubles).
List 1 is used to set the begin-date of the query for the report, List 2
will
set the end-date and must be reversed.
When the form is processed the data selected between the begin-date and the
end-date has to be show.

I can't seem to get my code to work: the select-lists stay empty after
processing the code below.

Can anyone help? Tips...

regards,

Bart


<<< BEGIN:PHP-CODE >>>
$i=0;
 $result = mysql_query ("SELECT DISTINCT date FROM linktracker WHERE name
LIKE '$PHP_AUTH_USER' ORDER BY date");
 if ($row = mysql_fetch_array($result)) {
do {
  $date = array(
"begin" => array($i => $row["date"]),
"end" => array($i => $row["date"])
);
$i++;
} while ($row = mysql_fetch_array($result));
 } else {print ("Sorry, no record were found.");
 } //end else $result

print("BegindateEnddate\n".
"".
"".
"");

while (list($key, $date_begin) = each($date[begin])) {
echo "" . $date_begin .
"\n";
}

print("");

rsort($date[end]);

while (list($key, $date_end) = each($date[end])) {
  echo "" . $date_end .
"\n";
}

print("\n".
  "".
  "");

mysql_free_result ($result);
mysql_close();
<<< END:PHP-CODE >>>


-- 
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] Re: [PHP] Using A Query Results Multiple Times

2001-10-24 Thread Christian Reiniger

On Tuesday 23 October 2001 20:47, Adam Douglas wrote:

> mysql_fetch_array function. At first I thought I could loop through my
> while loop and have it put the results from the query of each row in to
> a multidimensional array. But then how would I add to the array after
> the initial row?

while ($row = mysql_fetch_array (...))
{
   $MyArray[] = $row;
}

Look up arrays in the manual

-- 
Christian Reiniger
LGDC Webmaster (http://lgdc.sunsite.dk/)

Very funny, Scotty! Now beam up my clothes...

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




Re: [PHP-DB] PHP and MySQL queries...

2001-10-24 Thread Kodrik

Why don't you let them enter it however they want in the form
mm-dd-
mm/dd/yy

then in the php script that processes it, convert it with regulat expressions 
to a timstamp and enter it in your database as an int. That's how I do it.
I don't understand the point in using the mysql timedate field format.

Then on retrieval form the db, php can easily convert it to a nice format 
with the date() function.

> On Tue, 23 Oct 2001 10:52:41 -0600 Jason <[EMAIL PROTECTED]> wrote:
> > I am having a hard time setting up a form for users to enter a date in
> > the format of 00/00/ (of course they would use an actual date).  My
> > form is as follows...
> > 
> >   *I.E. - Format is 04/01/2001*
> >   Search for Ads by date:
> > 
> >   
> >   
> >  > value="Submit">
> >  > value="Reset"> 
> > 
> > 
> > On my search.php page I have the following MySQL connection and search
> > parameters...
> >  >
> > mysql_connect ("db_hostname", "db_username", "db_password");
> >
> > mysql_select_db ("db_name");
> >
> > if ($date == "")
> > {$date = '%';}
> >
> > $result = mysql_query ("SELECT
> > fname,lname,address,city,state,zip,phonea,phone,email,crty,crnum,crmo,cry
> >r,w eeks,ogden,rock,logan,ipaddress,ad,total,num,date,time
> >   FROM ads WHERE date LIKE '%$date%' LIMIT 0, 30 ");
> > $count = -1;
> > if ($row = mysql_fetch_array($result)) {
> > $count ++;
> > do {
> > echo "Name: ";
> > printf(mysql_result($result,$count,"fname"));
> > echo " ";
> > printf(mysql_result($result,$count,"lname"));
> > echo "\n";
> >
> > echo "Address: ";
> > printf(mysql_result($result,$count,"address"));
> > echo "\n";
> >
> > echo "City: ";
> > printf(mysql_result($result,$count,"city"));
> > echo "\n";
> >
> > echo "State: ";
> > printf(mysql_result($result,$count,"state"));
> > echo "\n";
> >
> > echo "Zip: ";
> > printf(mysql_result($result,$count,"zip"));
> > echo "\n";
> >
> > echo "Phone: (";
> > printf(mysql_result($result,$count,"phonea"));
> > echo ") ";
> > printf(mysql_result($result,$count,"phone"));
> > echo "\n";
> >
> > echo "Email: ";
> > printf(mysql_result($result,$count,"email"));
> > echo "\n";
> >
> > echo "Credit Type: ";
> > printf(mysql_result($result,$count,"crty"));
> > echo "\n";
> >
> > echo "Credit Number: ";
> > printf(mysql_result($result,$count,"crnum"));
> > echo "\n";
> >
> > echo "Credit Card Date: ";
> > printf(mysql_result($result,$count,"crmo"));
> > echo " ";
> > printf(mysql_result($result,$count,"cryr"));
> > echo "\n";
> >
> > echo "Weeks: ";
> > printf(mysql_result($result,$count,"weeks"));
> > echo "\n";
> >
> > echo "town1: ";
> > printf(mysql_result($result,$count,"town1"));
> > echo "\n";
> >
> > echo "town2: ";
> > printf(mysql_result($result,$count,"town2"));
> > echo "\n";
> >
> > echo "town3: ";
> > printf(mysql_result($result,$count,"town3"));
> > echo "\n";
> >
> > echo "IP Address: ";
> > printf(mysql_result($result,$count,"ipaddress"));
> > echo "\n";
> >
> > echo "Ad: ";
> >
> > $ad[$count] = (mysql_result($result,$count,"ad"));
> >
> > $ad[$count] = ereg_replace ("&a&", "'", $ad[$count]);
> > $ad[$count] = ereg_replace ("&q&", "\"", $ad[$count]);
> > $ad[$count] = ereg_replace ("&p&", "%", $ad[$count]);
> > $ad[$count] = ereg_replace ("&bs&", "\\", $ad[$count]);
> >
> >
> > echo $ad[$count];
> > echo "\n";
> >
> > echo "Total: ";
> > printf(mysql_result($result,$count,"total"));
> > echo "\n";
> >
> > echo "Ad Number: ";
> > printf(mysql_result($result,$count,"num"));
> > echo "\n";
> >
> > echo "Date: ";
> > printf(mysql_result($result,$count,"date"));
> > echo "\n";
> >
> > echo "Time: ";
> > printf(mysql_result($result,$count,"time"));
> > echo "\n";
> >
> > } while($row = mysql_fetch_array($result));
> >
> > } else {print "Sorry, no records were found!";}
> >
> > ?>
> > So far I have come to the conclusion that the input from the user is
> > probably where my problem is because I am assuming it is taking the "/"
> > in the date they enter and doing something I don't want it to.  In any
> > event if someone could give me a clue as to how to resolve this issue it
> > would be greatly appreciated.
> >
> >
> >
> > --
> > 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]
>
> #---#
>
>   "Believe nothing - consider everything"
>
>   Russ Michell
>   Anglia Polytechnic University Webteam
>   Room 1C 'The Eastings' East Road, Cambridge
>
>   e: [EMAIL PROTECTED]
>   w: www.apu.ac.uk/webteam
>
>   www.theruss.com
>
> #---#

-- 
PHP Database Mailing List (http://www.php.ne

Re: [PHP-DB] PHP and MySQL queries...

2001-10-24 Thread Mike Frazer

Agreed.  This is especially useful when you need to conserve every byte you
can; a timestamp of "10/24/2001" or something similar is going to take 10
bytes as a string and an indeterminate number of bytes for an actual
timestamp because of system variations, whereas an integer value of 10242001
will take you 2-4 bytes depending on the type of int you declare.  Not a lot
of space, but assume for a second you have 30 fields in your database and 5
million rows...suddenly those 6-8 bytes have multiplied on this one field
alone.  Space and speed are important in DBs :)

Mike Frazer



"Kodrik" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Why don't you let them enter it however they want in the form
> mm-dd-
> mm/dd/yy
>
> then in the php script that processes it, convert it with regulat
expressions
> to a timstamp and enter it in your database as an int. That's how I do it.
> I don't understand the point in using the mysql timedate field format.
>
> Then on retrieval form the db, php can easily convert it to a nice format
> with the date() function.
>
> > On Tue, 23 Oct 2001 10:52:41 -0600 Jason <[EMAIL PROTECTED]> wrote:
> > > I am having a hard time setting up a form for users to enter a date in
> > > the format of 00/00/ (of course they would use an actual date).
My
> > > form is as follows...
> > > 
> > >   *I.E. - Format is 04/01/2001*
> > >   Search for Ads by date:
> > > 
> > >   
> > >   
> > >  > > value="Submit">
> > >  > > value="Reset"> 
> > > 
> > > 
> > > On my search.php page I have the following MySQL connection and search
> > > parameters...
> > >  > >
> > > mysql_connect ("db_hostname", "db_username", "db_password");
> > >
> > > mysql_select_db ("db_name");
> > >
> > > if ($date == "")
> > > {$date = '%';}
> > >
> > > $result = mysql_query ("SELECT
> > >
fname,lname,address,city,state,zip,phonea,phone,email,crty,crnum,crmo,cry
> > >r,w eeks,ogden,rock,logan,ipaddress,ad,total,num,date,time
> > >   FROM ads WHERE date LIKE '%$date%' LIMIT 0, 30 ");
> > > $count = -1;
> > > if ($row = mysql_fetch_array($result)) {
> > > $count ++;
> > > do {
> > > echo "Name: ";
> > > printf(mysql_result($result,$count,"fname"));
> > > echo " ";
> > > printf(mysql_result($result,$count,"lname"));
> > > echo "\n";
> > >
> > > echo "Address: ";
> > > printf(mysql_result($result,$count,"address"));
> > > echo "\n";
> > >
> > > echo "City: ";
> > > printf(mysql_result($result,$count,"city"));
> > > echo "\n";
> > >
> > > echo "State: ";
> > > printf(mysql_result($result,$count,"state"));
> > > echo "\n";
> > >
> > > echo "Zip: ";
> > > printf(mysql_result($result,$count,"zip"));
> > > echo "\n";
> > >
> > > echo "Phone: (";
> > > printf(mysql_result($result,$count,"phonea"));
> > > echo ") ";
> > > printf(mysql_result($result,$count,"phone"));
> > > echo "\n";
> > >
> > > echo "Email: ";
> > > printf(mysql_result($result,$count,"email"));
> > > echo "\n";
> > >
> > > echo "Credit Type: ";
> > > printf(mysql_result($result,$count,"crty"));
> > > echo "\n";
> > >
> > > echo "Credit Number: ";
> > > printf(mysql_result($result,$count,"crnum"));
> > > echo "\n";
> > >
> > > echo "Credit Card Date: ";
> > > printf(mysql_result($result,$count,"crmo"));
> > > echo " ";
> > > printf(mysql_result($result,$count,"cryr"));
> > > echo "\n";
> > >
> > > echo "Weeks: ";
> > > printf(mysql_result($result,$count,"weeks"));
> > > echo "\n";
> > >
> > > echo "town1: ";
> > > printf(mysql_result($result,$count,"town1"));
> > > echo "\n";
> > >
> > > echo "town2: ";
> > > printf(mysql_result($result,$count,"town2"));
> > > echo "\n";
> > >
> > > echo "town3: ";
> > > printf(mysql_result($result,$count,"town3"));
> > > echo "\n";
> > >
> > > echo "IP Address: ";
> > > printf(mysql_result($result,$count,"ipaddress"));
> > > echo "\n";
> > >
> > > echo "Ad: ";
> > >
> > > $ad[$count] = (mysql_result($result,$count,"ad"));
> > >
> > > $ad[$count] = ereg_replace ("&a&", "'", $ad[$count]);
> > > $ad[$count] = ereg_replace ("&q&", "\"", $ad[$count]);
> > > $ad[$count] = ereg_replace ("&p&", "%", $ad[$count]);
> > > $ad[$count] = ereg_replace ("&bs&", "\\", $ad[$count]);
> > >
> > >
> > > echo $ad[$count];
> > > echo "\n";
> > >
> > > echo "Total: ";
> > > printf(mysql_result($result,$count,"total"));
> > > echo "\n";
> > >
> > > echo "Ad Number: ";
> > > printf(mysql_result($result,$count,"num"));
> > > echo "\n";
> > >
> > > echo "Date: ";
> > > printf(mysql_result($result,$count,"date"));
> > > echo "\n";
> > >
> > > echo "Time: ";
> > > printf(mysql_result($result,$count,"time"));
> > > echo "\n";
> > >
> > > } while($row = mysql_fetch_array($result));
> > >
> > > } else {print "Sorry, no records were found!";}
> > >
> > > ?>
> > > So far I