我有一個惡夢試圖插入一些數據到表中。出於某種原因,它只會讓我插入數字,而不是將文本插入到特定的行中,甚至不會插入任何單詞。我已經嘗試將行設置爲不同的類型(文本,Varchar,Longtext),但沒有任何理由可以讓人高興?我之前完成了這些工作,我完全陷入了爲什麼現在不工作。mysql插入文本問題
問題行是order_note和測試,這裏的查詢:
$table_name = $wpdb->prefix . "dpsc_transactions";
$query = "INSERT INTO {$table_name} (`invoice`, `date`, `order_time`, `billing_first_name`, `billing_last_name`, `billing_country`,
`billing_address`, `billing_city`, `billing_state`, `billing_zipcode`, `billing_email`, `phone`, `shipping_first_name`, `shipping_last_name`,
`shipping_country`, `shipping_address`, `shipping_city`, `shipping_state`, `shipping_zipcode`, `products`, `payment_option`, `discount`,
`tax`, `shipping`, `total`, `order_note`, `test`, `payment_status`) VALUES ('{$invoice}', NOW(), {$order_time}, '{$bfname}', '{$blname}', '{$bcountry}', '{$baddress}',
'{$bcity}', '{$bstate}', '{$bzip}', '{$bemail}', '{$phone}', '{$sfname}', '{$slname}', '{$scountry}', '{$saddress}', '{$scity}', '{$sstate}', '{$szip}',
'{$products}', '{$payment_option}', {$dpsc_discount_value}, {$tax}, {$dpsc_shipping_value}, {$dpsc_total}, {$order_note}, {$test}, 'Pending')";
$wpdb->query($query);
什麼是mysql錯誤,你看到了嗎? – Ish 2011-02-25 18:32:13
'row_id = woodoo'?粘貼錯誤。 – Nishant 2011-02-25 18:37:29