It's not random. Strings need to be enclosed. You can use single or double
quotes, but you have to use them.

---John Holmes...

----- Original Message -----
From: "Phil Schwarzmann" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, July 17, 2002 11:19 AM
Subject: [PHP] Queries - Sometimes I need to use apostrophe, other times
idon't


> When running a mysql_query, sometimes i need to have apostrophes
> surrounding variables...other times i don't
>
> example...
>
> $query = "SELECT * FROM table WHERE id='$id'";
>
> or
>
> $query = "SELECT * FROM table WHERE id=$id";
>
> ...it kinda seems random when it wants apostrophes and when it doesn't
> want them.
>
> Any ideas?
>


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

Reply via email to