Re: [PHP-DB] Creating a file using php

2001-10-23 Thread Jon Farmer

- Original Message - 
 
 Polite: Well its easier to post and get a reply rather then me going and
 serching fo it.;)


Easier for who?

Regards

Jon

--
Jon Farmer
Systems Programmer, Entanet www.enta.net
Tel 01952 428969 Mob 07763 620378
PGP Key available, send blank email to [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: RE: [PHP-DB] looped insert

2001-10-23 Thread Russ Michell

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;$icount($category);$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 .= b$names /binput type=\checkbox\ 
name=\category[$names]\ value=\yes\br\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;$icount($category);$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 .= b$names /binput type=\checkbox\
 name=\category[$names]\ value=\yes\br\n;
   }
 
 
 //If submit button selected, process those ticked checkbox categories:
 if(isset($submit)) {
   //loop while categories have been ticked
   for($i=0;$icount($category);$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.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-DB] Re: ifx_connect error

2001-10-23 Thread Andreas Schmitz

Muciño Zúñiga Marco Antonio wrote:
 
 I'm trying to connect to a Informix database but I get the error :
 
 Warning: ifx_connect : E [SQLSTATE=IX 001 SQLCODE=-1829] in
 /usr/local/apache/htdocs/php/connect.php on line 2
 Imposible conectarse a la base de datos.
 
 My script is :
 
 ?
   $conn_id = ifx_connect(nomin@compaq6,mmucino,marquito) or die
 (Imposible conectarse a la base de datos.);
 ?
 
 Any suggestion? Thanks.

hi  


did you check the sql-error ?

finderr 1829
-1829   Cannot open file citoxmsg.pam.

The file citoxmsg.pam is missing from the directory $INFORMIXDIR/msg.

If this error occurs, please note all circumstances and contact
Informix Technical Support.

regards 

-andreas

--
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-23 Thread Russ Michell

Hi all + Rick:

Since the last email I have got even closer, here is the code:

//If submit button selected, process those ticked checkbox categories:
if(isset($submit)) {
//Start off sql
$sql = INSERT INTO $myanet02 (;
//loop while categories have been ticked
while(list($key,$val) = each($category)) {
if($val != 'yes') { 
$sql1 .= $key,;
$sql2 = substr($sql1,0,-1) . );
$sql3 .= 'NULL',;
$sql4 = $sql . $sql1 . $sql2 . VALUES ( . $sql3;
}
else {
$sql1 .= $key,;
$sql2 = substr($sql1,0,-1) . );
$sql3 .= '$email',;
$sql4 = $sql . $sql1 . $sql2 . VALUES ( . $sql3;
}   
}
//Remove the last comma
$sql = substr($sql4,0,-1) . );
//$query = mysql_query($sql,$connect) or die(mysql_error());
echo $sql;
}

However, this returns the following echoed SQL query:
INSERT INTO myanet_categories (staffdev ,staffdev )VALUES ('[EMAIL PROTECTED]') 

This is almost correct, in that I only selected a single category to INSERT INTO (a 
single email 
being the inserted value). But as you can see, that category has been repeated in the 
list of 
fields to be inserted into. If I select say, 3 categories, then this is what happens:

INSERT INTO myanet_categories (staffdev ,rules ,policies ,staffdev ,rules ,policies )
VALUES ('[EMAIL PROTECTED]','[EMAIL PROTECTED]','[EMAIL PROTECTED]') 

See what I mean?
If anyone has any other pointers I would be more than happy to receive them!!

Cheers
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-DB] PHP/IIF/INFORMIX

2001-10-23 Thread Andreas Schmitz

Hi,

I have some problems with the interface between windows PHP and
informix. the following constellation is on the windows box:

Windows2000
Microsoft-IIS/5.0
PHP 4.0.6
php_ifx.dll aus PHP 4.0.6 ist installiert
IFX-ClientSDK 2.70 TC1.1

the windows box is used to generate templates for the webserver working
with apache/php and informix IDS2000 (9.21uc4) on solaris.
the guys working on the templates try to use a preview executing a
preview from windows with PHP accessing the content of the
iformix database. It works kind of fine with standard datafields like
varchar, integer etc. if datatypes like lvarchar or even collection
types like set, list etc. appear the preview doesn't work. ESQL/C :
vorspann : unsupported field type[184] appears as an 
error message. I suppose PHP needs to be compiled with informix support
on windows. 

is there anybody out there with knowledge about the topic ?

thanks a lot in advance

regards 

-andreas

-- 
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] Flatrate - Request 559

2001-10-23 Thread

Below is the result of your feedback form.  It was submitted by
 ([EMAIL PROTECTED]) on Tuesday, October 23, 2001 at 09:06:48
---

message: 
Introducing
The Newest Flatrate LongDistance Plan
Along With A System To Make $5800 Per Month Using Our Unique System.

email us at [EMAIL PROTECTED]
Include your name, phone number, and best time to call or you will not receive a 
response back.


__
To be romoved from this database email [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] ADORecordset Equivalent in PHP?

2001-10-23 Thread MrBaseball34

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]




[PHP-DB] Re: looped insert

2001-10-23 Thread bill

Hi Russ,

It's not clear that you're keeping track of which categories are being checked.

You name them category[$names]  but you refer to them as $category[$i] where $i is a 
number.  How will you know what $category[1] refers to?

Other issues: It's also not clear where the value of $email comes from.  Nor is it 
clear if you're trying to obtain one row in the database with all subscriptions or 
whether
you could have multiple lines for multiple subscriptions.

Try this

while (list($key,$val)= each ($HTTP_POST_VARS[category]) ) {

$thisname=$key;  // this is the name of the checkbox, as in $category[$name]
$thisval=$val;   // this is the value, which in every case is yes

$sql=INSERT INTO $myanet02($thisname) values ($email);
// this will produce a line in the db for each subscription

// if you want one line for all subscriptions, remvoe the $sql line above and
// uncomment these lines below
// to compound the sql and run the query after the while

// if ($thefields) $thefields .= , $thisname; } else { $thefields = $thisname; 
}
// if($thevalues) $thevalues .= ,'$email'  } else { $thevalues = '$email'; }

$query = mysql_query($sql,$connect) or die(mysql_error());

} // end while

// uncomment following lines for single row entry
// $sql= INSERT INTO $myanet02($thefields) values ($thevalues);
// echo $sql;
// $query = mysql_query($sql,$connect) or die(mysql_error());

kind regards,

bill hollett

Russ Michell wrote:

 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 .= b$names /binput type=\checkbox\ 
