我嘗試使用PHP來存儲在MySQL的一些數據,PHP變量不存儲大量的文本內容
$description="Hi, My Name is Nilesh C. Narvekar, I am a Dog Trainer since last 12 years experience in this field. also I am participate my trained dogs in DOG SHOWS (in Obedience class as well as Breed Shows) So Please Contact me on My Cell no. 9920 338835 I teach HEEL (walk), STAY, SIT, SHAKE HAND (Right/Left), DOWN, RECALL, Retrieve (Ball/Any Article) SALUTE, REST, SLEEP, ROLL, SPEAK, ATTACK, SEARCHING, PERSONAL PROTECTION, GUARD AND Much & More I use Positive Reinforcement training System i.e. (first I give more Exercise for reducing Dogs energy level then doing more practice with dogs and then after I use some treats for giving Dogs attention and concentration to me in training session)";
$sql = "INSERT INTO pet_trainer(name, description, address, city, area, contact, email, timing, latitude, longitude)
VALUES
(
'"$name"',
'"$description"',
'"$address"',
'"$city"',
'"$area"',
'"$contact"',
'"$email"',
'"$timing"',
'$lat',
'$long'
)";
當我試圖執行這個$ SQL變量不把它這樣表示,因爲所有細節大描述。
INSERT INTO pet_trainer(image, name, description, address, city, area, contact, email, timing, latitude, longitude)
VALUES
('',
'Nilesh C. Narvekar',
'\'Hi, My Name is Nilesh C. Narvekar, I am a Dog Trainer since last 12 years experience in this field. also I am participate my trained dogs in DOG SHOWS (in Obedience class as well as Breed Shows) So Please Contact me on My Cell no. 9920 338835 I teach HEEL (walk), STAY, SIT, SHAKE HAND (Right/Left), DOWN, RECALL, Retrieve (Ball/Any Article) SALUTE, REST, SLEEP, ROLL, SPEAK, ATTACK, SEARCHING, PERSONAL PROTECTION, GUARD AND Much & More I use Positive Reinforcement training System i.e. (first I give more Exercise for reducing Dogs energy level then doing more practice with dogs and then after I use some treats for giving Dogs attention and concentration to me in training session)\'',
'Andheri Mumbai',
'Mumbai',
當我減小$ description的大小時,$ sql取所有數據。 是php變量對存儲字符串字符有一些限制嗎? 那我該怎麼辦?請幫幫我。 謝謝。
數據庫中的描述列的類型是什麼? –
什麼字段類型和長度是你的數據庫中的描述? – RamRaider
@RahulPatel不再使用mysql _ * - 函數。舉個例子,如果他使用'mysqli_real_escape_string()',而不是mysql,那會更好。 – Bobby