Re: returning a variable from a class function? plus other probs
| From: | Curt Zirzow | Date: | Sun, 05 Oct 2003 02:03:44 +0000 |
| Subject: | Re: returning a variable from a class function? plus other probs | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-165070@lists.php.net to get a copy of this message | ||
* Thus wrote Dan Anderson (dan@mathjunkies.com):
>
> > $chk = "Select id, fname from contact_info where email =" . $email;
>
> You need to quote the email. So perhaps the following would be more
> appropriate:
>
> $chk = "SELECT id, fname FROM contact_info WHERE email = \"{$email}\"";
>
> >
> > ('$fname','$lname','$tel','$address','$city','$state','$zipcode','$country',
> > '$email')";
>
> I believe there is some problems using 's and not "s. Try using "s
> above.
Using ' is prefered IIRC, and also escaping all the data before sending
it to the database:
$fname = mysql_real_escape_string($fname);
Curt
--
List Stats: http://zirzow.dyndns.org/html/mlists/php_general/
"I used to think I was indecisive, but now I'm not so sure."