name=\category[$names]\ value=\yes\br\n;
 }

 //If submit button selected, process those ticked checkbox categories:
 if(isset($submit)) {
 //loop while categories have been ticked
 for($i=0;$icount($category);$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-DB] Re: looped insert

2001-10-23 Thread Russ Michell

Relax!

$email comes from a text input, and the categories come from checkboxes dynamically 
displayed from 
table column names:

//Get all table column names, dynamically display, and use to accept subscriptions to 
category updates:
$fields = mysql_list_fields($dbName, myanet_categories, $connect);
$nocolumns = mysql_num_fields($fields);
for ($i=0; $i$nocolumns; $i++) {
$names = mysql_field_name($fields, $i) . \n;
$catselect .= b$names /binput type=\checkbox\ 
name=\category[$names]\ value=\yes\br\n;
}

I got it to work thus:

//Start off sql
$sql = INSERT INTO $myanet02 (;
//start display confirmation of subscribed categories
$category_list = ul\n\t;
//loop while categories have been ticked
while(list($key,$val) = each($category)) {
//trim whitespace from the end of $key (inherited from original var declaration of 
'$names' above)
$sql1 .= rtrim($key) . ,;
$sql2 = substr($sql1,0,-1). ); 
$sql3 .= '$email',;
$sql4 = $sql . $sql2 .  VALUES ( . $sql3;
//continue display confirmation of subscribed categories
$category_list .= li$key/li\n;
}
$category_list .= /ul;
//Remove the last comma from data to be inserted
$sql = substr($sql4,0,-1) . );
$query = mysql_query($sql,$connect) or die(mysql_error());  
$confirm = You have now been subscribed to the following categories: $category_list;
}
}

Thanks v.much for your concern, but it works quite well now!
Cheers.

Russ

On Tue, 23 Oct 2001 11:39:30 -0400 bill [EMAIL PROTECTED] wrote:

 Hi Russ,
 
 It's not clear that you're keeping track of which categories are being checked.
 
 You name them category[$names]  but you refer to them as $category[$i] where $i is a 
number.  How will you know what $category[1] refers to?
 
 Other issues: It's also not clear where the value of $email comes from.  Nor is it 
clear if you're trying to obtain one row in the database with all subscriptions or 
whether
 you could have multiple lines for multiple subscriptions.
 
 Try this
 
 while (list($key,$val)= each ($HTTP_POST_VARS[category]) ) {
 
 $thisname=$key;  // this is the name of the checkbox, as in $category[$name]
 $thisval=$val;   // this is the value, which in every case is yes
 
 $sql=INSERT INTO $myanet02($thisname) values ($email);
 // this will produce a line in the db for each subscription
 
 // if you want one line for all subscriptions, remvoe the $sql line above and
 // uncomment these lines below
 // to compound the sql and run the query after the while
 
 // if ($thefields) $thefields .= , $thisname; } else { $thefields = 
$thisname; }
 // if($thevalues) $thevalues .= ,'$email'  } else { $thevalues = '$email'; }
 
 $query = mysql_query($sql,$connect) or die(mysql_error());
 
 } // end while
 
 // uncomment following lines for single row entry
 // $sql= INSERT INTO $myanet02($thefields) values ($thevalues);
 // echo $sql;
 // $query = mysql_query($sql,$connect) or die(mysql_error());
 
 kind regards,
 
 bill hollett
 
 Russ Michell wrote:
 
  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 .= 
b$names 
 /binput type=\checkbox\ name=\category[$names]\ value=\yes\br\n;   
   }
   //If submit button selected, process those ticked checkbox categories:
  if(isset($submit)) {  //loop while categories have been ticked
  for($i=0;$icount($category);$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 WebteamRoom 1C 'The Eastings' East Road, 
Cambridge
 e: [EMAIL PROTECTED]
w: www.apu.ac.uk/webteam 

RE: [PHP-DB] Informix + PHP any gotcha's to watch out for?

2001-10-23 Thread Mark Roedel

 -Original Message-
 From: davemacgb [mailto:[EMAIL PROTECTED]] 
 Sent: Monday, October 22, 2001 12:12 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] Informix + PHP any gotcha's to watch out for?
 
 
 I've only used MySQL via PHP until now, does anyone know of 
 any gotchas that I should watch out for?
 
 The web site will hopefully run on Linux using Apache and PHP.

A few things that I've run into so far:

Make sure that your INFORMIXDIR environment variable is set.  Apache
would segfault on my systems when I tried to use any of the informix
functions otherwise.  I added a line to my apachectl script just to be
sure.

Ifx_connect() doesn't take quite the same parameters as mysql_connect().
The server you're connecting to is specified via either the
INFORMIXSERVER environment variable or one of the ifx default settings
in your php.ini.  (In either case, it's a pointer to an entry in your
INFORMIXDIR/etc/sqlhosts, not a hostname.)  Ifx_connect() also expects
the database name that you're connecting to.

Obviously, in light of the above, there is no ifx_select_db().

Ifx_num_rows() doesn't do the same thing as mysql_num_rows().  It counts
the number of rows that you've viewed from the result set, not the total
number of rows returned.

If you use mysql_fetch_array(), the equivalent Informix function is
ifx_fetch_row().


---
Mark Roedel |  Blessed is he who has learned to laugh
Systems Programmer  |   at himself, for he shall never cease
LeTourneau University   |   to be entertained.
Longview, Texas, USA|   -- John Powell 

--
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] datetime in MSSQL7

2001-10-23 Thread Frank M. Kromann


This problem has just been fixed in CVS. 

- Frank

 Hello!
 
 How can I force PHP to fetch datetime field i 'mmdd hh:mm:ss'  WITHOUT
 using MSSQL query like *SELECT convert(varchar,dtfield,20) as 'dtfield'* and
 so on?
 I have a few tables on MSSQL with the different structures and some of
 fields are datetime. I have to use CLASS in php with querys inside the code
 that are independent on order of fields.
 
 setlocale? but what?
 
 regards
 Konrad
 
 
 
 -- 
 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] Re: PHP and MySQL queries...

2001-10-23 Thread Jason

As of yet I have tried all sorts for date formating for the search field to
work.  I.E. 2001-10-23, 10/23/2001, 10/%/2001, 10%, %10%, etc.  The date
field in the database is stored as 10/23/2001 and yet when a user enters the
date and clicks the search button it does not display the results.  I am
almost certain that as the user clicks the submit button the php script is
parsing the search string (i.e. 10/23/2001) incorrectly.  I believe it is
parsing the sting as 10nsb;23nsb;2001 or something to that effect.  If
anyone has some more information on this please let me know.  I am pretty
sure I have exhausted my resources.

