Jump to content
Larry Ullman's Book Forums

To Quote Or Not To Quote... $Query = ...Where Id='$Id' Or Id=$Id


Recommended Posts

With mysql we...

$q = "SELECT * FROM users WHERE id='$id'";

but I noticed that with mysqli quotes aren't used...

$q = "SELECT * FROM users WHERE $id=$id";

It seems this came with no fanfair or mentioning and its probably nothing, but I'd like to just clarify that quotes in this case aren't necessary.

 

Thanks

 

David

Link to comment
Share on other sites

 Share

×
×
  • Create New...