Hello, this function does not work for me... And I really don't know what am I
doing wrong... Any help??
This function is in a class, and I call it in a form, to create a new user..
$objEmploye=new Employe;
if (
$objEmploye->insert(array($name,$lastname,$salary,$dui,$afp,$isss,$nit)
On Fri, 2010-07-02 at 22:05 +, Carlos Sura wrote:
>
> Hello, this function does not work for me... And I really don't know what am
> I doing wrong... Any help??
>
> This function is in a class, and I call it in a form, to create a new user..
>
>
>
> $objEmploye=new Employe;
> if
ing me.
Carlos Sura.
Subject: Re: [PHP] What's wrong in this function? Does not work for me.
From: a...@ashleysheridan.co.uk
To: carlos_s...@hotmail.com
CC: php-general@lists.php.net
Date: Sat, 3 Jul 2010 00:08:05 +0100
On Fri, 2010-07-02 at 22:05 +, Carlos Sura wrot
. Do you want my form code? all the
> entire class.php code??
>
> Thank you for helping me.
>
> Carlos Sura.
>
>
>
>
>
>
> Subject: Re: [PHP] What's wrong in this function? Does not work for me.
> From: a...@ashleysheridan.co.uk
> To: carlos
Hello,
multiple things:
- escape your values:
1. if some of the user input contains '\'' for instance, your query is
not well formed
2. if some evil user want to do anything with your DB, he can do it
=> See mysql_escape_string or PDO prepared statements
- Use "else" part of the if statement
in database when I fill them up in the
>> form... But, I really don't know why... Do you want my form code? all the
>> entire class.php code??
>>
>> Thank you for helping me.
>>
>> Carlos Sura.
>>
>>
>>
>>
>>
>>
>>
On Sat, 2010-07-03 at 09:01 +0200, Alexandre Simon wrote:
> Hello,
>
> multiple things:
> - escape your values:
> 1. if some of the user input contains '\'' for instance, your query is
> not well formed
> 2. if some evil user want to do anything with your DB, he can do it
> => See mysql_esc
Ash,
> >>
> >> No, I don't get an error message, the thing is, my post form, isn't
> >> working... I can't post those fields in database when I fill them up in
> >> the form... But, I really don't know why... Do you want my form code? all
>
Another thing is that I would use != false, so every value but false passes.
$objEmploye=new Employe;
if ( $objEmploye->insert(array($name,$lastname,$salary,$dui,$afp,$isss,$nit))
== true){
echo 'Saved';
}else{
echo 'Error, try again';
}
***
On Sat, 2010-07-03 at 16:11 +0200, Hans Åhlin wrote:
> Another thing is that I would use != false, so every value but false passes.
>
> $objEmploye=new Employe;
>if (
> $objEmploye->insert(array($name,$lastname,$salary,$dui,$afp,$isss,$nit))
> == true){
>echo 'Saved';
>}else{
>
10 matches
Mail list logo