Jason [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 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...
 form name=auth method=post action=search.php
   p*I.E. - Format is 04/01/2001*/p
   pSearch for Ads by date:
 input type=text name=date
   /p
   p
 input type=submit name=login
 value=Submit
 input type=reset name=reset
value=Reset
   /p
 /form
 
 On my search.php page I have the following MySQL connection and search
 parameters...
 ?php

 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 BName: /B;
 printf(mysql_result($result,$count,fname));
 echo  ;
 printf(mysql_result($result,$count,lname));
 echo BR\n;

 echo BAddress: /B;
 printf(mysql_result($result,$count,address));
 echo BR\n;

 echo BCity: /B;
 printf(mysql_result($result,$count,city));
 echo BR\n;

 echo BState: /B;
 printf(mysql_result($result,$count,state));
 echo BR\n;

 echo BZip: /B;
 printf(mysql_result($result,$count,zip));
 echo BR\n;

 echo BPhone: /B(;
 printf(mysql_result($result,$count,phonea));
 echo ) ;
 printf(mysql_result($result,$count,phone));
 echo BR\n;

 echo BEmail: /B;
 printf(mysql_result($result,$count,email));
 echo BR\n;

 echo BCredit Type: /B;
 printf(mysql_result($result,$count,crty));
 echo BR\n;

 echo BCredit Number: /B;
 printf(mysql_result($result,$count,crnum));
 echo BR\n;

 echo BCredit Card Date: /B;
 printf(mysql_result($result,$count,crmo));
 echo  ;
 printf(mysql_result($result,$count,cryr));
 echo BR\n;

 echo BWeeks: /B;
 printf(mysql_result($result,$count,weeks));
 echo BR\n;

 echo Btown1: /B;
 printf(mysql_result($result,$count,town1));
 echo BR\n;

 echo Btown2: /B;
 printf(mysql_result($result,$count,town2));
 echo BR\n;

 echo Btown3: /B;
 printf(mysql_result($result,$count,town3));
 echo BR\n;

 echo BIP Address: /B;
 printf(mysql_result($result,$count,ipaddress));
 echo BR\n;

 echo BAd: /B;

 $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 BR\n;

 echo BTotal: /B;
 printf(mysql_result($result,$count,total));
 echo BR\n;

 echo BAd Number: /B;
 printf(mysql_result($result,$count,num));
 echo BR\n;

 echo BDate: /B;
 printf(mysql_result($result,$count,date));
 echo BR\n;

 echo BTime: /B;
 printf(mysql_result($result,$count,time));
 echo BR\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]




Re: [PHP-DB] ADORecordset Equivalent in PHP?

2001-10-23 Thread Richard Chauvaux

I would suggest checking out the classes at 
http://phpclasses.upperdesign.com/browse.html
I've used the mysql_recordset class that is part of the mysql_db 
package. It has the basic methods similar to ADO. I found it to be very 
functional if you're using mysql. There are other classes there as well 
that aren't necessarily mysql oriented. I haven't tried any of those myself.

MrBaseball34 wrote:

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

2001-10-23 Thread Rick Emery

First o all, GET RID of the 19 constructs using mysql_result().  You've
already captured the row with the $row=mysql_fetch_array().
mysql_result() cannot be mixed with mysql_fetch_arry().

So instead of:
echo BAddress: /B;
printf(mysql_result($result,$count,address));
echo BR\n;

use:
print BAddress: /B.$row['address'].BR\n;

Next, dates are stored in MySQL as -MM-DD.  Use that format in your
input.

Next, don't combine that if(mysql_fetch_array()) with the do while()
Instead, use:

if (mysql_num_rows($results) )
{
while( $row = mysql_fetch_array($result) )
{
}
}
else {
print No rows found;
}

Do the above.  Re-submit.  Tell me the results.  W'ell go from there...

rick

