RES: [PHP-DB] input field validation

2008-05-12 Thread Thiago Pojda
It'd be simpler to use isNaN()



Thiago Henrique Pojda
Desenvolvimento Web
+55 41 3033-7676
[EMAIL PROTECTED]
Excelência em Softwares Financeiros


-Mensagem original-
De: sahabettin akca [mailto:[EMAIL PROTECTED] 
Enviada em: domingo, 11 de maio de 2008 14:31
Para: php-db@lists.php.net
Assunto: Re: [PHP-DB] input field validation

hi,

*javascript function :

function isNumber(obj) {
var len  = obj.value.length;
var lastChar = obj.value.charAt(len-1);
if( lastChar != '0'  lastChar != '1'  lastChar != '2' 
lastChar
!= '3'  lastChar != '4' 


lastChar != '5'  lastChar != '6'  lastChar != '7'  lastChar !=
'8'  lastChar != '9' ) {
obj.value = obj.value.substring(0, len-1);

}

}

this is function use :
input *onKeyUp='isNumber(this)'  /

do not alert , but add alert

*   obj.value = obj.value.substring(0, len-1);
---
this line before

---
alert('this field only integer!');
*



add.
good luck
?ahabettin akca (saho)
2008/5/11 arafat uddin [EMAIL PROTECTED]:
-
and
this database field data type select int (integer) ,
tinyint, int, bigint... or
if(gettype($_POST['field'])!=integer) // or if(intval($_POST['field'])==0)
or if(!intval($_POST['field']))
{
printnot integer;
location(header: .php);
#or
printmeta http-equiv='refresh' content='0;url=.php';
}
else
{

}
2008/5/11 Yves Sucaet [EMAIL PROTECTED]:

 Allow me to point out that this is not database-related...

 This website should get you everything you want:
 http://www.acmesoffware.com/acme/ExamplesJS/jsExm_ValidateInteger.asp

 HTH,

 Yves

 - Original Message - From: arafat uddin [EMAIL PROTECTED]
 To: php-db@lists.php.net
 Sent: Sunday, May 11, 2008 12:48 AM
 Subject: [PHP-DB] input field validation



  hi,
   i want to input only integer in my field.if without integer any
  input put in the field it will show warning messege.
  such as 12 will be accept
  but 12sds will not accept .
  fhe34 will not accept
 
 
  plz help me by any javascript code.
 
  --
  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




-- 
?ahabettin akca // saho



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



RES: [PHP-DB] Shopping cart session handling

2008-05-05 Thread Thiago Pojda
Forwarding to the correct mailing list. You should get flames...*cough* I
mean, answers here :)

Regards,
Thiago

