Re: converting a char variable to an int?
| From: | salah at e-touch dot ws | Date: | Mon, 14 Jun 2004 16:35:23 +0000 |
| Subject: | Re: converting a char variable to an int? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-188230@lists.php.net to get a copy of this message | ||
Regardless of how you use your database, here you can read about type
juggling/casting:
http://www.php.net/language.types.type-juggling
Quoting Marek Kilimajer <lists@kilimajer.net>:
> Does it work now?
>
> It should not matter, because if you use $date in your sql statement:
>
> $sql = "update table set
date = '$date'";
>
> $date is converted (back) to string.
>
> Adam Williams wrote --- napísal::
> > eh nevermind, I found settype();
> >
> > :) thanks
> >
> > On Mon, 14 Jun 2004, Adam Williams wrote:
> >
> >
> >>Hi, I have a variable that is created using the date command:
> >>
> >>$date = date("Ymd");
> >>
> >>but its not working in my database this way (when I explicity enter
> >>20040614 in my database, it works though). so I think PHP is making $date
> >>a character variable, so how can I force or change the caste of $date to
> >>force it to be an integer variable? thanks
> >>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>