-Original Message-
From: Jason [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, October 23, 2001 12:37 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Re: PHP and MySQL queries...


As of yet I have tried all sorts for date formating for the search field to
work.  I.E. 2001-10-23, 10/23/2001, 10/%/2001, 10%, %10%, etc.  The date
field in the database is stored as 10/23/2001 and yet when a user enters the
date and clicks the search button it does not display the results.  I am
almost certain that as the user clicks the submit button the php script is
parsing the search string (i.e. 10/23/2001) incorrectly.  I believe it is
parsing the sting as 10nsb;23nsb;2001 or something to that effect.  If
anyone has some more information on this please let me know.  I am pretty
sure I have exhausted my resources.

Jason [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 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...
 form name=auth method=post action=search.php
   p*I.E. - Format is 04/01/2001*/p
   pSearch for Ads by date:
 input type=text name=date
   /p
   p
 input type=submit name=login
 value=Submit
 input type=reset name=reset
value=Reset
   /p
 /form
 
 On my search.php page I have the following MySQL connection and search
 parameters...
 ?php

 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 BName: /B;
 printf(mysql_result($result,$count,fname));
 echo  ;
 printf(mysql_result($result,$count,lname));
 echo BR\n;

 echo BAddress: /B;
 printf(mysql_result($result,$count,address));
 echo BR\n;

 echo BCity: /B;
 printf(mysql_result($result,$count,city));
 echo BR\n;

 echo BState: /B;
 printf(mysql_result($result,$count,state));
 echo BR\n;

 echo BZip: /B;
 printf(mysql_result($result,$count,zip));
 echo BR\n;

 echo BPhone: /B(;
 printf(mysql_result($result,$count,phonea));
 echo ) ;
 printf(mysql_result($result,$count,phone));
 echo BR\n;

 echo BEmail: /B;
 printf(mysql_result($result,$count,email));
 echo BR\n;

 echo BCredit Type: /B;
 printf(mysql_result($result,$count,crty));
 echo BR\n;

 echo BCredit Number: /B;
 printf(mysql_result($result,$count,crnum));
 echo BR\n;

 echo BCredit Card Date: /B;
 printf(mysql_result($result,$count,crmo));
 echo  ;
 printf(mysql_result($result,$count,cryr));
 echo BR\n;

 echo BWeeks: /B;
 printf(mysql_result($result,$count,weeks));
 echo BR\n;

 echo Btown1: /B;
 printf(mysql_result($result,$count,town1));
 echo BR\n;

 echo Btown2: /B;
 printf(mysql_result($result,$count,town2));
 echo BR\n;

 echo Btown3: /B;
 printf(mysql_result($result,$count,town3));
 echo BR\n;

 echo BIP Address: /B;
 printf(mysql_result($result,$count,ipaddress));
 echo BR\n;

 echo BAd: /B;

 $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 BR\n;

 echo BTotal: /B;
 printf(mysql_result($result,$count,total));
 echo BR\n;

 echo BAd Number: /B;
 printf(mysql_result($result,$count,num));
 echo BR\n;

 echo BDate: /B;
 printf(mysql_result($result,$count,date));
 echo BR\n;

 echo BTime: /B;
 printf(mysql_result($result,$count,time));
 echo BR\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 

[PHP-DB] Cant connect to a remote mySQL database

2001-10-23 Thread Leobarod Cortes

Hi John:

Im trying to connect to a remote mysql database but it seems that this thing
is not working

This is the information that thw browser sent to me:

Warning: Access denied for user: '[EMAIL PROTECTED]' (Using password:
NO) in /usr/local/apache/htdocs/pruebamysql.php on line 5

Warning: MySQL Connection Failed: Access denied for user:
'[EMAIL PROTECTED]' (Using password: NO) in
/usr/local/apache/htdocs/pruebamysql.php on line 5
1045: Access denied for user: '[EMAIL PROTECTED]' (Using password: NO)


And here it is the php.. wher it says localhost, I should only type the remote
IP address?

HTMLHEADTITLEForm Results /TITLE
BODY

?php
$connection = mysql_connect('localhost,'root');
if ($connection == false){
  echo mysql_errno().: .mysql_error().BR;
  exit;
}
mysql_select_db ('bb50');

$query = select course_id,course_name from course_main;
$result = mysql_query ($query);

if ($result){
  echo table border=1;
  echo trtdbNumero/b/tdtdbNombre del curso/b/tdtdbClave
d
el curso/b/td/tr;

  $numOfRows = mysql_num_rows ($result);
  for ($i = 0; $i  $numOfRows; $i++){
$coursename = mysql_result ($result, $i, 0);
$courseid = mysql_result ($result, $i, 0);

echo trtd$i/tdtd$coursename/tdtd$courseid/td/tr;
  }

  echo /table;
}
else{
  echo mysql_errno().: .mysql_error().BR;
}

mysql_close ($connection);

?

/BODY
/HTML






John McKown wrote:

 On Fri, 8 Sep 2000, Kevin Xin Lin wrote:

  int mysql_connect ([string hostname [:port] [:/path/to/socket] [, string
  username [, string password]]])
  
 
  This is the syntax of mysql_connect, I don't see any db information.
  What DB is in USE when I create a connection to MySQL? What have I
  overlooked?

 Well, I overlooked it too. The sequence is mysql_connect(),
 mysql_select_db(), then mysql_query(). I overlooked the
 mysql_select_db() as well. I guess that's because I always use the
 default database which is the same as my username. Also, I tend to use
 PostgreSQL more often than MySQL, so I forget some of the MySQL
 steps. Sorry about that!

 $connect=mysql_connect(...);
 $database=mysql_select_db(foo,$connect);
 $result=mysql_query($query,$connect);

 All queries which use $connect will go against the last
 mysql_select_db() which specified $connect (or the default db if it wasn't
 called).

 I hope I made more sense this time grin!

 John

 P.S. Does anybody know if doing this is more efficient that using the
 mysql_db_query() call? I would think that it might since MySQL would be
 in the correct database already. True?


-- 
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] keys in mysql

2001-10-23 Thread søren eriksen

How do I set up secondary keys in mysql?




RE: [PHP-DB] Cant connect to a remote mySQL database

2001-10-23 Thread Matt Williams

 Warning: Access denied for user: '[EMAIL PROTECTED]' (Using
 password:
 NO) in /usr/local/apache/htdocs/pruebamysql.php on line 5

 Warning: MySQL Connection Failed: Access denied for user:
 '[EMAIL PROTECTED]' (Using password: NO) in
 /usr/local/apache/htdocs/pruebamysql.php on line 5
 1045: Access denied for user: '[EMAIL PROTECTED]' (Using
 password: NO)


 And here it is the php.. wher it says localhost, I should only
 type the remote
 IP address?

 HTMLHEADTITLEForm Results /TITLE
 BODY

 ?php
 $connection = mysql_connect('localhost,'root');
 if ($connection == false){
   echo mysql_errno().: .mysql_error().BR;
   exit;
 }

you need to supply the host address (name or ip), your username and
password.

look here for more

www.php.net/mysql_connect

M:


-- 
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-23 Thread Rick Emery

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]




Re: [PHP-DB] keys in mysql

2001-10-23 Thread Jason G.

You read the mysql manual.

www.mysql.com

Look up alter table.

ALTER TABLE mytable ADD KEY keyname (keyfield1, keyfield2);

-Jason Garber

At 08:33 PM 10/23/2001 -0700, søren eriksen wrote:
How do I set up secondary keys in mysql?


--
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: PHP and MySQL queries...

2001-10-23 Thread Jason

Ok here is the script after changes...
?php

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 {
print BName: /B.$row['fname, lname'].BR\n;

if (mysql_num_rows($results) )
{
 while( $row = mysql_fetch_array($result) )
{
}
}
else {
print No rows found;
}
?
And now I get a parse error on line 201 which is below the html and php
code, so there isn't anything to change.  Please help?

Rick Emery [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 First o all, GET RID of the 19 constructs using mysql_result().  You've
 already captured the row with the $row=mysql_fetch_array().
 mysql_result() cannot be mixed with mysql_fetch_arry().

 So instead of:
 echo BAddress: /B;
 printf(mysql_result($result,$count,address));
 echo BR\n;

 use:
 print BAddress: /B.$row['address'].BR\n;

 Next, dates are stored in MySQL as -MM-DD.  Use that format in your
 input.

 Next, don't combine that if(mysql_fetch_array()) with the do while()
 Instead, use:

 if (mysql_num_rows($results) )
 {
 while( $row = mysql_fetch_array($result) )
 {
 }
 }
 else {
 print No rows found;
 }

 Do the above.  Re-submit.  Tell me the results.  W'ell go from there...

 rick

 -Original Message-
 From: Jason [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, October 23, 2001 12:37 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] Re: PHP and MySQL queries...


 As of yet I have tried all sorts for date formating for the search field
to
 work.  I.E. 2001-10-23, 10/23/2001, 10/%/2001, 10%, %10%, etc.  The date
 field in the database is stored as 10/23/2001 and yet when a user enters
the
 date and clicks the search button it does not display the results.  I am
 almost certain that as the user clicks the submit button the php script is
 parsing the search string (i.e. 10/23/2001) incorrectly.  I believe it is
 parsing the sting as 10nsb;23nsb;2001 or something to that effect.  If
 anyone has some more information on this please let me know.  I am pretty
 sure I have exhausted my resources.

 Jason [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  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...
  form name=auth method=post action=search.php
p*I.E. - Format is 04/01/2001*/p
pSearch for Ads by date:
  input type=text name=date
/p
p
  input type=submit name=login
  value=Submit
  input type=reset name=reset
 value=Reset
/p
  /form
  
  On my search.php page I have the following MySQL connection and search
  parameters...
  ?php
 
  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 BName: /B;
  printf(mysql_result($result,$count,fname));
  echo  ;
  printf(mysql_result($result,$count,lname));
  echo BR\n;
 
  echo BAddress: /B;
  printf(mysql_result($result,$count,address));
  echo BR\n;
 
  echo BCity: /B;
  printf(mysql_result($result,$count,city));
  echo BR\n;
 
  echo BState: /B;
  printf(mysql_result($result,$count,state));
  echo BR\n;
 
  echo BZip: /B;
  printf(mysql_result($result,$count,zip));
  echo BR\n;
 
  echo BPhone: /B(;
  printf(mysql_result($result,$count,phonea));
  echo ) ;
  printf(mysql_result($result,$count,phone));
  echo BR\n;
 
  echo BEmail: /B;
  printf(mysql_result($result,$count,email));
  echo BR\n;
 
  echo BCredit Type: /B;
  printf(mysql_result($result,$count,crty));
  echo BR\n;
 
  echo BCredit Number: /B;
  printf(mysql_result($result,$count,crnum));
  echo BR\n;
 
  echo BCredit Card Date: /B;
  printf(mysql_result($result,$count,crmo));
  echo  ;
  printf(mysql_result($result,$count,cryr));
  echo BR\n;
 
  echo BWeeks: /B;
  printf(mysql_result($result,$count,weeks));
  echo BR\n;
 
  echo Btown1: /B;
  printf(mysql_result($result,$count,town1));
  echo BR\n;
 
  echo Btown2: /B;
  printf(mysql_result($result,$count,town2));
  echo BR\n;
 
  echo Btown3: /B;
  printf(mysql_result($result,$count,town3));
  echo BR\n;
 
  

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

2001-10-23 Thread Rick Emery

OK.  Ya followed me just a little too literally.  We needed you to
restructure.  So you're part way there.
i've made some changes below.

I don't have access to PHP here at work, otherwise I'd test the changes I
made below.  So you'll have to test them.

You'll note that I placed the while(){} loop where it should be.
I also split the Name line into two different array elements.  The array
element names refer directly to the variables after SELECT in your SELECT
query.
I did the same in the Phone line.

-Original Message-
From: Jason Gerfen [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, October 23, 2001 2:23 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Re: PHP and MySQL queries...


Ok here is what I have done after your suggestions...
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 = mysql_num_rows($results);

if (mysql_num_rows($results) )
{
while( $row = mysql_fetch_array($result) )
{

   print BName: /B.$row['fname']., .$row[' lname'].BR\n;
   print BAddress: /B.$row['address'].BR\n;
   print BCity: /B.$row['city'].BR\n;
   print BState: /B.$row['state'].BR\n;
   print BZip: /B.$row['zip'].BR\n;
   print BPhone: /B.$row['phonea']., .$row[' phone'].BR\n;
   print BEmail: /B.$row['email'].BR\n;
   print BCredit Type: /B.$row['crty'].BR\n;
   print BCredit Number: /B.$row['crnum'].BR\n;
   print BCredit Date: /B.$row['crmo'].BR\n;
   print BWeeks: /B.$row['weeks'].BR\n;
   print BOgden: /B.$row['ogden'].BR\n;
   print BLogan: /B.$row['logan'].BR\n;
   print BIP Address: /B.$row['ipaddress'].BR\n;
   print BAd: /B.$row['ad'].BR\n;
   print BTotal: /B.$row['total'].BR\n;
   print BAd Number: /B.$row['num'].BR\n;
   print BDate: /B.$row['date'].BR\n;
   print BTime: /B.$row['time'].BR\n;
}
}
else {
print No rows found;
}
?
After I have uploaded it to the webserver I now get a parse error on line 
201 and that is the end of the php file, so there isn't anything to change.

I am still fairly new to this so any help you can provide would be great.  
Thanks again.
Jason


From: Rick Emery [EMAIL PROTECTED]
To: 'Jason' [EMAIL PROTECTED], [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Re: PHP and MySQL queries...
Date: Tue, 23 Oct 2001 13:13:21 -0500

First o all, GET RID of the 19 constructs using mysql_result().  You've
already captured the row with the $row=mysql_fetch_array().
mysql_result() cannot be mixed with mysql_fetch_arry().

So instead of:
echo BAddress: /B;
printf(mysql_result($result,$count,address));
echo BR\n;

use:
print BAddress: /B.$row['address'].BR\n;

Next, dates are stored in MySQL as -MM-DD.  Use that format in your
input.

Next, don't combine that if(mysql_fetch_array()) with the do while()
Instead, use:

if (mysql_num_rows($results) )
{
   while( $row = mysql_fetch_array($result) )
   {
   }
}
else {
print No rows found;
}

Do the above.  Re-submit.  Tell me the results.  W'ell go from there...

rick

-Original Message-
From: Jason [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, October 23, 2001 12:37 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Re: PHP and MySQL queries...


As of yet I have tried all sorts for date formating for the search field to
work.  I.E. 2001-10-23, 10/23/2001, 10/%/2001, 10%, %10%, etc.  The date
field in the database is stored as 10/23/2001 and yet when a user enters 
the
date and clicks the search button it does not display the results.  I am
almost certain that as the user clicks the submit button the php script is
parsing the search string (i.e. 10/23/2001) incorrectly.  I believe it is
parsing the sting as 10nsb;23nsb;2001 or something to that effect.  If
anyone has some more information on this please let me know.  I am pretty
sure I have exhausted my resources.

Jason [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  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...
  form name=auth method=post action=search.php
p*I.E. - Format is 04/01/2001*/p
pSearch for Ads by date:
  input type=text name=date
/p
p
  input type=submit name=login
  value=Submit
  input type=reset name=reset
value=Reset
/p
  /form
  
  On my search.php page I have the following MySQL connection and search
  parameters...
  ?php
 
  mysql_connect (db_hostname, db_username, db_password);
 
  mysql_select_db (db_name);
 
  if ($date == )
  {$date = '%';}
 
  $result = mysql_query (SELECT
 

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

2001-10-23 Thread Jason Wood

Let me guess, the parse error is on the last line of the file?

I get that all the time, its usually caused by a loop thats still open...
and, in your case, your do and if statements arent closed

try this.



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
  {
   print BName: /B.$row['fname, lname'].BR\n;

   if (mysql_num_rows($results) )
   {
 while( $row = mysql_fetch_array($result) )
{
}
   }
   else
   {
print No rows found;
   }
  }
 }

Let me know if it works!!


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

Jason [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Ok here is the script after changes...
 ?php

 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 {
 print BName: /B.$row['fname, lname'].BR\n;

 if (mysql_num_rows($results) )
 {
  while( $row = mysql_fetch_array($result) )
 {
 }
 }
 else {
 print No rows found;
 }
 ?
 And now I get a parse error on line 201 which is below the html and php
 code, so there isn't anything to change.  Please help?

 Rick Emery [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  First o all, GET RID of the 19 constructs using mysql_result().  You've
  already captured the row with the $row=mysql_fetch_array().
  mysql_result() cannot be mixed with mysql_fetch_arry().
 
  So instead of:
  echo BAddress: /B;
  printf(mysql_result($result,$count,address));
  echo BR\n;
 
  use:
  print BAddress: /B.$row['address'].BR\n;
 
  Next, dates are stored in MySQL as -MM-DD.  Use that format in your
  input.
 
  Next, don't combine that if(mysql_fetch_array()) with the do while()
  Instead, use:
 
  if (mysql_num_rows($results) )
  {
  while( $row = mysql_fetch_array($result) )
  {
  }
  }
  else {
  print No rows found;
  }
 
  Do the above.  Re-submit.  Tell me the results.  W'ell go from there...
 
  rick
 
  -Original Message-
  From: Jason [mailto:[EMAIL PROTECTED]]
  Sent: Tuesday, October 23, 2001 12:37 PM
  To: [EMAIL PROTECTED]
  Subject: [PHP-DB] Re: PHP and MySQL queries...
 
 
  As of yet I have tried all sorts for date formating for the search field
 to
  work.  I.E. 2001-10-23, 10/23/2001, 10/%/2001, 10%, %10%, etc.  The date
  field in the database is stored as 10/23/2001 and yet when a user enters
 the
  date and clicks the search button it does not display the results.  I am
  almost certain that as the user clicks the submit button the php script
is
  parsing the search string (i.e. 10/23/2001) incorrectly.  I believe it
is
  parsing the sting as 10nsb;23nsb;2001 or something to that effect.  If
  anyone has some more information on this please let me know.  I am
pretty
  sure I have exhausted my resources.
 
  Jason [EMAIL PROTECTED] wrote in message
  [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
   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...
   form name=auth method=post action=search.php
 p*I.E. - Format is 04/01/2001*/p
 pSearch for Ads by date:
   input type=text name=date
 /p
 p
   input type=submit name=login
   value=Submit
   input type=reset name=reset
  value=Reset
 /p
   /form
   
   On my search.php page I have the following MySQL connection and search
   parameters...
   ?php
  
   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 BName: /B;
   printf(mysql_result($result,$count,fname));
   echo  ;
   

[PHP-DB] Re: Warning: MySQL: Unable to save result set

2001-10-23 Thread Leobarod Cortes

HI there..

I ahve the following issue

Error
MySQL said:


Host 'bbtest' is not allowed to connect to this MySQL server



Do you have any idea what could go wrong???

Leo




Doug Schasteen wrote:

 Warning: MySQL: Unable to save result set in location of script on
 line ***

 I recently upgraded to php 4 from 3. I also upgraded MySQL to 3.23.43 at
 the same time and repopulated my database with a .sql file. Everything
 works fine but I get this warning message every time I do an UPDATE,
 DELETE, or an INSERT. The data still gets updated, deleted or inserted
 though. SELECTs work fine without any problems. Pretty much everything
 works, I just keep getting warning messages.

 I searched the web and found that several people have fixed the problem
 in the past by doing myisamchk -r on all the tables. This did not work
 for me.

 I also have plenty of diskspace, so I dont think I'm running out of
 room.

 These scripts were all working perfectly on another server with php 3
 and a slightly older version of mysql. Also, if I run the SQL commands
 in the commandline they run fine without any warnings.

 Any ideas?

 - Doug


-- 
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 form to search MySQL DB

2001-10-23 Thread Jason

Ok here is my problem... I have a form on a page named index.php and the
code for the form is as follows:

form name=auth method=post action=search01.php
 p*I.E. - Format is 04/01/2001*/p
 pSearch for Ads by date:
 input type=text name=date
 /p
 p
 input type=submit name=login value=Submit
 input type=reset name=reset value=Reset
 /p
 /form

This form is used to supply the variable that we would like to seach the
database by. I.E. by date in this case. The php script that connects to the
database and performs the search is in a file named search01.php. And the
php script is as follows:

?php
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 = mysql_num_rows($result);

if (mysql_num_rows($result) )
{
while( $row = mysql_fetch_array($result) )
{

   print BName: /B.$row['fname']., .$row[' lname'].BR\n;
   print BDate: /B.$row['date'].BR\n;
}
}
else {
print No rows found;}
?

Ok now that I have the form and the search script in place and as I test
it out I recieve an error message on 2 lines regardless of the format of the
date I use (i.e. 10/23/2001, %23%, 2001-23-10, etc.) The error messages are
as follows:

Warning: 0 is not a MySQL result index in search01.php on line 141

Warning: 0 is not a MySQL result index in search01.php on line 143
No rows found

Now that we have the background info out of the way I am wondering what
these error messages mean and how to resolve them.  I have been using a
couple of books as reference when creating this seach page but they do not
cover using a form to pass a variable to a php script for use withing a
select statement against a database.  If anyone has any ideas, suggestions
or otherwise please let me know because I would love to get this script
finished and posted somewhere.  Thanks again.
Jason



-- 
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 form to search MySQL DB

2001-10-23 Thread Peter Lovatt

Hi


echo $query;
echo mysql_error( $mysql_db_link);

is useful for finding query errors (it echos the query itself, and any error
message) but the problem here I think is that you are using 'date' as a
field name and/or variable name. Try using a name which is not a reserved
word.

HTH

Peter



 -Original Message-
 From: Jason [mailto:[EMAIL PROTECTED]]
 Sent: 23 October 2001 22:52
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] PHP form to search MySQL DB


 Ok here is my problem... I have a form on a page named index.php and the
 code for the form is as follows:

 form name=auth method=post action=search01.php
  p*I.E. - Format is 04/01/2001*/p
  pSearch for Ads by date:
  input type=text name=date
  /p
  p
  input type=submit name=login value=Submit
  input type=reset name=reset value=Reset
  /p
  /form

 This form is used to supply the variable that we would like to seach the
 database by. I.E. by date in this case. The php script that
 connects to the
 database and performs the search is in a file named search01.php. And the
 php script is as follows:

 ?php
 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,c
 rmo,cryr,w
 eeks,ogden,rock,logan,ipaddress,ad,total,num,date,time
 FROM ads WHERE date LIKE '%$date%' LIMIT 0, 30 );

 $count = mysql_num_rows($result);

 if (mysql_num_rows($result) )
 {
 while( $row = mysql_fetch_array($result) )
 {

print BName: /B.$row['fname']., .$row[' lname'].BR\n;
print BDate: /B.$row['date'].BR\n;
 }
 }
 else {
 print No rows found;}
 ?

 Ok now that I have the form and the search script in place
 and as I test
 it out I recieve an error message on 2 lines regardless of the
 format of the
 date I use (i.e. 10/23/2001, %23%, 2001-23-10, etc.) The error
 messages are
 as follows:

 Warning: 0 is not a MySQL result index in search01.php on line 141

 Warning: 0 is not a MySQL result index in search01.php on line 143
 No rows found

 Now that we have the background info out of the way I am wondering what
 these error messages mean and how to resolve them.  I have been using a
 couple of books as reference when creating this seach page but they do not
 cover using a form to pass a variable to a php script for use withing a
 select statement against a database.  If anyone has any ideas, suggestions
 or otherwise please let me know because I would love to get this script
 finished and posted somewhere.  Thanks again.
 Jason



 --
 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] PHP form to search MySQL DB

2001-10-23 Thread Rick Emery

The error messages have NOTHING to do with the date format.
See my previous email to determine how to determine where error is.

rick

-Original Message-
From: Jason [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, October 23, 2001 4:52 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] PHP form to search MySQL DB


Ok here is my problem... I have a form on a page named index.php and the
code for the form is as follows:

form name=auth method=post action=search01.php
 p*I.E. - Format is 04/01/2001*/p
 pSearch for Ads by date:
 input type=text name=date
 /p
 p
 input type=submit name=login value=Submit
 input type=reset name=reset value=Reset
 /p
 /form

This form is used to supply the variable that we would like to seach the
database by. I.E. by date in this case. The php script that connects to the
database and performs the search is in a file named search01.php. And the
php script is as follows:

?php
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 = mysql_num_rows($result);

if (mysql_num_rows($result) )
{
while( $row = mysql_fetch_array($result) )
{

   print BName: /B.$row['fname']., .$row[' lname'].BR\n;
   print BDate: /B.$row['date'].BR\n;
}
}
else {
print No rows found;}
?

Ok now that I have the form and the search script in place and as I test
it out I recieve an error message on 2 lines regardless of the format of the
date I use (i.e. 10/23/2001, %23%, 2001-23-10, etc.) The error messages are
as follows:

Warning: 0 is not a MySQL result index in search01.php on line 141

Warning: 0 is not a MySQL result index in search01.php on line 143
No rows found

Now that we have the background info out of the way I am wondering what
these error messages mean and how to resolve them.  I have been using a
couple of books as reference when creating this seach page but they do not
cover using a form to pass a variable to a php script for use withing a
select statement against a database.  If anyone has any ideas, suggestions
or otherwise please let me know because I would love to get this script
finished and posted somewhere.  Thanks again.
Jason



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

2001-10-23 Thread JMack

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



begin 666 picks.php
M/#]P:' -B\O:6YD97@NAP#0II;F-L=61E(BXO8V]M;6]N7V1B+FEN8R([
M#0H-F9U;F-T:6]N('-T87)T=7 H*0T*PT*(=L;V)A; D=7-EFYA;64[
M#0H@9VQO8F%L(102%!?4T5,1CL-B D;EN:U]I9 ](1B7V-O;FYE8W0H
M*3L-B!M7-Q;%]S96QE8W1?9(H(F=E96MS(BD[#0H@)'%U97)Y(#T@(E-%
M3$5#5 J($923TT@=V5E:W,@5TA%4D4@86-T:79E(#T@,2!/4D1%4B!62!W
M965K:60@05-#(CL-B DF5S=6QT(#T@;7ES6Q?75EGDH)'%U97)Y*3L-
M@T*/SX-CQH=UL/@T*/)O9'D@0D=#3TQ/4CTB8FQU92(^#0H\0T5.5$52
M/@T*/$)2/CQ4CX\0E(^#0H\2#,^4V5L96-T($@5V5E:R!T;R!96=I;CPO
M2#,^#0H\8G(^/$)2/@T*/9OFT@;65T:]D/2)P;W-T(B!A8W1I;VX@/2 B
M/#\@96-H;R D4$A07U-%3$8@/SXB/@T*( @( @/$E.4%54(%194$4](DA)
M1$1%3B(@3D%-13TB86-T:6]N(B!604Q513TBVAO=U]W965K(CX-B @( @
M(#Q)3E!55!465!%/2)(241$14XB($Y!344](G5S97)N86UE(B!604Q513TB
M/#\@96-H;R D=7-EFYA;64@/SXB/@T*3Q$258@86QI9VX](F-E;G1EB(^
M/-E;G1ECX-@D)/'1A8FQE()OF1ECTB,2(@=VED=@](C(P,(@8V5L
M;'!A91I;F](C(B/@T*0D)/'1R/@T*0D)3QT9!W:61T:#TB.#4E(B!!
M3$E'3B ]()#14Y415(B(YO=W)A#X-@D)0D)/%-%3$5#5!N86UE/2)W
M965K(CX-CP_#0IF;W(@*1I/3 [)D\;7ES6Q?;G5M7W)O=W,H)')EW5L
M=D[)DK*RD-GL-B @( D75EGE?9%T82 ](UYW%L7V9E=-H7W)O
M=R@DF5S=6QT*3L-B @(!E8VAO((\3U!424].(%9!3%5%/5PB)'%U97)Y
M7V1A=%;,%U(CXD75EGE?9%T85LQ73PO3U!424]./EQN(CL-GT-C\^
M#0H@( @( @( @( @( @( @( @( @( @( @( @( @( @/]3
M14Q%0U0^#0H)0D)/]T9#X-@D)0D\=0@=VED=@](C$U)2(@86QI9VX]
M(F-E;G1EB(@;F]WF%P/@T*0D)0D\:6YP=70@='EP93TBW5B;6ET(B!V
M86QU93TB1V\B(YA;64](E-U8FUI=(^#0H)0D)/]T9#X-@D)3PO='(^
M#0H)3PO=%B;4^#0H)/]C96YT97(^/]D:78^#0H\+V9OFT^#0H\+V)O
M9'D^#0H\+VAT;6P^#0H\/PT*?0T*#0IF=6YC=EO;B!M86ME7W-E;5C=EO
M;G,H*0T*PT*(=L;V)A; D=V5E:RP@)'5S97)I9P@)'-E;5C=5D+ D
M]I;G1S.PT*(=L;V)A; DEC:S$L(1P:6-K,BP@)'!I8VLS+ DEC
M:S0L(1P:6-K-2P@)'!I8VLV+ DEC:SL(1P:6-K.P@)'!I8VLY.PT*
M(=L;V)A; DEC:S$P+ DEC:S$Q+ DEC:S$R+ DEC:S$S+ D
MEC:S$T+ DEC:S [#0H@)QI;FM?:60@/2!D8E]C;VYN96-T*D[#0H@
M;7ES6Q?V5L96-T7V1B*)G965KR(I.PT*(1G86UEU]Q=65R2 ]()3
M14Q%0U0@9V%M96ED+!M;VYD87D@1E)/32!G86UER!72$5212!W965K(#T@
M)'=E96L-B @( @( @( @( @3U)$15(@0ED@9V%M95]D871E+!G86UE
M7W1I;64B.PT*(1G86UEU]R97-U;'0@/2!M7-Q;%]Q=65R2@D9V%M97-?
M75EGDI.PT*(1N=6U?9V%M97,@/2!M7-Q;%]N=6U?F]WR@D9V%M97-?
MF5S=6QT*3L-B!E8VAO();W5N9 D;G5M7V=A;65S(=A;65S+CQ4CXB
M.PT*(9OB H)D],#LD:3PD;G5M7V=A;65S.R1I*RLI#0H@PT*( @( D
M9V%M95]D871A(#T@;7ES6Q?9F5T8VA?F]W*1G86UEU]R97-U;'0I.PT*
M( @(!I9B H)=A;65?9%T85LQ72 A/2 B,2(I#0H@( @('L-B @( @
M( @(EF(@DV5L96-T960@/3T@=')U92D-B @( @( @('L-B @( @
M( @( @( D75EGE?W1R(#T@(B1P:6-K)DB.PT*( @( @( @( @
M(1S96QE8W1?75EGD@/2 B55!$051%('-E;5C=EO;G,@4T54('!I8VL@
M/2 B.PT*( @( @( @( @(1S96QE8W1?75EGD@+CT@(B1Q=65R5]S
M='(@(CL-B @( @( @( @( DV5L96-T7W%U97)Y(X]()72$5212!W
M965K(#T@)'=E96L@04Y$(=A;64@/2 D9V%M92!!3D0@=7-EB ](1UV5R
M:60B.PT*( @( @( @( @(1S96QE8W1?F5S=6QT(#T@;7ES6Q?75E
MGDH)'-E;5C=%]Q=65R2D[#0H@( @( @(!]#0H@( @( @(!E;'-E
M#0H@( @( @(![#0H@( @( @( @( @)'%U97)Y7W-TB ]((DEC
M:R1I(CL-B @( @( @( @( DV5L96-T7W%U97)Y(#T@(DE.4T525!)
M3E1/('-E;5C=EO;G,@5D%,5453(AN=6QL+ D=7-EFED+ D=V5E:RP-
MB @( @( @( @( @( @( @( @( @(1G86UE7V1A=%;,%TL(([
M#0H@( @( @( @( @)'-E;5C=%]Q=65R2 N/2 B)'%U97)Y7W-TBP@
M;G5L;DB.PT*( @( @( @( @(1S96QE8W1?F5S=6QT(#T@;7ES6Q?
M75EGDH)'-E;5C=%]Q=65R2D[#0H@( @( @(!]#0H@( @('T-B @
M( @96QS90T*( @(![#0H@( @( @(!E8VAO());B!-;VYD87D@;]O
M!A=!R97-U;'0@F]W(YU;6)EB D:2X\0E(^(CL-B @( @( @:68@
M*1S96QE8W1E9 ]/2!TG5E*0T*( @( @( @PT*( @( @( @( @
M(1Q=65R5]S='(@/2 BEC:R1I(CL-B @( @( @( @( DV5L96-T
M7W%U97)Y(#T@(E501$%412!S96QE8W1I;VYS(%-%5!P:6-K(#T@(CL-B @
M( @( @( @( DV5L96-T7W%U97)Y(X]((D)'%U97)Y7W-TBP@]I
M;G1S(#T@)'!O:6YTR!72$5212!W965K(#T@)'=E96L-B @( @( @( @
M( @( @( @( @( 

[PHP-DB] Html email

2001-10-23 Thread Benny


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...bbla.../bbla...));
$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-DB] Category search w/o specified categories

2001-10-23 Thread olinux

Hi all,

I would like to know if anyone has any ideas on how a
script behind a search such as www.smartpages.com
would work. i.e a search for doctors returns similar
categories that do not even include the word doctor

So how is this possible, is there a cross reference of
synonyms ? 

Thanks much,
olinux

__
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] How can I insert a binary-file into sybase dbsystem??

2001-10-23 Thread Benjamin

I'd finished install sysbase,but could not insert binary-file (pic or mp3)
into it ,why??

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]




[PHP-DB] Using A Query Results Multiple Times

2001-10-23 Thread Adam Douglas

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

2001-10-23 Thread Jason Wood

I'm not positive, but try switching the day and month fields.  ie:
28/04/1981   for April 28th, 1981 instead of 04/28/1981

Could work... I know alot of programs, etc, use this format, and I cant
remember offhand right now.  Let me know if it works for you!!


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



Jason [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 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...
 form name=auth method=post action=search.php
   p*I.E. - Format is 04/01/2001*/p
   pSearch for Ads by date:
 input type=text name=date
   /p
   p
 input type=submit name=login
 value=Submit
 input type=reset name=reset
value=Reset
   /p
 /form
 
 On my search.php page I have the following MySQL connection and search
 parameters...
 ?php

 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 BName: /B;
 printf(mysql_result($result,$count,fname));
 echo  ;
 printf(mysql_result($result,$count,lname));
 echo BR\n;

 echo BAddress: /B;
 printf(mysql_result($result,$count,address));
 echo BR\n;

 echo BCity: /B;
 printf(mysql_result($result,$count,city));
 echo BR\n;

 echo BState: /B;
 printf(mysql_result($result,$count,state));
 echo BR\n;

 echo BZip: /B;
 printf(mysql_result($result,$count,zip));
 echo BR\n;

 echo BPhone: /B(;
 printf(mysql_result($result,$count,phonea));
 echo ) ;
 printf(mysql_result($result,$count,phone));
 echo BR\n;

 echo BEmail: /B;
 printf(mysql_result($result,$count,email));
 echo BR\n;

 echo BCredit Type: /B;
 printf(mysql_result($result,$count,crty));
 echo BR\n;

 echo BCredit Number: /B;
 printf(mysql_result($result,$count,crnum));
 echo BR\n;

 echo BCredit Card Date: /B;
 printf(mysql_result($result,$count,crmo));
 echo  ;
 printf(mysql_result($result,$count,cryr));
 echo BR\n;

 echo BWeeks: /B;
 printf(mysql_result($result,$count,weeks));
 echo BR\n;

 echo Btown1: /B;
 printf(mysql_result($result,$count,town1));
 echo BR\n;

 echo Btown2: /B;
 printf(mysql_result($result,$count,town2));
 echo BR\n;

 echo Btown3: /B;
 printf(mysql_result($result,$count,town3));
 echo BR\n;

 echo BIP Address: /B;
 printf(mysql_result($result,$count,ipaddress));
 echo BR\n;

 echo BAd: /B;

 $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 BR\n;

 echo BTotal: /B;
 printf(mysql_result($result,$count,total));
 echo BR\n;

 echo BAd Number: /B;
 printf(mysql_result($result,$count,num));
 echo BR\n;

 echo BDate: /B;
 printf(mysql_result($result,$count,date));
 echo BR\n;

 echo BTime: /B;
 printf(mysql_result($result,$count,time));
 echo BR\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]