Dotan Cohen Quotes around INSERT and SELECT statements' arguments from the mysql CLI and PHP
Sep 18, 2011; 12:00
Dotan Cohen
Quotes around INSERT and SELECT statements' arguments from the mysql CLI and PHP
I am somewhat confused as to the proper way to place quotes around arguments in INSERT and SELECT statements. I also don't see where this is made explicit in the fine manual.
If the column is type int, is it preferable to use single, double, or no quotes on INSERT from the mysql cli? If the column is type int, is it preferable to use single, double, or no quotes on SELECT from the mysql cli? If the column is type int, is it preferable to use single, double, or no quotes on INSERT from PHP? If the column is type int, is it preferable to use single, double, or no quotes on SELECT from PHP? Is it the same for decimal and float?
If the column is type varchar, is it preferable to use single or double quotes on INSERT from the mysql cli? If the column is type varchar, is it preferable to use single or double quotes on SELECT from the mysql cli? If the column is type varchar, is it preferable to use single or double quotes on INSERT from PHP? If the column is type varchar, is it preferable to use single or double quotes on SELECT from PHP? Is it the same for text and blob? Also, in PHP often I see code examples with the variable wrapped in curly brackets, inside single quotes. What is the purpose of the curly brackets? Here is such an example: $query="INSERT INTO names (name) VALUE ('{$userName}')";
If the column is type datetime, is it preferable to use single or double quotes on INSERT from the mysql cli? If the column is type datetime, is it preferable to use single or double quotes on SELECT from the mysql cli? If the column is type datetime, is it preferable to use single or double quotes on INSERT from PHP? If the column is type datetime, is it preferable to use single or double quotes on SELECT from PHP? What if I am using the NOW() function?
If the column is type set, is it preferable to use single or double quotes on INSERT from the mysql cli? If the column is type set, is it preferable to use single or double quotes on SELECT from the mysql cli? If the column is type set, is it preferable to use single or double quotes on INSERT from PHP? If the column is type set, is it preferable to use single or double quotes on SELECT from PHP?
Thanks.
-- Dotan Cohen
http://gibberish.co.il http://what-is-what.com
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/mysql?unsub=listsearcharchive@lassosoft.com
Sep 18
Brandon Phelps Re: Quotes around INSERT and SELECT statements' arguments from the mysql CLI and PHP
Sep 18, 2011; 10:44
Brandon Phelps
Re: Quotes around INSERT and SELECT statements' arguments from the mysql CLI and PHP
Sep 18
Dotan Cohen Re: Quotes around INSERT and SELECT statements' arguments from the mysql CLI and PHP
Sep 18, 2011; 19:28
Dotan Cohen
Re: Quotes around INSERT and SELECT statements' arguments from the mysql CLI and PHP
Sep 18
Hank Re: Quotes around INSERT and SELECT statements' arguments from the mysql CLI and PHP
Sep 18, 2011; 21:00
Hank
Re: Quotes around INSERT and SELECT statements' arguments from the mysql CLI and PHP
Sep 19
Reindl Harald Re: Quotes around INSERT and SELECT statements' arguments from the mysql CLI and PHP
Sep 19, 2011; 06:47
Reindl Harald
Re: Quotes around INSERT and SELECT statements' arguments from the mysql CLI and PHP
Sep 19
Dotan Cohen Re: Quotes around INSERT and SELECT statements' arguments from the mysql CLI and PHP
Sep 19, 2011; 09:56
Dotan Cohen
Re: Quotes around INSERT and SELECT statements' arguments from the mysql CLI and PHP
Sep 19
Dotan Cohen Re: Quotes around INSERT and SELECT statements' arguments from the mysql CLI and PHP
Sep 19, 2011; 10:00
Dotan Cohen
Re: Quotes around INSERT and SELECT statements' arguments from the mysql CLI and PHP
Sep 19
Hank Re: Quotes around INSERT and SELECT statements' arguments from the mysql CLI and PHP
Sep 19, 2011; 10:55
Hank
Re: Quotes around INSERT and SELECT statements' arguments from the mysql CLI and PHP
Sep 19
Reindl Harald Re: Quotes around INSERT and SELECT statements' arguments from the mysql CLI and PHP
Sep 19, 2011; 17:11
Reindl Harald
Re: Quotes around INSERT and SELECT statements' arguments from the mysql CLI and PHP
Sep 20
Dotan Cohen Re: Quotes around INSERT and SELECT statements' arguments from the mysql CLI and PHP
Sep 20, 2011; 00:31
Dotan Cohen
Re: Quotes around INSERT and SELECT statements' arguments from the mysql CLI and PHP
Sep 19
Hank Re: Quotes around INSERT and SELECT statements' arguments from the mysql CLI and PHP
Sep 19, 2011; 18:11
Hank
Re: Quotes around INSERT and SELECT statements' arguments from the mysql CLI and PHP
Sep 20
Dotan Cohen Re: Quotes around INSERT and SELECT statements' arguments from the mysql CLI and PHP
Sep 20, 2011; 01:39
Dotan Cohen
Re: Quotes around INSERT and SELECT statements' arguments from the mysql CLI and PHP
Sep 20
Reindl Harald Re: Quotes around INSERT and SELECT statements' arguments from the mysql CLI and PHP
Sep 20, 2011; 00:48
Reindl Harald
Re: Quotes around INSERT and SELECT statements' arguments from the mysql CLI and PHP
Sep 19
Hank Re: Quotes around INSERT and SELECT statements' arguments from the mysql CLI and PHP
Sep 19, 2011; 19:09
Hank
Re: Quotes around INSERT and SELECT statements' arguments from the mysql CLI and PHP
Sep 20
Dotan Cohen Re: Quotes around INSERT and SELECT statements' arguments from the mysql CLI and PHP
Sep 20, 2011; 02:20
Dotan Cohen
Re: Quotes around INSERT and SELECT statements' arguments from the mysql CLI and PHP
Sep 20
Dotan Cohen Re: Quotes around INSERT and SELECT statements' arguments from the mysql CLI and PHP
Sep 20, 2011; 02:21
Dotan Cohen
Re: Quotes around INSERT and SELECT statements' arguments from the mysql CLI and PHP
Sep 20
Dotan Cohen Re: Quotes around INSERT and SELECT statements' arguments from the mysql CLI and PHP
Sep 20, 2011; 02:23
Dotan Cohen
Re: Quotes around INSERT and SELECT statements' arguments from the mysql CLI and PHP
Sep 20
Reindl Harald Re: Quotes around INSERT and SELECT statements' arguments from the mysql CLI and PHP
Sep 20, 2011; 01:27
Reindl Harald
Re: Quotes around INSERT and SELECT statements' arguments from the mysql CLI and PHP
Search
Lasso Programming
This site manages and broadcasts several email lists pertaining to Lasso Programming and technologies related and used by Lasso developers. Sign up today!