-Mensagem original-
De: Ron Piggott [mailto:[EMAIL PROTECTED] 
Enviada em: domingo, 4 de maio de 2008 19:35
Para: PHP DB
Assunto: [PHP-DB] Shopping cart session handling

I am writing a shopping cart.  I wanted some input on session handling
for a shopping cart that is secure.  

At this time I am not programming for credit card processing.  I am
going to forward onto PayPal for payment initially.  But I want to do a
good job with security.

Ron


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



RES: [PHP-DB] resources and resource types

2008-03-31 Thread Thiago Pojda
[top posting warning]

You still did not RTFM as Stut told you 4 days ago. I'm pasting here the
entire conversation with the subject Resource id #5:

-Mensagem original-
De: Stut [mailto:[EMAIL PROTECTED] 
Enviada em: quinta-feira, 27 de março de 2008 15:14
Para: Richard Dunne
Cc: php-db@lists.php.net
Assunto: Re: [PHP-DB] Resource id #5

On 27 Mar 2008, at 17:51, Richard Dunne wrote:
 Can someone explain how I can translate Resource id #5 which 
is what I 
 am getting from the code below?

 $result = mysql_query(Select answer from answers) or 
 die(mysql_error()); $resultArray = explode(',',$result); for 
 ($i=0;$isizeof($resultArray);$i++)
 {
   echo $resultArray[$i];
 }

For the love of $DEITY, please read the frickin' manual: 
http://php.net/mysql . You've been asking similar questions 
around this topic for the past few days and you clearly haven't 
moved forward in your understanding.

The mysql_query function returns a resource. If you print a 
resource you get the text Resource id #n where n is replaced 
with its ID. To make use of this resource you need to use 
functions like mysql_fetch_array, mysql_fetch_assoc or one of 
the many others detailed in, you guessed it, the manual. Try 
it, you might like it.

-Stut

--
http://stut.net/





-Mensagem original-
De: Richard Dunne [mailto:[EMAIL PROTECTED] 
Enviada em: segunda-feira, 31 de março de 2008 15:40
Para: php-db@lists.php.net
Assunto: [PHP-DB] resources and resource types

When I did a search on resource(5) within the PHP online 
documentation, I found the resource page resource.php. While 
although it lists all the resources used with mysql, it does 
not mention how resources are related to resource numbers as 
above. A query such as a row count on a table results in an 
integer value.  What is the best way of accessing or converting 
the integer value from the resource? I can't see any particular 
function in the function list which does this, without getting 
into strings or arrays, or have I missed something blaringly 
obvious, hope not?




--
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] RES: [PHP] mysql joins

2008-03-25 Thread Thiago Pojda
not sure how timestamps work in MySQL, but I've written this in Oracle:

CREATE TABLE USaR (
  UsID char(255) null,
  Firstname char(255) NULL,
  Surname char(255) NULL,
  Tel char(255) NULL,
  Cell char(255) NULL,
  Email char(255) NULL
)
/
CREATE TABLE Tracker(
  UsID  CHAR(255) NULL,
  Points CHAR(255) NULL
)
/
CREATE TABLE Winners(
  UsiD CHAR(255) NULL,
  DateTime DATE NULL
)
/

/* Inserted some values in those tables and then executed: */ 

select
  us.usid, --I couldn't get the Firstname as it's not a group by element (?)
  Sum(tr.points) 
from
  usar us, --in mysql you'll have to do 'usar as us'
  tracker tr, --tracker as tr
  winners wn --winners as wn
where
us.usid = tr.usid --here is the join magic
and us.usid = wn.usid --and here
AND wn.datetime  (SYSDATE - 14) --winner date has to be less than 14 days
from today
GROUP BY us.usid  --separate per user;


I hope this helps :)

This will *NOT* bring you users that never won or have no points (since they
don't have any record in winners table)

Regards,
Thiago

-Mensagem original-
De: Steven Macintyre [mailto:[EMAIL PROTECTED] 
Enviada em: terça-feira, 25 de março de 2008 09:21
Para: [EMAIL PROTECTED]
Assunto: [PHP] mysql joins

 I have three tables, namely;

User
- UID
- Firstname
- Surname
- Tel
- Cell
- Email

Tracker
- UID
- Points

Winners
- UID
- Datetime (-00-00 00:00:00)

I need to get the following information from the above tables 
(in my logical sense)

All users from user with sum(points) as points and datetime  
datetime + 14 days

In English, the all users must be selected, excluding the ones 
that have won in the last 14 days and return all the 
information and the sum of points

I suspect I would need to use joins here ... but have no clue 
how to do so ... I have read up a bit and can work out inner 
joins from three tables, but not coping with this problem above

Can someone help me out with this please?

Many thanks 

Steven



--
PHP General 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



RES: [PHP-DB] INSERT query with Primary and foreign key

2008-02-26 Thread Thiago Pojda
This is more SQL than PHP, how did you create your constraints?

Did you set insert on CASCADE?

-Mensagem original-
De: Nasreen Laghari [mailto:[EMAIL PROTECTED] 
Enviada em: segunda-feira, 25 de fevereiro de 2008 22:15
Para: php-db@lists.php.net
Assunto: [PHP-DB] INSERT query with Primary and foreign key

Hi,

I need help to insert date into two tables when tables have primary and
foreign key relationship using php. I tried simple INSERT query but foreign
key colum is storing NULL.

Regards

Nasreen


 


Be a better friend, newshound, and
know-it-all with Yahoo! Mobile.  Try it now.
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ 

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



RES: [PHP-DB] PHP, MySQL and Lookups

2008-02-26 Thread Thiago Pojda
Lemme see if I get this right:

You could just do this:

UPDATE userPW SET field1=$satinized_post_field1,
field2=$sanitized_post_field2 WHERE userid=$userId and password=$userPw


if (mysql_affected_rows($conn)  0){
echo updated
}else{
echo error: .mysql_error($conn);
}

http://docs.php.net/manual/function.mysql-query.php

I suppose you have a relationship between pw and user (as stated in
userid=$userid).


Hope this helps!

-Mensagem original-
De: Henry Felton [mailto:[EMAIL PROTECTED] 
Enviada em: terça-feira, 26 de fevereiro de 2008 10:55
Para: php-db@lists.php.net
Assunto: [PHP-DB] PHP, MySQL and Lookups

Hi everyone,

I'm just getting into PHP at the moment and was wondering; what code would I
need to look at a field value entered in a form, then if that value is found
in my table, enter all the other information entered in the form, to the
other fields on that record.
Basically, what I'm trying to do is give a load of users an individual
password that they enter, with various other pieces of information such as
year of birth, single/married or whatever, into a form. In MySQL I have a
table with three fields, but only the password one has any data in them. A
script will then took in the table to find the password entered in the form,
and then append all the other information (i.e. data for the other two
fields) to the particular record that holds the password value entered.

Hope that made sense, but I'd be so grateful if someone could help me with
this

Thanks,
Max

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



RES: [PHP-DB] MySQL replication delaying issue

2008-02-26 Thread Thiago Pojda
I did not say: do not ask on this list.
 
I said: you would get BETTER answers if you asked on a MySQL list.

  _  

De: Lasitha Alawatta [mailto:[EMAIL PROTECTED] 
Enviada em: terça-feira, 26 de fevereiro de 2008 13:47
Para: Thiago Pojda
Assunto: RE: [PHP-DB] MySQL replication delaying issue



 

Hay, 

If U don’t know about that then u can ignore that mail. U need not to answer
each and every mails in this list.

MOST of the PHP developer are using MYSQL as backend. 

 

That’s Y I sent that message to phpresources  list also.

 

 

 

 

 

From: Thiago Pojda [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 26, 2008 8:39 PM
To: Lasitha Alawatta; php-db@lists.php.net; [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: RES: [PHP-DB] MySQL replication delaying issue

 

Not trying to be an ass, but wouldn't you get better answers if you asked in
a MySQL list?

 

I work with PHP, but have near to 0 experience with MySQL.

 

  _  

De: Lasitha Alawatta [mailto:[EMAIL PROTECTED] 
Enviada em: terça-feira, 26 de fevereiro de 2008 12:50
Para: php-db@lists.php.net; [EMAIL PROTECTED]; [EMAIL PROTECTED]
Assunto: [PHP-DB] MySQL replication delaying issue
Prioridade: Alta

 

Hello Everybody,

 

We have 6 multi-master MySql instances within a LAN , that are replicating
is a sequential manner.

Server Environment :  Six identical Linux Enterprise version 4 running,
servers with having MySQL version 6. 

we are using “MySQL multi-master replication” method for database
replication.

 

There is a delay (5-7 minutes) of that data replication process. 

We notice that it’s because of MySQL table locking.

 

Your comments are highly appreciated.

 

 

Many thanks in advance and best regards,

 

Lasitha Alawatta

Application Developer

Destinations of the World Holding Establishment

P O Box: 19950

Dubai, United Arab Emirates

( Ph +971 4 295 8510 (Board) / 1464 (Ext.)

7 Fax +971 4 295 8910
+ [EMAIL PROTECTED] 

 http://www.dotw.com/ cid:image002.jpg@01C7A7A4.0AC70A00

 

 



DOTW DISCLAIMER:

This e-mail and any attachments are strictly confidential and intended for
the addressee only. If you are not the named addressee you must not
disclose, copy or take
any action in reliance of this transmission and you should notify us as soon
as possible. If you have received it in error, please contact the message
sender immediately.
This e-mail and any attachments are believed to be free from viruses but it
is your responsibility to carry out all necessary virus checks and DOTW
accepts no liability
in connection therewith. 

This e-mail and all other electronic (including voice) communications from
the sender's company are for informational purposes only.  No such
communication is intended
by the sender to constitute either an electronic record or an electronic
signature or to constitute any agreement by the sender to conduct a
transaction by electronic means.

 



RES: [PHP-DB] MySQL replication delaying issue

2008-02-26 Thread Thiago Pojda
Not trying to be an ass, but wouldn't you get better answers if you asked in
a MySQL list?
 
I work with PHP, but have near to 0 experience with MySQL.

  _  

De: Lasitha Alawatta [mailto:[EMAIL PROTECTED] 
Enviada em: terça-feira, 26 de fevereiro de 2008 12:50
Para: php-db@lists.php.net; [EMAIL PROTECTED]; [EMAIL PROTECTED]
Assunto: [PHP-DB] MySQL replication delaying issue
Prioridade: Alta



 

Hello Everybody,

 

We have 6 multi-master MySql instances within a LAN , that are replicating
is a sequential manner.

Server Environment :  Six identical Linux Enterprise version 4 running,
servers with having MySQL version 6. 

we are using “MySQL multi-master replication” method for database
replication.

 

There is a delay (5-7 minutes) of that data replication process. 

We notice that it’s because of MySQL table locking.

 

Your comments are highly appreciated.

 

 

Many thanks in advance and best regards,

 

Lasitha Alawatta

Application Developer

Destinations of the World Holding Establishment

P O Box: 19950

Dubai, United Arab Emirates

( Ph +971 4 295 8510 (Board) / 1464 (Ext.)

7 Fax +971 4 295 8910
+  mailto:[EMAIL PROTECTED] [EMAIL PROTECTED] 

 http://www.dotw.com/ cid:image002.jpg@01C7A7A4.0AC70A00

 




DOTW DISCLAIMER:

This e-mail and any attachments are strictly confidential and intended for
the addressee only. If you are not the named addressee you must not
disclose, copy or take
any action in reliance of this transmission and you should notify us as soon
as possible. If you have received it in error, please contact the message
sender immediately.
This e-mail and any attachments are believed to be free from viruses but it
is your responsibility to carry out all necessary virus checks and DOTW
accepts no liability
in connection therewith. 

This e-mail and all other electronic (including voice) communications from
the sender's company are for informational purposes only.  No such
communication is intended
by the sender to constitute either an electronic record or an electronic
signature or to constitute any agreement by the sender to conduct a
transaction by electronic means.



RES: [PHP-DB] MySQL replication delaying issue

2008-02-26 Thread Thiago Pojda
That's ok, good luck with your problem.
 
Perhaps this could help :)
http://forums.mysql.com/read.php?26,197734,197734#msg-197734

  _  

De: Lasitha Alawatta [mailto:[EMAIL PROTECTED] 
Enviada em: terça-feira, 26 de fevereiro de 2008 14:44
Para: Thiago Pojda
Cc: php-db@lists.php.net
Assunto: RE: [PHP-DB] MySQL replication delaying issue



 

Oky, Sorry for that.. J

 

 

From: Thiago Pojda [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 26, 2008 8:49 PM
To: Lasitha Alawatta
Cc: php-db@lists.php.net
Subject: RES: [PHP-DB] MySQL replication delaying issue

 

I did not say: do not ask on this list.

 

I said: you would get BETTER answers if you asked on a MySQL list.

 

  _  

De: Lasitha Alawatta [mailto:[EMAIL PROTECTED] 
Enviada em: terça-feira, 26 de fevereiro de 2008 13:47
Para: Thiago Pojda
Assunto: RE: [PHP-DB] MySQL replication delaying issue

 

Hay, 

If U don’t know about that then u can ignore that mail. U need not to answer
each and every mails in this list.

MOST of the PHP developer are using MYSQL as backend. 

 

That’s Y I sent that message to phpresources  list also.

 

 

 

 

 

From: Thiago Pojda [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 26, 2008 8:39 PM
To: Lasitha Alawatta; php-db@lists.php.net; [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: RES: [PHP-DB] MySQL replication delaying issue

 

Not trying to be an ass, but wouldn't you get better answers if you asked in
a MySQL list?

 

I work with PHP, but have near to 0 experience with MySQL.

 

  _  

De: Lasitha Alawatta [mailto:[EMAIL PROTECTED] 
Enviada em: terça-feira, 26 de fevereiro de 2008 12:50
Para: php-db@lists.php.net; [EMAIL PROTECTED]; [EMAIL PROTECTED]
Assunto: [PHP-DB] MySQL replication delaying issue
Prioridade: Alta

 

Hello Everybody,

 

We have 6 multi-master MySql instances within a LAN , that are replicating
is a sequential manner.

Server Environment :  Six identical Linux Enterprise version 4 running,
servers with having MySQL version 6. 

we are using “MySQL multi-master replication” method for database
replication.

 

There is a delay (5-7 minutes) of that data replication process. 

We notice that it’s because of MySQL table locking.

 

Your comments are highly appreciated.

 

 

Many thanks in advance and best regards,

 

Lasitha Alawatta

Application Developer

Destinations of the World Holding Establishment

P O Box: 19950

Dubai, United Arab Emirates

( Ph +971 4 295 8510 (Board) / 1464 (Ext.)

7 Fax +971 4 295 8910
+ [EMAIL PROTECTED] 

 http://www.dotw.com/ cid:image002.jpg@01C7A7A4.0AC70A00

 

 



DOTW DISCLAIMER:

This e-mail and any attachments are strictly confidential and intended for
the addressee only. If you are not the named addressee you must not
disclose, copy or take
any action in reliance of this transmission and you should notify us as soon
as possible. If you have received it in error, please contact the message
sender immediately.
This e-mail and any attachments are believed to be free from viruses but it
is your responsibility to carry out all necessary virus checks and DOTW
accepts no liability
in connection therewith. 

This e-mail and all other electronic (including voice) communications from
the sender's company are for informational purposes only.  No such
communication is intended
by the sender to constitute either an electronic record or an electronic
signature or to constitute any agreement by the sender to conduct a
transaction by electronic means.