我的php代碼返回一些值,我試圖插入數據庫。插入前插入單引號
$string = '1,here,Skincare composition against free radicals'; //this is returned
'(insert into import (S.No,Name,Title)) values ($string)'
需要將該字符串轉換在適當的格式,以dB插入
'1','here','Skincare composition against free radicals' //This is expected
破滅應該這樣做?但我不知道如何?
這應該工作,因爲你的SQL是一個字符串... – christopher
@christopher但你需要'''S,對吧? – irrelephant
@irrelephant Ah duh。 Kuya的回答是好的 – christopher