我尝试使用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