RE: [PHP-DB] I have a problem to add a new line to the body of my email when I am using '

2003-06-05 Thread Mark
I never knew that Body was supported. I had tried in years ago before
it worked, and never looked back. If you look at the source code for
this page
(http://developer.netscape.com/viewsource/husted_mailto/mailto.html)
you'll see that they use the javascript function "escape()" on the
body text. I believe this handles the characters such as spaces and
CR/NL. Though it seems you are doing it the same way they are
(%0D%0A).

If it works on some browsers, but not others, then it's probably a
compatibiilty issue, not a scripting issue. You don't indicate which
browsers this works/doesn't work on. Or which mail clients you're
using.

Finally, this is not really a PHP issue, and especially not a PHP-DB
issue.


--- Martin Rajcok <[EMAIL PROTECTED]> wrote:
> I believe the body is supported. I have read everything I could
> find through Google. People are using it exactly as I am.
> I can't use '\n' - it is only text in this case and it will be part
> of the email body.
> 
> Thanks anyway,
> Martin
> 
> -Original Message-
> From: John W. Holmes [mailto:[EMAIL PROTECTED]
> Sent: Thursday, 5 June 2003 3:02 p.m.
> To: 'Martin Rajcok'; [EMAIL PROTECTED]
> Subject: RE: [PHP-DB] I have a problem to add a new line to the
> body of
> my email when I am using ' 
> 
> > I have a problem to add a new line to the body of my email when I
> am
> using
> > ' > 
> > This is my code:
> > 
> > $details[email] //email of the user from the form
> > $details[contact_name] //name of the user from the form
> > 
> > $email_subject = "subject text...";
> > 
> > $email_form = "Welcome ".$details[contact_name].",%0D%0A%0D%0A";
> > $email_form .= "Thank you for registering with ";
> > 
> >  >
>
href='mailto:".$details[email]."?Body=".$email_form."&Subject=".$email_s
> ub
> > je
> > ct."' class='darkblue'>Send the email
> 
> Use \n. 
> 
> email_form = "Welcome ".$details[contact_name].",\n\n";
> 
> Are you sure "body" is even supported? I'll guarantee it's not
> going to
> be for every browser/email client. 
> 
> From: http://www.w3.org/TR/WD-html40-970917/htmlweb.html#h-5.1.3.1
> --
> MAILTO URLs have the following syntax:
> 
> mailto:email-address
> 
> User agents may support MAILTO URL extensions that are not yet
> Internet
> standards (e.g., appending subject information to a URL with the
> syntax
> "?Subject=my%20subject" where any space characters are replaced by
> "%20"). Some user agents also support "?Cc=email-address".
> --
> 
> ---John W. Holmes...
> 
> Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E
> 
> PHP Architect - A monthly magazine for PHP Professionals. Get your
> copy
> today. http://www.phparch.com/
> 
> 
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 
> 
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


=
Mark Weinstock
[EMAIL PROTECTED]
***
You can't demand something as a "right" unless you are willing to fight to death to 
defend everyone else's right to the same thing.
***

__
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com

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



RE: [PHP-DB] while - if - problem

2003-06-05 Thread Ford, Mike [LSS]
> -Original Message-
> From: Earl [mailto:[EMAIL PROTECTED]
> Sent: 04 June 2003 22:04
> To: PHP-DB
> 
> FYI
> this was beginning to bug me out... so I decided to try the 
> trim function
> and walla... it worked.
> 
> Thanks for ya'll assistance.

I was going to say this even before you added the trim() calls in , but this
really does look like an excellent situation for using the switch construct
(just look at all those trim() calls and array accesses you save!):


while($cols=ifx_fetch_row($eventQuery)) 
{
  switch (trim($cols['out_type']))
  {
case '0': 
  $r_away['linetype']='L';
  $r_home['linetype']='L';
  break;
  
case '1':
  $r_away['linetype']='H';
  $r_home['linetype']='H';
  break;
  }
  
  switch (trim($cols["s_acro"]))
  {
case 'CF':
case 'PF': 
  $r_away['sport']='1';
  $r_home['sport']='1';
  $s_lt='PS';
  $t_lt='TP';
  break;

case 'PB':
case 'CB':
  $r_away['sport']='2';
  $r_home['sport']='2';
  $s_lt='PS';
  $t_lt='TP';
  break;

case 'B':
  $r_away['sport']='3';
  $r_home['sport']='3';
  $s_lt='ML';
  $t_lt='TM';
  break;
   
case 'H':
  $r_away['sport']='4';
  $r_home['sport']='4';
  $s_lt='ML';
  $t_lt='TM';
  break;
  }

Cheers!

Mike

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

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



Re: [PHP-DB] Cookie issue

2003-06-05 Thread Becoming Digital
It's probably an issue with security settings in IE6, not your code.  

Edward Dudlik
Becoming Digital
www.becomingdigital.com


- Original Message - 
From: "Marie Osypian" <[EMAIL PROTECTED]>
To: "PHP-DB" <[EMAIL PROTECTED]>
Sent: Thursday, 05 June, 2003 11:30
Subject: RE: [PHP-DB] Cookie issue


To add to this message:

We are having problems with people using IE 6.0.  They appear to sign-in and
then are returned to the sign-in screen over and over.  This doesnt happen
to all that use the site.

Thanks in advance

-Original Message-
From: Marie Osypian [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 05, 2003 10:03 AM
To: PHP-DB
Subject: [PHP-DB] Cookie issue


We are having complaints on our site about users not being able to log-in
and we feel it maybe related to the setting of cookie.  Here is the code
used.  Can anyone give me insight.


/* some standard var's or other things like srand */
srand((double)microtime() * 100);
$includes_root  = "$DOCUMENT_ROOT/includes";
$encoded_url= urlencode($REQUEST_URI);

if($_COOKIE["cookie_check"] != "Y")
{
setcookie("cookie_check", "Y", strtotime("+5 years"), "/",
"$HTTP_HOST", 0);
}

if($_COOKIE["current_surfer_id"] == "" AND $_COOKIE["cookie_check"] ==
"Y")
{
$current_surfer_id = rand(0, 16777215);

setcookie("current_surfer_id", $current_surfer_id, strtotime("+5
years"), "/", "$HTTP_HOST", 0);
}



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



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





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



Re: [PHP-DB] forms with php/mysql

2003-06-05 Thread Becoming Digital
> If you aren't a coder, you probably cannot do what you ask; there aren't
> any pre-built simple systems that do exactly what you ask.

Yes and no.  I agree that someone without coding experience (or a desire to
learn) cannot tackle this problem, but what Philippe has requested is a simple
user authentication system with sessions, of which there are many.  Still,
customization to fit his system will require an understanding of the code, which
will likely prove problematic.

To the poster, check out the PHP Classes Repository for a number of
authentication classes.  Don't expect them to work if you don't understand the
code, though.

Edward Dudlik
Becoming Digital
www.becomingdigital.com


- Original Message -
From: "Peter Beckman" <[EMAIL PROTECTED]>
To: "Philippe Rousselot" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Thursday, 05 June, 2003 00:15
Subject: Re: [PHP-DB] forms with php/mysql


1. Search the archives, they are here: http://www.php.net/mailing-lists.php

2. If you aren't a coder, you probably cannot do what you ask; there aren't
any pre-built simple systems that do exactly what you ask.  You could look
on freshmeat.net or sourceforge.com, but I doubt you'd find what you are
looking for.

Peter

On Thu, 5 Jun 2003, Philippe Rousselot wrote:

> Hi,
>
> I need for an association to create a form using php/mysql. If I can
> understand php, I am not a coder, so if someone had the code I need, I would
> really be greatful.
>
> I need :
>
> 1. on a page someone identify himself or register to the service using a form
> where the person enter name, email(username) and password.
> 2. once registered, the person can access a secured zone containing a form
> 3. the persone can fill the form, abandon half way and save the result, then
> come back and have the previously recorded information appearing again.
>
> all data need to be in a Mysql database.
>
>
> Thank you very much for your help.
>
> Philippe
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

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

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





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



Re: [PHP-DB] PHP/Mysql Script help.

2003-06-05 Thread Becoming Digital
I debugged the code and there were a slew of errors.  I've fixed all but one,
which I can't correct bcs I don't know the intention.  Most of the errors came
from improper syntax, a problem which could have been avoided by using
consistent code formatting.  I chose to do that for you as well and have
included the code below.

As for the error I could not correct, it involves the final elseif() statement.
The way your code was written, you had two 'else' statements, which is an
obvious violation.  I corrected that by changing the first (before the select
statement) to an elseif(), but I do not know the condition.  Once you enter it,
the code should work smoothly.


Race: %s\n", $myrow["race"]);

echo "";

printf("Description: %s\n", $myrow["racetxt"]);

echo "";
echo "Back";
}

elseif ($_Post['letter'])
{
if ($_Post['letter'])
{
$result = mysql_query("SELECT * FROM nuke_race WHERE race LIKE
$_Post['letter']%",$con) or die(mysql_error());
if ($myrow = mysql_fetch_array($result))
{   // display list if there are records to display
do {
printf("%s\n", $PHP_SELF,
$myrow["id"], $myrow["race"]);
}
while ($myrow = mysql_fetch_array($result));
}
}
}

//NO CONDITION LISTED!!
elseif ()
{
echo ""

  . "  Pick a letter to begin your search"
  . "   "
  . ""
  . "  A"
  . "  B"
  . "  C"
  . "  D"
  . "  E"
  . "  F"
  . "  G"
  . "  H"
  . "  I"
  . "  J"
  . "  K"
  . "  L"
  . "  M"
  . "  N"
  . "  O"
  . "  P"
  . "  Q"
  . "  R"
  . "  S"
  . "  T"
  . "  U"
  . "  V"
  . "  W"
  . "  X"
  . "  Y"
  . "  Z"
  . ""
  . "  "
  . "   "
  . ""
  . "  "
  . ""
  ."";
}

else
// no records to display
echo "Sorry, no records were found!";

?>


Edward Dudlik
Becoming Digital
www.becomingdigital.com


- Original Message -
From: "Fulco of Scarborough" <[EMAIL PROTECTED]>
To: "'PHP-DB'" <[EMAIL PROTECTED]>
Sent: Thursday, 05 June, 2003 00:25
Subject: Re: [PHP-DB] PHP/Mysql Script help.


I have still been getting errors, so here goes again.



I am attempting to design a script that presents the user with a form with
26 letters to choose from.  When they pick a letter I want it to take them
to a list of all the entries in my database that begin with the letter they
selected in link form.  When they click on the term, I want it to pull up
the info for that entry.



I have made some changes and added some error checking:



Race: %s\n", $myrow["race"]);

  echo "";

   printf("Description: %s\n", $myrow["racetxt"]);

  echo "";

  echo "Back";




} elseif ($_Post['letter']) {

if ($_Post['letter']) {

$result = mysql_query("SELECT * FROM nuke_race WHERE race LIKE
$_Post['letter']%",$con) or die(mysql_error());

if ($myrow = mysql_fetch_array($result)) {



  // display list if there are records to display



  do {



printf("%s\n", $PHP_SELF, $myrow["id"],
$myrow["race"]);



  } while ($myrow = mysql_fetch_array($result));



";

}

else  {

echo""

  . "  Pick a letter to begin your search"

  . "   "

  . ""

  . "  A"

  . "  B"

  . "  C"

  . "  D"

  . "  E"

  . "  F"

  . "  G"

  . "  H"

  . "  I"

  . "  J"

  . "  K"

  . "  L"

  . "  M"

  . "  N"

  . "  O"

  . "  P"

  . "  Q"

  . "  R"

  . "  S"

  . "  T"

  . "  U"

  . "  V"

  . "  W"

  . "  X"

  . "  Y"

  . "  Z"

  . ""

  . "  "

  . "   "

  . ""

  . "  "

  . ""

  . "

 ."";



}

 else {

  // no records to display



  echo "Sorry, no records were found!";

}



?>



I am still getting "Parse error: parse error, unexpected T_STRING in
/home/wwwfulc/public_html/st/races.php on line 38"



This is line 38



echo""





Thanks for your help!



Yours in Service,

Jason Britton

Scar's   Legion

[EMAIL PROTECTED]



Vincit imitationem veritas.






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



[PHP-DB] read file on LAN

2003-06-05 Thread Billý Branislav
hi,

I have problem with read file on my LAN.
if I read 
 echo readfile("c:\\200303.atu ");
its work ok, but if I read
 echo read("Billy\\income\\200303.atu");
its doesnt work

where is mistake?
can you help mi?
thanks

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



Re: [PHP-DB] TIMESTAMP -> Y-m-d

2003-06-05 Thread Sean Burlington
nabil wrote:
Please help me how to print a timestamp string retrived from the database,
and print it as -MM-DD
use the mysql date_format fumction

DATE_FORMAT(date,format)

select date_format(date_field, '%Y-%m-%d') from data;

see the mysql docs for more details

--

Sean

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


[PHP-DB] TIMESTAMP -> Y-m-d

2003-06-05 Thread nabil
Please help me how to print a timestamp string retrived from the database,
and print it as -MM-DD

Nabil



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



[PHP-DB] Problem in PHP configuraction in Linux

2003-06-05 Thread Ramesh PAtel
Hi

I have RHL9.0 i have PHP 4.2 
now when i sedn variable through webpage they cant accept.
apache working well.

mean i develop some application on PHP and  Postgresql  
so when i login that time user name and password not accept in 
SQL Query.

Please Help how to configure it

Ramesh PAtel

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



Re: [PHP-DB] PHP/Mysql Script help.

2003-06-05 Thread Jason Wong
On Thursday 05 June 2003 12:25, Fulco of Scarborough wrote:
> I have still been getting errors, so here goes again.

[snip]

> I am still getting "Parse error: parse error, unexpected T_STRING in
> /home/wwwfulc/public_html/st/races.php on line 38"

Parse error means that you have written incorrectly formatted code that php 
doesn't even attempt to run. Check that each open ", ', [, (, { has a 
corresponding closing counterpart and each of your php statements (~lines) 
are terminated with a semi-colon (;).

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-db
--
/*
Love means having to say you're sorry every five minutes.
*/


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



Re: [PHP-DB] PHP/Mysql Script help.

2003-06-05 Thread Fulco of Scarborough
I have still been getting errors, so here goes again.

 

I am attempting to design a script that presents the user with a form with
26 letters to choose from.  When they pick a letter I want it to take them
to a list of all the entries in my database that begin with the letter they
selected in link form.  When they click on the term, I want it to pull up
the info for that entry.

 

I have made some changes and added some error checking:

 

Race: %s\n", $myrow["race"]);

  echo "";   

   printf("Description: %s\n", $myrow["racetxt"]);

  echo "";

  echo "Back";


 

} elseif ($_Post['letter']) {

if ($_Post['letter']) {

$result = mysql_query("SELECT * FROM nuke_race WHERE race LIKE
$_Post['letter']%",$con) or die(mysql_error());

if ($myrow = mysql_fetch_array($result)) {

 

  // display list if there are records to display

 

  do {

 

printf("%s\n", $PHP_SELF, $myrow["id"],
$myrow["race"]);

 

  } while ($myrow = mysql_fetch_array($result));

   

";  

}

else  {

echo""

  . "  Pick a letter to begin your search"

  . "   "

  . ""

  . "  A"

  . "  B"

  . "  C"

  . "  D"

  . "  E"

  . "  F"

  . "  G"

  . "  H"

  . "  I"

  . "  J"

  . "  K"

  . "  L"

  . "  M"

  . "  N"

  . "  O"

  . "  P"

  . "  Q"

  . "  R"

  . "  S"

  . "  T"

  . "  U"

  . "  V"

  . "  W"

  . "  X"

  . "  Y"

  . "  Z"

  . ""

  . "  "

  . "   "

  . ""

  . "  "

  . ""

  . "

 ."";

 

}

 else {

  // no records to display

 

  echo "Sorry, no records were found!";

}

  

?>

 

I am still getting "Parse error: parse error, unexpected T_STRING in
/home/wwwfulc/public_html/st/races.php on line 38"

 

This is line 38

 

echo""

 

 

Thanks for your help!

 

Yours in Service,

Jason Britton

Scar's   Legion

[EMAIL PROTECTED]

 

Vincit imitationem veritas.

 



Re: [PHP-DB] forms with php/mysql

2003-06-05 Thread Peter Beckman
1. Search the archives, they are here: http://www.php.net/mailing-lists.php

2. If you aren't a coder, you probably cannot do what you ask; there aren't
any pre-built simple systems that do exactly what you ask.  You could look
on freshmeat.net or sourceforge.com, but I doubt you'd find what you are
looking for.

Peter

On Thu, 5 Jun 2003, Philippe Rousselot wrote:

> Hi,
>
> I need for an association to create a form using php/mysql. If I can
> understand php, I am not a coder, so if someone had the code I need, I would
> really be greatful.
>
> I need :
>
> 1. on a page someone identify himself or register to the service using a form
> where the person enter name, email(username) and password.
> 2. once registered, the person can access a secured zone containing a form
> 3. the persone can fill the form, abandon half way and save the result, then
> come back and have the previously recorded information appearing again.
>
> all data need to be in a Mysql database.
>
>
> Thank you very much for your help.
>
> Philippe
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

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

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



Re: [PHP-DB] session

2003-06-05 Thread Peter Beckman
Also, you don't register values, you register variables.

$id = 123;
$name = "leooi";

$_SESSION['id'] = $id; // same as session_register("id"), but better
$_SESSION['name'] = $name; // same as session_register("name"), but better

You could also skip the whole variable setting and just do this:

$_SESSION['id'] = 123;

What I like to do is this (and yes, I know, the brackets cause additional
overhead):

$r = db_query("select * from user where username='{$un}' and password='{$pw}'");
$_SESSION['user'] = mysql_fetch_object($r);

Now anything in the user table is now accessible in my session:

if ($_SESSION['user']->id) { do something for the user that's logged in }

Peter

On Thu, 5 Jun 2003, heilo wrote:

> well - this is not really a DB-question. and if you take a look at the
> php-docu at http://www.php.net/manual/en/language.variables.predefined.php
> you'd see that you can access and alter them with $_SESSION or
> $HTTP_SESSION_VARS (older versions of php).
>
> [EMAIL PROTECTED] <[EMAIL PROTECTED]> [EMAIL PROTECTED] 3:34 Uhr:
>
> > Hi all,
> > I had create a session and stored some value into session.
> >  > session();
> > session_register("id 123","name leooi");
> > ?>
> > How can i retrieved the value???

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

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



Re: [PHP-DB] session

2003-06-05 Thread heilo
hi!

well - this is not really a DB-question. and if you take a look at the
php-docu at http://www.php.net/manual/en/language.variables.predefined.php
you'd see that you can access and alter them with $_SESSION or
$HTTP_SESSION_VARS (older versions of php).

.ma

[EMAIL PROTECTED] <[EMAIL PROTECTED]> [EMAIL PROTECTED] 3:34 Uhr:

> Hi all,
> I had create a session and stored some value into session.
>  session();
> session_register("id 123","name leooi");
> ?>
> How can i retrieved the value???
> 
> TQ
> 
> Leooi
> 
> 
>    IncrediMail -
> Email has finally evolved - Click Here
>  


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



[PHP-DB] session

2003-06-05 Thread [EMAIL PROTECTED]








  Hi all,
  I had create a session and stored some value into 
  session.
  
  session();
  session_register("id 123","name leooi");
  ?>
  How can i retrieved the value???
   
  TQ
   
  Leooi
   





	
	
	
	
	
	
	




  IncrediMail - 
Email has finally evolved - Click 
Here



RE: [PHP-DB] address info, forms, maintanance

2003-06-05 Thread John W. Holmes
> Thanks to everyone for the suggestions. Got it fixed. Just added a
couple
> lines of code -
> $sql1 = "select * from endusers where name like '$name'";
>$result1 = mysql_query($sql1);
>  $count1 = mysql_num_rows($result1);
>  if ($count1 == "0" )
>$sql = "insert into endusers..blah blah blah
 
> Now it works fine, no more duplicate entries. 

But now you're doing two queries for every insert. If you simply made
your columns unique and let the database handle it, you'd only have to
do one INSERT. Then check affected_rows() or mysql_error() to see if
either no rows were affected (no rows inserted) or the error mentions
duplicate. If either is the case, the row wasn't inserted because of a
unique constraint. If there is an error but it's not "duplicate" or
whatever, then it's another error and you should show it. 

---John W. Holmes...

Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/




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



[PHP-DB] forms with php/mysql

2003-06-05 Thread Philippe Rousselot
Hi,

I need for an association to create a form using php/mysql. If I can 
understand php, I am not a coder, so if someone had the code I need, I would 
really be greatful.

I need :

1. on a page someone identify himself or register to the service using a form 
where the person enter name, email(username) and password.
2. once registered, the person can access a secured zone containing a form
3. the persone can fill the form, abandon half way and save the result, then 
come back and have the previously recorded information appearing again.

all data need to be in a Mysql database.


Thank you very much for your help.

Philippe


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



Re: [PHP-DB] PHP sort from .... best solution?

2003-06-05 Thread heilo
hi

the easier way is as Mike Ford did it very elegantly with this structur:

>   function obj_date_compare($a, $b) {
>  return strcmp($a->publisertLang, $b->publisertLang);
>   }
>
>   ...
>
>   if($ingresser = array_merge($i1 ,$i2))
>   {
>  $ingresser = usort($ingresser, 'obj_date_compare');
>  listIngresser($ingresser);
>   }

the for-structure from your admin guy is also a possibility, but i think php
offers cool sort-functions like this usort-function (which was also new to
me - [EMAIL PROTECTED]). so it is not necessary to write your own sorting-algorithm.

.ma

A. Lyse <[EMAIL PROTECTED]> [EMAIL PROTECTED] 13:40 Uhr:

> Hi again!
> 
> I talked to the admin guy and he said there is an easyer way to do this (as
> usual he doenst have the time to show me) so I try here:
> 
> He gave me a liddle example in c and a light translation to PHP:
> 
> Bubble sort  (exampel written in c, but can "easyly" be translated to php):
> for (i=0; i for (j=0; j   if (a[j+1] < a[j]) {  /* compare the two neighbors */
> tmp = a[j]; /* swap a[j] and a[j+1]  */
> a[j] = a[j+1];
> a[j+1] = tmp;
> }
> }
> 
> **
> 
> More example of Bubble Sort:
> http://www.cs.ust.hk/faculty/tcpong/cs102/summer96/aids/bubble.html
> 
> The if-sentense must here be written to
> if($a[$j+1]->publisertLang < $a[$j]->publisertLang)
> where a is $ingresser and $n is the number of elements in $ingresser.
> 
> I
> 
> The if sentese is going in the php file pastet yesterday.
> 
> Not that yeasterdays metod did'nt work, but if somebody has an idea on this
> one and can give me a full example based on the info i've pastet yesterday
> it would be great!
> 
> Regards,
> A. Lyse
> 
> 


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



Re: [PHP-DB] PHP/Mysql Script help.

2003-06-05 Thread heilo
hi!

wow - cool code! it is very well structured i think (i like it ;-)! i just
would change 2 little details (thats only what i'd do):

if($id) is not enough for me - first of all i want that it can only be
transportet by GET. secondly i do not want people trying to hack my
mysql-server with some ugly url-hacking. so i test if it is a numeric input.
third it is possible that people may bookmark some ids to access them
directly so i would include a test if the requested id exists or not:

if(isset($_GET['id']) && is_numeric($_GET['id'])
{
$qry = 'SELECT `id` FROM `nuke_race` WHERE `id`='.$id;
$res = mysql_query($qry, $con);
if(mysql_num_rows($res)==0)
echo 'Sorry, this entry has been deleted or was never
created!'."\n";
else
// show entry
}

next - but this is really a small thing - i'd not make a long list of
options i'd create a for-loop like this:

echo ''."\n";
for($i = 65; $i <= 90; $i++)
echo ''.chr($i).''."\n";
echo ''."\n";

oh! i just saw that you use POST anyways. ;) also a possibility (but this
avoids the entries from being bookmarked).

keep phping!

.ma

Fulco of Scarborough <[EMAIL PROTECTED]> [EMAIL PROTECTED] 0:04 Uhr:

> Greeting everyone, my name is Jason and I am sorry for bugging you since you
> probably get a ton of these emails, but I was hoping you all might be able
> to help me.  I am attempting to design a script that presents the user with
> a form with 26 letters to choose from.  When they pick a letter I want it to
> take them to a list of all the entries in my database that begin with the
> letter they selected in link form.  When they click on the term, I want it
> to pull up the info for that entry.
> 
> I am only wanting to get some tips or a sample somewhere you may know of to
> get me going in the right direction.
> 
> 
> 
> Here is my current code so far:
> 
> 
> 
>  
> require("racesetup.php");
> 
> $con = mysql_connect($host, $user, $pass);
> 
> 
> 
> mysql_select_db($db, $con);
> 
> 
> 
> // display individual record
> 
> 
> 
> if ($id) {
> 
> 
> 
>  $result = mysql_query("SELECT * FROM nuke_race WHERE id=$id",$con);
> 
> 
> 
>  $myrow = mysql_fetch_array($result);
> 
> 
> 
>  printf("Race: %s\n", $myrow["race"]);
> 
> echo ""; 
> 
>  printf("Description: %s\n", $myrow["racetxt"]);
> 
> echo "";
> 
> echo "Back";
> 
> 
> 
> 
> } else {
> 
> echo " action=\"http://st.fulco.net/races.php\";>
> 
> Pick a letter to begin your search
> 
>  
> 
>   
> 
> A
> 
> B
> 
> C
> 
> D
> 
> E
> 
> F
> 
> G
> 
> H
> 
> I
> 
> J
> 
> K
> 
> L
> 
> M
> 
> N
> 
> O
> 
> P
> 
> Q
> 
> R
> 
> S
> 
> T
> 
> U
> 
> V
> 
> W
> 
> X
> 
> Y
> 
> Z
> 
>   
> 
> 
> 
> 
> 
>   
> 
> 
> 
> 
> 
> ";  
> 
> } else {
> 
> 
> 
> $result = mysql_query("SELECT * FROM nuke_race WHERE race LIKE
> '$letter%'",$con);
> 
>   if ($myrow = mysql_fetch_array($result)) {
> 
> 
> 
> // display list if there are records to display
> 
> 
> 
> do {
> 
> 
> 
>   printf("%s\n", $PHP_SELF, $myrow["id"],
> $myrow["race"]);
> 
> 
> 
> } while ($myrow = mysql_fetch_array($result));
> 
> 
> 
>   } else {
> 
> 
> 
> // no records to display
> 
> 
> 
> echo "Sorry, no records were found!";
> 
>   }
> 
> 
> 
> }
> 
> ?>
> 
> 
> 
> Thanks for your help in advance.
> 
> 
> 
> Yours in Service,
> 
> Jason Britton
> 
> Scar's   Legion
> 
> http://st.fulco.net 
> 
> [EMAIL PROTECTED]
> 
> 
> 
> Vincit imitationem veritas.
> 
> 
> 
>


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



[PHP-DB] Question

2003-06-05 Thread Felipe R.
Hi,

Im new in this news, and i want to know what news can fix php
problem(programing)??

Thanks



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



[PHP-DB] Passing URL parameters to array question.

2003-06-05 Thread Boa Constructor
Hey all, anyone know how I can pass an array of parameters to an array?
Basically if I want to pass the parameters in a URL, for example:

viewcart.php?quantity%5B14%5D=2&TypesOfInterests=11&recalculate=true

I'm using the following but it ain't workin so far.

foreach($shoppingcart['products'] as $buy => $quantity)

{

if ($_GET['buy'] == $buy)

{ // if we are here, we know this is the one

$shoppingcart['products'][$buy] = $_GET['quantity'];

}

When I view the cart at the moment only the value passed in the 1st instance
are assigned to the array.

Any ideas?



Cheers,

Graeme :)


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



Re: [PHP-DB] Printing date as 04-06-03

2003-06-05 Thread Becoming Digital
print date("m-d-y");

http://us3.php.net/manual/en/function.date.php

Edward Dudlik
Becoming Digital
www.becomingdigital.com


- Original Message -
From: "Steve B." <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, 04 June, 2003 17:58
Subject: [PHP-DB] Printing date as 04-06-03


Hi all,
M-D-Y with leading 0 is how I would like to print dates at my exciting web page.
I am trying DATE_FORMAT and my provider locked up?? :(=

How would you print this?
thx
steve
http://www.aifiles.com


__
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com

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





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



[PHP-DB] PHP/Mysql Script help.

2003-06-05 Thread Fulco of Scarborough
Greeting everyone, my name is Jason and I am sorry for bugging you since you
probably get a ton of these emails, but I was hoping you all might be able
to help me.  I am attempting to design a script that presents the user with
a form with 26 letters to choose from.  When they pick a letter I want it to
take them to a list of all the entries in my database that begin with the
letter they selected in link form.  When they click on the term, I want it
to pull up the info for that entry.

I am only wanting to get some tips or a sample somewhere you may know of to
get me going in the right direction.

 

Here is my current code so far:

 

Race: %s\n", $myrow["race"]);

  echo "";   

   printf("Description: %s\n", $myrow["racetxt"]);

  echo "";

  echo "Back";


 

} else {

  echo "http://st.fulco.net/races.php\";>

  Pick a letter to begin your search

   



  A

  B

  C

  D

  E

  F

  G

  H

  I

  J

  K

  L

  M

  N

  O

  P

  Q

  R

  S

  T

  U

  V

  W

  X

  Y

  Z



  

  



  



";  

} else {

 

$result = mysql_query("SELECT * FROM nuke_race WHERE race LIKE
'$letter%'",$con);

if ($myrow = mysql_fetch_array($result)) {

 

  // display list if there are records to display

 

  do {

 

printf("%s\n", $PHP_SELF, $myrow["id"],
$myrow["race"]);

 

  } while ($myrow = mysql_fetch_array($result));

 

} else {

 

  // no records to display

 

  echo "Sorry, no records were found!";

}

 

  }

?>

 

Thanks for your help in advance.

 

Yours in Service,

Jason Britton

Scar's   Legion

http://st.fulco.net   

[EMAIL PROTECTED]

 

Vincit imitationem veritas.

 



[PHP-DB] Printing date as 04-06-03

2003-06-05 Thread Steve B.
Hi all,
M-D-Y with leading 0 is how I would like to print dates at my exciting web page.
I am trying DATE_FORMAT and my provider locked up?? :(=

How would you print this?
thx
steve
http://www.aifiles.com


__
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com

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



Re: [PHP-DB] address info, forms, maintanance

2003-06-05 Thread chip . wiegand
Thanks to everyone for the suggestions. Got it fixed. Just added a couple 
lines of code - 
$sql1 = "select * from endusers where name like '$name'";
   $result1 = mysql_query($sql1); 
 $count1 = mysql_num_rows($result1);
 if ($count1 == "0" )
   $sql = "insert into endusers..blah blah blah

Now it works fine, no more duplicate entries. Just for those who asked - 
this is a database of end-user names
and addresses for a mailing list. The questions posted are kept by the 
department that responded to them. 
No one here has ever asked or implied a need to have the messages saved to 
the database, what they do
with the message is their game, not mine. I'm just cleaning up their 
existing code a bit.
--
Chip 

Miles Thompson <[EMAIL PROTECTED]> wrote on 06/04/2003 
08:31:14 AM:

> Chip,
> 
> Given that you have duplicate entries, then one field, or a combination 
of 
> several fields, will probably be unique.
> 
> Before adding a record execute a SELECT, using the values from the form 
> against that combination. If the number of records returned is greater 
than 
> 0, then execute an UPDATE query, otherwise an INSERT.
> 
> Now, that information is so vague to be almost useless, for it begs a 
> number of other questions, such as
> How many questions are end users allowed to ask?
> How are questions flagged for expiration or completion/solution?
> What kind of mix of questions do you allow?
> 
> Cookies only store a bit of information on the user's browser. There's 
> nothing magic about them - google for "netscape cookies". I don't think 
> they'd be much help to you here.
> 
> HTH - Miles Thompson
> 
> At 01:13 PM 6/4/2003 -0700, [EMAIL PROTECTED] wrote:
> >I need to modify some company web pages that include a form for asking 
the
> >company departments questions, such as service dept, etc. As the forms 
are
> >currently built there is some field validation but no cookies. This 
info
> >is saved in a mysql database, problem is, there are duplicate entries,
> >every time an  end-user posts a question. What kind of code do I need 
to
> >add to these existing pages to prevent duplicate entries in the 
database?
> >(Manually scanning through and deleting dupes is a real drag.) And what
> >about cookies? Could I make use of these on these pages? I haven't 
worked
> >with cookies yet, so am not sure where to start with that part.
> >Thanks,
> >--
> >Chip
> >
> >--
> >PHP Database Mailing List (http://www.php.net/)
> >To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


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



[PHP-DB] while - if - problem

2003-06-05 Thread Earl
FYI
this was beginning to bug me out... so I decided to try the trim function
and walla... it worked.

Thanks for ya'll assistance.

---
$eventQuery=ifx_query('select * from event'
  .' where e_date >= today '
  .' and e_status in ("O","C") '
   .' and out_id is not null '
  .' order by s_acro, e_acro ',$db) or die (ifx_error());

while($cols=ifx_fetch_row($eventQuery)) 
 {
  if (trim($cols['out_type'])=='0') 
   {
$r_away['linetype']='L';
$r_home['linetype']='L';
   }
  
  elseif (trim($cols['out_type'])=='1')
   {
$r_away['linetype']='H';
$r_home['linetype']='H';
   }
  
  if (trim($cols['s_acro'])=='CF' || trim($cols["s_acro"])=='PF') 
   {
$r_away['sport']='1';
$r_home['sport']='1';
$s_lt='PS';
$t_lt='TP';
   }

  elseif (trim($cols['s_acro'])=='PB' || trim($cols['s_acro'])=='CB')
   {
$r_away['sport']='2';
$r_home['sport']='2';
$s_lt='PS';
$t_lt='TP';
   }
  
  elseif (trim($cols['s_acro'])=='B')
   {
$r_away['sport']='3';
$r_home['sport']='3';
$s_lt='ML';
$t_lt='TM';
   }
   
  elseif (trim($cols['s_acro'])=='H')
   {
$r_away['sport']='4';
$r_home['sport']='4';
$s_lt='ML';
$t_lt='TM';
   }

$r_away['rotation']=$cols['out_id'];
$r_home['rotation']=($r_away['rotation'] + 1);

echo "".$r_away['rotation']." , ".$r_home['rotation']." , ".$r_away['linetype']." , 
".$r_home['linetype']." , ".$r_away['sport']." , ".$r_home['sport']."\n"; 
 }

Re: [PHP-DB] address info, forms, maintanance

2003-06-05 Thread Miles Thompson
Chip,

What's the database being used for then, if not to store and track 
questions and replies? If only as a repository of addresses that 's rather 
useless.

Unless you want to track the frequency of user's questions, then you could 
update a counter field for their email address.

If you've not gone down the road too far with this, there are some help 
desk type PHP solutions out there.

Miles

At 01:30 PM 6/4/2003 -0700, [EMAIL PROTECTED] wrote:
Dan Brunner <[EMAIL PROTECTED]> wrote on 06/04/2003 01:24:13 PM:

> Hello!!
> Are talking about the same "Post Question"???
> On another words, what is being duplicated??
> If not, you can use auto_increment.
> Dan
This pertains to every time a person visits the page and fills in the form
- today, tommorrow, next week, next month, whenever. The address info is
being written to the database each time they send the form. The message
body itself isn't saved to the database, only the name and address info.
--
Chip
> On Wednesday, June 4, 2003, at 03:13  PM, [EMAIL PROTECTED] wrote:
>
> > I need to modify some company web pages that include a form for asking
> > the
> > company departments questions, such as service dept, etc. As the forms
> > are
> > currently built there is some field validation but no cookies. This
> > info
> > is saved in a mysql database, problem is, there are duplicate entries,
> > every time an  end-user posts a question. What kind of code do I need
> > to
> > add to these existing pages to prevent duplicate entries in the
> > database?
> > (Manually scanning through and deleting dupes is a real drag.) And
what
> > about cookies? Could I make use of these on these pages? I haven't
> > worked
> > with cookies yet, so am not sure where to start with that part.
> > Thanks,
> > --
> > Chip
> >
> > --
> > PHP Database Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


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


Re: [PHP-DB] address info, forms, maintanance

2003-06-05 Thread CPT John W. Holmes
> I need to modify some company web pages that include a form for asking the
> company departments questions, such as service dept, etc. As the forms are
> currently built there is some field validation but no cookies. This info
> is saved in a mysql database, problem is, there are duplicate entries,
> every time an  end-user posts a question.

Do you mean that when I hit "submit" there are duplicate entries submitted
or that it may match what someone else has submitted and become duplicate?

If it's the second case, wouldn't that be optimal? You'd know that X people
had the same issue/question and you can reply to each one when it's
resolved...

> What kind of code do I need to
> add to these existing pages to prevent duplicate entries in the database?

Makeing the column unique is the easiest way. If you get a "duplicate" error
from mysql_error(), then just ignore it because the problem is apparently
accounted for.

> (Manually scanning through and deleting dupes is a real drag.)

No one does anything manually... :) Easiest way to "fix" your data now would
be to make a new table with UNIQUE columns where you need them. Then do an
INSERT INTO ... SELECT to move the data from one table to the other.
Duplicates will be ignored by the new table. Proceed as normal... :)

> And what
> about cookies? Could I make use of these on these pages? I haven't worked
> with cookies yet, so am not sure where to start with that part.

Do you need to "remember" anything that the user enters in the form that's
specific to that user? That's all cookies are... a variable that you store
on the user's machine. If you don't already have a reason for them, you
probably don't need them.

---John Holmes...


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



Re: [PHP-DB] address info, forms, maintanance

2003-06-05 Thread chip . wiegand
Dan Brunner <[EMAIL PROTECTED]> wrote on 06/04/2003 01:24:13 PM:

> Hello!!
> Are talking about the same "Post Question"???
> On another words, what is being duplicated??
> If not, you can use auto_increment.
> Dan

This pertains to every time a person visits the page and fills in the form 
- today, tommorrow, next week, next month, whenever. The address info is 
being written to the database each time they send the form. The message 
body itself isn't saved to the database, only the name and address info.
--
Chip

> On Wednesday, June 4, 2003, at 03:13  PM, [EMAIL PROTECTED] wrote:
> 
> > I need to modify some company web pages that include a form for asking 

> > the
> > company departments questions, such as service dept, etc. As the forms 

> > are
> > currently built there is some field validation but no cookies. This 
> > info
> > is saved in a mysql database, problem is, there are duplicate entries,
> > every time an  end-user posts a question. What kind of code do I need 
> > to
> > add to these existing pages to prevent duplicate entries in the 
> > database?
> > (Manually scanning through and deleting dupes is a real drag.) And 
what
> > about cookies? Could I make use of these on these pages? I haven't 
> > worked
> > with cookies yet, so am not sure where to start with that part.
> > Thanks,
> > --
> > Chip
> >
> > -- 
> > PHP Database Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> 
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


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



Re: [PHP-DB] address info, forms, maintanance

2003-06-05 Thread Miles Thompson
Chip,

Given that you have duplicate entries, then one field, or a combination of 
several fields, will probably be unique.

Before adding a record execute a SELECT, using the values from the form 
against that combination. If the number of records returned is greater than 
0, then execute an UPDATE query, otherwise an INSERT.

Now, that information is so vague to be almost useless, for it begs a 
number of other questions, such as
How many questions are end users allowed to ask?
How are questions flagged for expiration or completion/solution?
What kind of mix of questions do you allow?

Cookies only store a bit of information on the user's browser. There's 
nothing magic about them - google for "netscape cookies". I don't think 
they'd be much help to you here.

HTH - Miles Thompson

At 01:13 PM 6/4/2003 -0700, [EMAIL PROTECTED] wrote:
I need to modify some company web pages that include a form for asking the
company departments questions, such as service dept, etc. As the forms are
currently built there is some field validation but no cookies. This info
is saved in a mysql database, problem is, there are duplicate entries,
every time an  end-user posts a question. What kind of code do I need to
add to these existing pages to prevent duplicate entries in the database?
(Manually scanning through and deleting dupes is a real drag.) And what
about cookies? Could I make use of these on these pages? I haven't worked
with cookies yet, so am not sure where to start with that part.
Thanks,
--
Chip
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


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


Re: [PHP-DB] address info, forms, maintanance

2003-06-05 Thread Dan Brunner
Hello!!

Are talking about the same "Post Question"???

On another words, what is being duplicated??

If not, you can use auto_increment.

Dan





On Wednesday, June 4, 2003, at 03:13  PM, [EMAIL PROTECTED] wrote:

I need to modify some company web pages that include a form for asking 
the
company departments questions, such as service dept, etc. As the forms 
are
currently built there is some field validation but no cookies. This 
info
is saved in a mysql database, problem is, there are duplicate entries,
every time an  end-user posts a question. What kind of code do I need 
to
add to these existing pages to prevent duplicate entries in the 
database?
(Manually scanning through and deleting dupes is a real drag.) And what
about cookies? Could I make use of these on these pages? I haven't 
worked
with cookies yet, so am not sure where to start with that part.
Thanks,
--
Chip

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


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


Re: [PHP-DB] while - if problem

2003-06-05 Thread Miles Thompson
The closing else is not bracketed.
Have you echoed the vars & confirmed values therein? It's amazing how often 
that will catch you.
Otherwise simplicate: comment out a bunch of stuff and build it up bit by 
bit, echoing all the while.
Miles Thompson

At 02:07 PM 6/4/2003 -0600, Earl wrote:
Sorry about that I did not get the closing tag when i copied the code.
I did as you said and it still gave the same problem.
below is the complete code

$eventQuery=ifx_query('select * from event'
  .' where e_date >= today '
  .' and e_status in ("O","C") '
   .' and out_id is not null '
  .' order by s_acro, e_acro ',$db) or die (ifx_error());
while($cols=ifx_fetch_row($eventQuery))
 {
  if ($cols['out_type']=='0')
   {
$r_away['linetype']='L';
$r_home['linetype']='L';
   }
  elseif ($cols['out_type']=='1')
   {
$r_away['linetype']='H';
$r_home['linetype']='H';
   }
  if (($cols['s_acro']=='CF') || ($cols["s_acro"]=='PF'))
   {
$r_away['sport']='1';
$r_home['sport']='1';
$s_lt='PS';
$t_lt='TP';
   }
  elseif (($cols['s_acro']=='PB') || ($cols['s_acro']=='CB'))
   {
$r_away['sport']='2';
$r_home['sport']='2';
$s_lt='PS';
$t_lt='TP';
   }
  elseif ($cols['s_acro']=='B')
   {
$r_away['sport']='3';
$r_home['sport']='3';
$s_lt='ML';
$t_lt='TM';
   }
  else
$r_away['sport']='4';
$r_home['sport']='4';
$s_lt='ML';
$t_lt='TM';
$r_away['rotation']=$cols['out_id'];
$r_home['rotation']=($r_away['rotation'] + 1);
echo "".$r_away['rotation']." , ".$r_home['rotation']." ,
".$r_away['linetype']." , ".$r_home['linetype']." , ".$r_away['sport']." ,
".$r_home['sport']."\n";
 }
-


- Original Message -
From: "Becoming Digital" <[EMAIL PROTECTED]>
To: "PHP-DB" <[EMAIL PROTECTED]>
Sent: Wednesday, June 04, 2003 1:52 PM
Subject: Re: [PHP-DB] while - if problem
> You don't have a closing bracket on your while() loop and you should not
have
> the else comments bracketed.  Try this:
>
> while($cols=ifx_fetch_row($eventQuery))
> {
>  if (($cols['s_acro']=='CF') || ($cols["s_acro"]=='PF'))
>{
> $r_away['sport']='1';
> $r_home['sport']='1';
> $s_lt='PS';
> $t_lt='TP';
>}
>
>   elseif (($cols['s_acro']=='PB') || ($cols['s_acro']=='CB'))
>{
> $r_away['sport']='2';
> $r_home['sport']='2';
> $s_lt='PS';
> $t_lt='TP';
>}
>
>   elseif ($cols['s_acro']=='B')
>{
> $r_away['sport']='3';
> $r_home['sport']='3';
> $s_lt='ML';
> $t_lt='TM';
>}
>
>   else
> $r_away['sport']='4';
> $r_home['sport']='4';
> $s_lt='ML';
> $t_lt='TM';
> }
>
>
> Edward Dudlik
> Becoming Digital
> www.becomingdigital.com
>
>
> - Original Message -
> From: "Earl" <[EMAIL PROTECTED]>
> To: "PHP-DB" <[EMAIL PROTECTED]>
> Sent: Wednesday, 04 June, 2003 15:44
> Subject: [PHP-DB] while - if problem
>
>
> Hey guys, I've got a problem with this piece of code
> it is skipping the contents of the if and elseif statements and only
printing
> the else values, even though the if or one of the elseif statements might
be
> true.
> what could possibly be the problem??
>
> --
--
> 
> $eventQuery=ifx_query('select * from eventtable'
>   .' where e_date >= today '
>   .' and e_status in ("O","C") '
>.' and out_id is not null '
>   .' order by s_acro, e_acro ',$db) or die (ifx_error());
>
> while($cols=ifx_fetch_row($eventQuery))
>  {
>  if (($cols['s_acro']=='CF') || ($cols["s_acro"]=='PF'))
>{
> $r_away['sport']='1';
> $r_home['sport']='1';
> $s_lt='PS';
> $t_lt='TP';
>}
>
>   elseif (($cols['s_acro']=='PB') || ($cols['s_acro']=='CB'))
>{
> $r_away['sport']='2';
> $r_home['sport']='2';
> $s_lt='PS';
> $t_lt='TP';
>}
>
>   elseif ($cols['s_acro']=='B')
>{
> $r_away['sport']='3';
> $r_home['sport']='3';
> $s_lt='ML';
> $t_lt='TM';
>}
>
>   else   {
> $r_away['sport']='4';
> $r_home['sport']='4';
> $s_lt='ML';
> $t_lt='TM';
>}
> --
--
> 
> output is always:  4, ML, TM
>
>
> thanks in advance
>
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


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


[PHP-DB] address info, forms, maintanance

2003-06-05 Thread chip . wiegand
I need to modify some company web pages that include a form for asking the 
company departments questions, such as service dept, etc. As the forms are 
currently built there is some field validation but no cookies. This info 
is saved in a mysql database, problem is, there are duplicate entries, 
every time an  end-user posts a question. What kind of code do I need to 
add to these existing pages to prevent duplicate entries in the database? 
(Manually scanning through and deleting dupes is a real drag.) And what 
about cookies? Could I make use of these on these pages? I haven't worked 
with cookies yet, so am not sure where to start with that part.
Thanks,
--
Chip

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



Re: [PHP-DB] while - if problem

2003-06-05 Thread Earl
Sorry about that I did not get the closing tag when i copied the code.
I did as you said and it still gave the same problem.
below is the complete code

$eventQuery=ifx_query('select * from event'
  .' where e_date >= today '
  .' and e_status in ("O","C") '
   .' and out_id is not null '
  .' order by s_acro, e_acro ',$db) or die (ifx_error());

while($cols=ifx_fetch_row($eventQuery))
 {
  if ($cols['out_type']=='0')
   {
$r_away['linetype']='L';
$r_home['linetype']='L';
   }

  elseif ($cols['out_type']=='1')
   {
$r_away['linetype']='H';
$r_home['linetype']='H';
   }

  if (($cols['s_acro']=='CF') || ($cols["s_acro"]=='PF'))
   {
$r_away['sport']='1';
$r_home['sport']='1';
$s_lt='PS';
$t_lt='TP';
   }

  elseif (($cols['s_acro']=='PB') || ($cols['s_acro']=='CB'))
   {
$r_away['sport']='2';
$r_home['sport']='2';
$s_lt='PS';
$t_lt='TP';
   }

  elseif ($cols['s_acro']=='B')
   {
$r_away['sport']='3';
$r_home['sport']='3';
$s_lt='ML';
$t_lt='TM';
   }

  else
$r_away['sport']='4';
$r_home['sport']='4';
$s_lt='ML';
$t_lt='TM';


$r_away['rotation']=$cols['out_id'];
$r_home['rotation']=($r_away['rotation'] + 1);

echo "".$r_away['rotation']." , ".$r_home['rotation']." ,
".$r_away['linetype']." , ".$r_home['linetype']." , ".$r_away['sport']." ,
".$r_home['sport']."\n";
 }
-



- Original Message -
From: "Becoming Digital" <[EMAIL PROTECTED]>
To: "PHP-DB" <[EMAIL PROTECTED]>
Sent: Wednesday, June 04, 2003 1:52 PM
Subject: Re: [PHP-DB] while - if problem


> You don't have a closing bracket on your while() loop and you should not
have
> the else comments bracketed.  Try this:
>
> while($cols=ifx_fetch_row($eventQuery))
> {
>  if (($cols['s_acro']=='CF') || ($cols["s_acro"]=='PF'))
>{
> $r_away['sport']='1';
> $r_home['sport']='1';
> $s_lt='PS';
> $t_lt='TP';
>}
>
>   elseif (($cols['s_acro']=='PB') || ($cols['s_acro']=='CB'))
>{
> $r_away['sport']='2';
> $r_home['sport']='2';
> $s_lt='PS';
> $t_lt='TP';
>}
>
>   elseif ($cols['s_acro']=='B')
>{
> $r_away['sport']='3';
> $r_home['sport']='3';
> $s_lt='ML';
> $t_lt='TM';
>}
>
>   else
> $r_away['sport']='4';
> $r_home['sport']='4';
> $s_lt='ML';
> $t_lt='TM';
> }
>
>
> Edward Dudlik
> Becoming Digital
> www.becomingdigital.com
>
>
> - Original Message -
> From: "Earl" <[EMAIL PROTECTED]>
> To: "PHP-DB" <[EMAIL PROTECTED]>
> Sent: Wednesday, 04 June, 2003 15:44
> Subject: [PHP-DB] while - if problem
>
>
> Hey guys, I've got a problem with this piece of code
> it is skipping the contents of the if and elseif statements and only
printing
> the else values, even though the if or one of the elseif statements might
be
> true.
> what could possibly be the problem??
>
> --
--
> 
> $eventQuery=ifx_query('select * from eventtable'
>   .' where e_date >= today '
>   .' and e_status in ("O","C") '
>.' and out_id is not null '
>   .' order by s_acro, e_acro ',$db) or die (ifx_error());
>
> while($cols=ifx_fetch_row($eventQuery))
>  {
>  if (($cols['s_acro']=='CF') || ($cols["s_acro"]=='PF'))
>{
> $r_away['sport']='1';
> $r_home['sport']='1';
> $s_lt='PS';
> $t_lt='TP';
>}
>
>   elseif (($cols['s_acro']=='PB') || ($cols['s_acro']=='CB'))
>{
> $r_away['sport']='2';
> $r_home['sport']='2';
> $s_lt='PS';
> $t_lt='TP';
>}
>
>   elseif ($cols['s_acro']=='B')
>{
> $r_away['sport']='3';
> $r_home['sport']='3';
> $s_lt='ML';
> $t_lt='TM';
>}
>
>   else   {
> $r_away['sport']='4';
> $r_home['sport']='4';
> $s_lt='ML';
> $t_lt='TM';
>}
> --
--
> 
> output is always:  4, ML, TM
>
>
> thanks in advance
>
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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



Re: [PHP-DB] Datetime help in an INSERT...

2003-06-05 Thread CPT John W. Holmes
> 2. Place single quotes within your VALUES parens, e.g.

If they are really strings. Integers or dates in a MMDD format do not
require quotes.

> $denylog = "INSERT INTO deny (account, td, datefield ) VALUES ('$tmp',
> '$td', NOW() )"

---John Holmes...


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



RE: [PHP-DB] Datetime help in an INSERT...

2003-06-05 Thread NIPP, SCOTT V (SBCSI)
I think this is the real problem.  Basically, the $td variable is
defined intially, but upon clicking a button the page reloads itself and I
believe that at this time it is losing the $td variable.  I am not quite
sure how to prevent this from occurring.  Thanks again for all the help so
far.

-Original Message-
From: CPT John W. Holmes [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 04, 2003 2:14 PM
To: NIPP, SCOTT V (SBCSI); [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Datetime help in an INSERT...


> > I am stumbling across something that I thought I have done before,
> > and I am not having any luck finding an example of this.  Basically, I
am
> > wanting to timestamp the date and time into new entries in a simple
> database
> > table.  The following section is the actual code for this, and I cannot
> > figure out how to get the date/time stamp to populate into the database.
> > Thanks in advance for the help.  I suspect this is a very simple fix.
> >
> > $denylog = "INSERT INTO deny (account, td, date) VALUES ($tmp, $td,
> NOW())";
> > $denylog_result = mysql_query($denylog, $Prod) or die(mysql_error());
>
> The error I am receiving is:
>
> You have an error in your SQL syntax near ' NOW())' at line 1

Are you sure $td has a value? If it's blank, you'd get an error like that.

---John Holmes...

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



Re: [PHP-DB] while - if problem

2003-06-05 Thread Becoming Digital
You don't have a closing bracket on your while() loop and you should not have
the else comments bracketed.  Try this:

while($cols=ifx_fetch_row($eventQuery))
{
 if (($cols['s_acro']=='CF') || ($cols["s_acro"]=='PF'))
   {
$r_away['sport']='1';
$r_home['sport']='1';
$s_lt='PS';
$t_lt='TP';
   }

  elseif (($cols['s_acro']=='PB') || ($cols['s_acro']=='CB'))
   {
$r_away['sport']='2';
$r_home['sport']='2';
$s_lt='PS';
$t_lt='TP';
   }

  elseif ($cols['s_acro']=='B')
   {
$r_away['sport']='3';
$r_home['sport']='3';
$s_lt='ML';
$t_lt='TM';
   }

  else
$r_away['sport']='4';
$r_home['sport']='4';
$s_lt='ML';
$t_lt='TM';
}


Edward Dudlik
Becoming Digital
www.becomingdigital.com


- Original Message -
From: "Earl" <[EMAIL PROTECTED]>
To: "PHP-DB" <[EMAIL PROTECTED]>
Sent: Wednesday, 04 June, 2003 15:44
Subject: [PHP-DB] while - if problem


Hey guys, I've got a problem with this piece of code
it is skipping the contents of the if and elseif statements and only printing
the else values, even though the if or one of the elseif statements might be
true.
what could possibly be the problem??



$eventQuery=ifx_query('select * from eventtable'
  .' where e_date >= today '
  .' and e_status in ("O","C") '
   .' and out_id is not null '
  .' order by s_acro, e_acro ',$db) or die (ifx_error());

while($cols=ifx_fetch_row($eventQuery))
 {
 if (($cols['s_acro']=='CF') || ($cols["s_acro"]=='PF'))
   {
$r_away['sport']='1';
$r_home['sport']='1';
$s_lt='PS';
$t_lt='TP';
   }

  elseif (($cols['s_acro']=='PB') || ($cols['s_acro']=='CB'))
   {
$r_away['sport']='2';
$r_home['sport']='2';
$s_lt='PS';
$t_lt='TP';
   }

  elseif ($cols['s_acro']=='B')
   {
$r_away['sport']='3';
$r_home['sport']='3';
$s_lt='ML';
$t_lt='TM';
   }

  else   {
$r_away['sport']='4';
$r_home['sport']='4';
$s_lt='ML';
$t_lt='TM';
   }


output is always:  4, ML, TM


thanks in advance




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



RE: [PHP-DB] Datetime help in an INSERT...

2003-06-05 Thread Gary . Every
1. Change your field name from date to something like datefield (or backtick
it)

2. Place single quotes within your VALUES parens, e.g. 

$denylog = "INSERT INTO deny (account, td, datefield ) VALUES ('$tmp',
'$td', NOW() )"

Gary Every
Sr. UNIX Administrator
Ingram Entertainment
(615) 287-4876
"Pay It Forward"
mailto:[EMAIL PROTECTED]
http://accessingram.com


> -Original Message-
> From: NIPP, SCOTT V (SBCSI) [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, June 04, 2003 2:06 PM
> To: 'Rankin, Randy'; '[EMAIL PROTECTED]'
> Subject: RE: [PHP-DB] Datetime help in an INSERT...
> 
> 
>   No, the field is a Datetime field rather than a Timestamp field.
> 
> -Original Message-
> From: Rankin, Randy [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, June 04, 2003 1:59 PM
> To: '[EMAIL PROTECTED]'
> Subject: RE: [PHP-DB] Datetime help in an INSERT...
> 
> 
> Correction ( I typed this in a hurry ) ...
> 
> If you are using MySql and the date field is of type 
> timestamp, you should
> _not_
> have to insert anything using the query. It will update 
> automatically when
> the record is inserted and/or updated.
> 
> ie; $denylog = "INSERT INTO deny (account, td ) VALUES ($tmp, $td )";
> 
> Randy
> 
> -Original Message-
> From: Rankin, Randy [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, June 04, 2003 1:56 PM
> To: '[EMAIL PROTECTED]'
> Subject: RE: [PHP-DB] Datetime help in an INSERT...
> 
> 
> If you are using MySql with the date field is of type 
> timestamp, you should
> have to insert anything using the query. It will update 
> automatically when
> the record is inserted and/or updated.
> 
> ie; $denylog = "INSERT INTO deny (account, td ) VALUES ($tmp, $td )";
> 
> Randy
> 
> -Original Message-
> From: NIPP, SCOTT V (SBCSI) [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, June 04, 2003 1:47 PM
> To: '[EMAIL PROTECTED]'
> Cc: '[EMAIL PROTECTED]'
> Subject: RE: [PHP-DB] Datetime help in an INSERT...
> 
> 
>   The error I am receiving is:
> 
> You have an error in your SQL syntax near ' NOW())' at line 1
> 
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, June 04, 2003 1:45 PM
> To: NIPP, SCOTT V (SBCSI)
> Subject: Re: [PHP-DB] Datetime help in an INSERT...
> 
> 
> what kind of error are you getting?
> 
> > I am stumbling across something that I thought I have 
> done before,
> > and I am not having any luck finding an example of this.  
> Basically, I am
> > wanting to timestamp the date and time into new entries in a simple
> database
> > table.  The following section is the actual code for this, 
> and I cannot
> > figure out how to get the date/time stamp to populate into 
> the database.
> > Thanks in advance for the help.  I suspect this is a very 
> simple fix.
> > 
> > $denylog = "INSERT INTO deny (account, td, date) VALUES ($tmp, $td,
> NOW())";
> > $denylog_result = mysql_query($denylog, $Prod) or 
> die(mysql_error());
> > 
> > Scott Nipp
> > Phone:  (214) 858-1289
> > E-mail:  [EMAIL PROTECTED]
> > Web:  http:\\ldsa.sbcld.sbc.com
> > 
> > 
> > 
> > --
> > PHP Database Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> > 
> 
> 
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


[PHP-DB] while - if problem

2003-06-05 Thread Earl
Hey guys, I've got a problem with this piece of code
it is skipping the contents of the if and elseif statements and only printing the else 
values, even though the if or one of the elseif statements might be true.
what could possibly be the problem??


$eventQuery=ifx_query('select * from eventtable'
  .' where e_date >= today '
  .' and e_status in ("O","C") '
   .' and out_id is not null '
  .' order by s_acro, e_acro ',$db) or die (ifx_error());

while($cols=ifx_fetch_row($eventQuery)) 
 {
 if (($cols['s_acro']=='CF') || ($cols["s_acro"]=='PF')) 
   {
$r_away['sport']='1';
$r_home['sport']='1';
$s_lt='PS';
$t_lt='TP';
   }

  elseif (($cols['s_acro']=='PB') || ($cols['s_acro']=='CB'))
   {
$r_away['sport']='2';
$r_home['sport']='2';
$s_lt='PS';
$t_lt='TP';
   }
  
  elseif ($cols['s_acro']=='B')
   {
$r_away['sport']='3';
$r_home['sport']='3';
$s_lt='ML';
$t_lt='TM';
   }
   
  else   {
$r_away['sport']='4';
$r_home['sport']='4';
$s_lt='ML';
$t_lt='TM';
   }

output is always:  4, ML, TM


thanks in advance



Re: [PHP-DB] Datetime help in an INSERT...

2003-06-05 Thread CPT John W. Holmes
> > I am stumbling across something that I thought I have done before,
> > and I am not having any luck finding an example of this.  Basically, I
am
> > wanting to timestamp the date and time into new entries in a simple
> database
> > table.  The following section is the actual code for this, and I cannot
> > figure out how to get the date/time stamp to populate into the database.
> > Thanks in advance for the help.  I suspect this is a very simple fix.
> >
> > $denylog = "INSERT INTO deny (account, td, date) VALUES ($tmp, $td,
> NOW())";
> > $denylog_result = mysql_query($denylog, $Prod) or die(mysql_error());
>
> The error I am receiving is:
>
> You have an error in your SQL syntax near ' NOW())' at line 1

Are you sure $td has a value? If it's blank, you'd get an error like that.

---John Holmes...


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



RE: [PHP-DB] Datetime help in an INSERT...

2003-06-05 Thread NIPP, SCOTT V (SBCSI)
No, the field is a Datetime field rather than a Timestamp field.

-Original Message-
From: Rankin, Randy [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 04, 2003 1:59 PM
To: '[EMAIL PROTECTED]'
Subject: RE: [PHP-DB] Datetime help in an INSERT...


Correction ( I typed this in a hurry ) ...

If you are using MySql and the date field is of type timestamp, you should
_not_
have to insert anything using the query. It will update automatically when
the record is inserted and/or updated.

ie; $denylog = "INSERT INTO deny (account, td ) VALUES ($tmp, $td )";

Randy

-Original Message-
From: Rankin, Randy [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 04, 2003 1:56 PM
To: '[EMAIL PROTECTED]'
Subject: RE: [PHP-DB] Datetime help in an INSERT...


If you are using MySql with the date field is of type timestamp, you should
have to insert anything using the query. It will update automatically when
the record is inserted and/or updated.

ie; $denylog = "INSERT INTO deny (account, td ) VALUES ($tmp, $td )";

Randy

-Original Message-
From: NIPP, SCOTT V (SBCSI) [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 04, 2003 1:47 PM
To: '[EMAIL PROTECTED]'
Cc: '[EMAIL PROTECTED]'
Subject: RE: [PHP-DB] Datetime help in an INSERT...


The error I am receiving is:

You have an error in your SQL syntax near ' NOW())' at line 1

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 04, 2003 1:45 PM
To: NIPP, SCOTT V (SBCSI)
Subject: Re: [PHP-DB] Datetime help in an INSERT...


what kind of error are you getting?

>   I am stumbling across something that I thought I have done before,
> and I am not having any luck finding an example of this.  Basically, I am
> wanting to timestamp the date and time into new entries in a simple
database
> table.  The following section is the actual code for this, and I cannot
> figure out how to get the date/time stamp to populate into the database.
> Thanks in advance for the help.  I suspect this is a very simple fix.
> 
> $denylog = "INSERT INTO deny (account, td, date) VALUES ($tmp, $td,
NOW())";
> $denylog_result = mysql_query($denylog, $Prod) or die(mysql_error());
> 
> Scott Nipp
> Phone:  (214) 858-1289
> E-mail:  [EMAIL PROTECTED]
> Web:  http:\\ldsa.sbcld.sbc.com
> 
> 
> 
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 



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

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



RE: [PHP-DB] Datetime help in an INSERT...

2003-06-05 Thread Rankin, Randy
Correction ( I typed this in a hurry ) ...

If you are using MySql and the date field is of type timestamp, you should
_not_
have to insert anything using the query. It will update automatically when
the record is inserted and/or updated.

ie; $denylog = "INSERT INTO deny (account, td ) VALUES ($tmp, $td )";

Randy

-Original Message-
From: Rankin, Randy [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 04, 2003 1:56 PM
To: '[EMAIL PROTECTED]'
Subject: RE: [PHP-DB] Datetime help in an INSERT...


If you are using MySql with the date field is of type timestamp, you should
have to insert anything using the query. It will update automatically when
the record is inserted and/or updated.

ie; $denylog = "INSERT INTO deny (account, td ) VALUES ($tmp, $td )";

Randy

-Original Message-
From: NIPP, SCOTT V (SBCSI) [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 04, 2003 1:47 PM
To: '[EMAIL PROTECTED]'
Cc: '[EMAIL PROTECTED]'
Subject: RE: [PHP-DB] Datetime help in an INSERT...


The error I am receiving is:

You have an error in your SQL syntax near ' NOW())' at line 1

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 04, 2003 1:45 PM
To: NIPP, SCOTT V (SBCSI)
Subject: Re: [PHP-DB] Datetime help in an INSERT...


what kind of error are you getting?

>   I am stumbling across something that I thought I have done before,
> and I am not having any luck finding an example of this.  Basically, I am
> wanting to timestamp the date and time into new entries in a simple
database
> table.  The following section is the actual code for this, and I cannot
> figure out how to get the date/time stamp to populate into the database.
> Thanks in advance for the help.  I suspect this is a very simple fix.
> 
> $denylog = "INSERT INTO deny (account, td, date) VALUES ($tmp, $td,
NOW())";
> $denylog_result = mysql_query($denylog, $Prod) or die(mysql_error());
> 
> Scott Nipp
> Phone:  (214) 858-1289
> E-mail:  [EMAIL PROTECTED]
> Web:  http:\\ldsa.sbcld.sbc.com
> 
> 
> 
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 



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


RE: [PHP-DB] Datetime help in an INSERT...

2003-06-05 Thread Rankin, Randy
If you are using MySql with the date field is of type timestamp, you should
have to insert anything using the query. It will update automatically when
the record is inserted and/or updated.

ie; $denylog = "INSERT INTO deny (account, td ) VALUES ($tmp, $td )";

Randy

-Original Message-
From: NIPP, SCOTT V (SBCSI) [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 04, 2003 1:47 PM
To: '[EMAIL PROTECTED]'
Cc: '[EMAIL PROTECTED]'
Subject: RE: [PHP-DB] Datetime help in an INSERT...


The error I am receiving is:

You have an error in your SQL syntax near ' NOW())' at line 1

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 04, 2003 1:45 PM
To: NIPP, SCOTT V (SBCSI)
Subject: Re: [PHP-DB] Datetime help in an INSERT...


what kind of error are you getting?

>   I am stumbling across something that I thought I have done before,
> and I am not having any luck finding an example of this.  Basically, I am
> wanting to timestamp the date and time into new entries in a simple
database
> table.  The following section is the actual code for this, and I cannot
> figure out how to get the date/time stamp to populate into the database.
> Thanks in advance for the help.  I suspect this is a very simple fix.
> 
> $denylog = "INSERT INTO deny (account, td, date) VALUES ($tmp, $td,
NOW())";
> $denylog_result = mysql_query($denylog, $Prod) or die(mysql_error());
> 
> Scott Nipp
> Phone:  (214) 858-1289
> E-mail:  [EMAIL PROTECTED]
> Web:  http:\\ldsa.sbcld.sbc.com
> 
> 
> 
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 



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


Re: [PHP-DB] another redirecting question

2003-06-05 Thread Jason Wong
On Friday 30 May 2003 23:11, Ovaltine wrote:
> At some point you need to force users to upgrade.

In the case of javascript I don't think 'upgrade' is an issue here. The vast 
majority of browsers are certainly capable of executing javascript, rather 
the issue is the people who consciously choose to disable it (to get rid of 
pop-up ads, to prevent stupid websites from disabling your right-mouse 
button, and any number of other annoyances).

> As
> designer/programmer, it's almost impossible to design solutions for
> every situation. Is it really worth the time and effort to modify code
> for a user using godforsaken OS with little known limited functionaily
> browser? I say no as do some other major sites like ESPN.
>
> http://devedge.netscape.com/viewsource/2003/espn-interview/01/

I think you chose the wrong article to illustrate your point, because it does 
nothing to support your argument. They redesigned their website to look to 
the future when more and more browsers will be supporting CSS, DHTML etc.

In the case of javascript, I think I can safely say that as people are more 
internet-savvy the proportion of browsers which have it disabled by choice 
will increase.

> Development is a process. At one point, a decision has to be made as to
> the technical constraints of a site. In today's world it is completely
> realistic to force users to enable JavaScripting ...

In the context of PHP in general, if it can be done server-side do it 
server-side. Only rely on (if it can be relied upon!) javascript as a last 
resort.

And in the context of this thread in particular, the problem is ...

> > The scripts I need to run before I redirect automatically
> > send output to the browser.  I cannot alter these scripts.

... server-side and the solution is to alter the 'unalterable' scripts to 
prevent any output. It is better to solve the problem at the places where you 
have control (at the server) rather than pass the problem onto places where 
you have no control (the user's browser).

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-db
--
/*
He who always plows a straight furrow is in a rut.
*/


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



RE: [PHP-DB] Datetime help in an INSERT...

2003-06-05 Thread NIPP, SCOTT V (SBCSI)
The error I am receiving is:

You have an error in your SQL syntax near ' NOW())' at line 1

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 04, 2003 1:45 PM
To: NIPP, SCOTT V (SBCSI)
Subject: Re: [PHP-DB] Datetime help in an INSERT...


what kind of error are you getting?

>   I am stumbling across something that I thought I have done before,
> and I am not having any luck finding an example of this.  Basically, I am
> wanting to timestamp the date and time into new entries in a simple
database
> table.  The following section is the actual code for this, and I cannot
> figure out how to get the date/time stamp to populate into the database.
> Thanks in advance for the help.  I suspect this is a very simple fix.
> 
> $denylog = "INSERT INTO deny (account, td, date) VALUES ($tmp, $td,
NOW())";
> $denylog_result = mysql_query($denylog, $Prod) or die(mysql_error());
> 
> Scott Nipp
> Phone:  (214) 858-1289
> E-mail:  [EMAIL PROTECTED]
> Web:  http:\\ldsa.sbcld.sbc.com
> 
> 
> 
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 



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



[PHP-DB] Datetime help in an INSERT...

2003-06-05 Thread NIPP, SCOTT V (SBCSI)
I am stumbling across something that I thought I have done before,
and I am not having any luck finding an example of this.  Basically, I am
wanting to timestamp the date and time into new entries in a simple database
table.  The following section is the actual code for this, and I cannot
figure out how to get the date/time stamp to populate into the database.
Thanks in advance for the help.  I suspect this is a very simple fix.

$denylog = "INSERT INTO deny (account, td, date) VALUES ($tmp, $td, NOW())";
$denylog_result = mysql_query($denylog, $Prod) or die(mysql_error());

Scott Nipp
Phone:  (214) 858-1289
E-mail:  [EMAIL PROTECTED]
Web:  http:\\ldsa.sbcld.sbc.com



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



Re: [PHP-DB] runing local programs with php

2003-06-05 Thread Becoming Digital
What's the purpose of your script?  You can take a look at the command line
functions in the manual, though I don't know if they work in a Windows
environment.

Edward Dudlik
Becoming Digital
www.becomingdigital.com


- Original Message -
From: "carol" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, 04 June, 2003 01:15
Subject: [PHP-DB] runing local programs with php


Hy all,


How can I run program on a client machine using a php script.
For example paint or acces. which are runing on client machine.
TKS



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



Re: [PHP-DB] problem

2003-06-05 Thread Becoming Digital
It appears to me that you have REGISTER GLOBALS set to OFF.  If that's the case,
you need to pre-pend each of your variables with $HTTP_POST_VARS or $_POST.  If
you're not concerned about the security issues raised by leaving globals on,
simply change that one item in your php.ini file.

Edward Dudlik
Becoming Digital
www.becomingdigital.com


- Original Message -
From: "Ahmed Abdel-Aliem" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, 04 May, 2003 20:06
Subject: [PHP-DB] problem


hi again,
i use php/mysql and i have a form to enter data into tables insiede the
database
the problem is when i click the submit botton it gives me that 1 row is
affected and when i check the database with phpmyadmin i find that all the
data processed in the new row is empty, so can anyone please tell me where
is the problem?
here is the insert script :






i use ISS on windows xp professional and i face many problem with php.ini so can
anyone send me a modified one for the last version of php to avoid all these
errors !!


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



Re: [PHP-DB] Array Pointer

2003-06-05 Thread Chris Mach
My database is set up in this way:

fan_roster: has player id (play_id) , week, and stats on that player for
that week. So there are 20 records for each player, because there are 20
weeks.

So what I need to do is add up all the players weekly totals. so pass_yrd1
for week1 + pass_yrd1 for week2 etc.

Then I need to put the season total for that players passing yards into my
roster table under pass_yrd. The roster table only as 1 record per player
and has season stats instead of weekly stats.

So when my loop goes through and doesn't match $i with ros_id. I need to
advance $i one but ros_id needs to stay the same until there is a match.

As you can see form this url:
http://55yardline.cflmain.com/55main/2003/fantasy/tests/update.php
it's kind of working, except where there are holes in the roster table..
for example, there is no ros_id equal to 12 so it should echo "12 no player"
but it seems to skip.

Hope that makes sense.


"Mike Ford" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> > -Original Message-
> > From: Ian Fingold [mailto:[EMAIL PROTECTED]
> > Sent: 03 June 2003 16:58
> >
> > Ok I'm trying to write this function to up date some fields
> > in my database
> > so i'm grabbing some info from a query and throwing it into
> > an array (with
> > mysql_fetch_array).
> >
> > one of the values i'm puting into that array is the table id. I'm then
> > comparing the table id with the value of $i in my loop. Now
> > my problem is
> > when I loop through and the table id is not equal to $i I
> > need to add 1 to
> > $i but I need to move the array pointer back one.
> >
> > In the code below I used prev() but i'm getting warnings
> > about the "Passed
> > variable is not an array".
> > http://55yardline.cflmain.com/55main/2003/fantasy/tests/update.php
> >
> > I'm thinking that prev() must not view an array fetch from a
> > database the
> > same or something. But what else can I use besides prev() to
> > rewind the
> > pointer by 1?
> >
> > Thanks,
> >
> >
> >  >
> > include "function.php";
> > connect1();
> >
> > //query roster database and put results into an array.
> > $num1 = mysql_query("SELECT * FROM roster");
> > $num2 = mysql_fetch_array($num1);
> > //set i to zero
> > $i = 0;
> >
> > //start loop to determine if $i matches the current roster id
> > do {
> >   $i = $i + 1;
> >   if ($num2["ros_id"] == $i) {
> > //if a match is found, query the fan_roster database
> > where the play_id =
> > $i
> > //and put the results into a array
> > $upd = mysql_query("SELECT * FROM fan_roster WHERE play_id='$i'");
> > $updr = mysql_fetch_array($upd);
> > //loop through the passing field and add them up
> > do {
> > $passing = $passing + $updr["pass_yrd1"];
> > } while($updr = mysql_fetch_array($upd));
> >
> > //Print feedback
> > echo "Player:$i total Passing: $passing $updr[play_id]";
> >
> > //update the roster table with the total $passing where ros_id=$i
> > $upd1 = mysql_query("UPDATE roster SET pass_yrd='$passing' WHERE
> > ros_id='$i'");
> > //reset passing for next loop
> > $passing = 0;
> >   } else {
> > //if there isn't a match, add 1 to $i
> > $i = $i + 1;
> >
> > //print feedback
> > echo "$i no player";
> >
> > //put the array pointer back one for next loop
> > $num2 = prev($num2["ros_id"];
>
> (1) prev() takes an array as its argument, not an individual element, so
prev($num2) would be syntactically correct (but I doubt it's what you really
mean).
> (2) anyway, this whole statement is pointless as you immediately do:
>
> >   }
> > } while($num2 = mysql_fetch_array($num1));
>
> Which promptly overwrites the value of $num2 you just put there!
>
> What are you *really* trying to do?
> > ?>
> >
> >
> >
> > --
> > PHP Database Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >



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