我想PARAMS綁定到一個INSERT如果變量存在INTO的MySQLi準備語句,否則插入null.Then我知道什麼是mysqli bind_param中的NULL類型?
type variable i corresponding variable has type integer d corresponding variable has type double s corresponding variable has type string b corresponding variable is a blob and will be sent in packets
,但是當我插入變量=空,我怎麼定義的類型變量?或者我應該定義類型是''?
只需將null作爲變量傳遞並使用字符串即可。 – Ohgodwhy
將您的變量設置爲空(例如'$ var = null;')。 –
可能重複http://stackoverflow.com/questions/4920873/mysqli-prepared-statements-insert-null-using-bind-params –