| maaf OOT code nya gini UPDATE emails SET `email_attachment` = ? WHERE `email_id` = ? errornya gini You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? WHERE `email_id` = ?' at line 1 kira kira kenapa ya errornya ? |
|
| klo blh tau, arti dari tanda tanya (?) itu apa gan |
|
| tidak diketahui |
|
| tanda tanyanya fungsinya buat apa? |
|
| //ini contoh file yang diambil $id = $_POST['id']; $email = $_POST['email']; UPDATE emails SET 'email_attachment'='$email' WHERE 'email_id' = '$id'; Yang tanda "?" nya ane ganti om, jd hanya bayangan saja, Untuk $id dan$email ente sesuaikan aja om. Selain itu coba ente perhatikan tanda ' (kutip) nya. Sama2 newbie gan :D |
|
| UPDATE emails SET email_attachment = '?' WHERE email_id = '?'
field nya gak usah diberi tanda kutip, value ny saja yg diberi. Moga bermanfaat |
|
| Theo Fileo Pradipta malah indefined index email_id gan |
|
| Errornya karena tanda ? |
|
| itu tanda ? nya maksudnya apa gan? itu kan hanya cth saja yang $email nya gan. coba kirim skrip lengkapnya om |
|
| menurut pengalaman saya tanda (kutip) ` dan ' sangat berpengaruh, jadi perhatikan tanda kutip nya juga om. menurut saya sih. |
|
| Dicky Agustin C'ociv Thea : kalo itu di navicat bisa gan , tapi di program nya errornya gini :Unknown column '' in 'where clause' |
|
| Theo Fileo Pradipta tolong bantuin gan <?php
if (!defined('BASEPATH')) exit('No direct script access allowed'); // load base class if needed require_once( APPPATH . 'controllers/base/AdminBase.php' );
// --
class compose extends ApplicationBase {
// constructor public function __construct() { parent::__construct(); // load model $this->load->model("m_compose"); $this->load->library('tnotification'); }
public function index() { // load template $this->smarty->assign("template_content", "latihan/compose/compose_tampilan.html"); // get data $params = array($this->com_user['user_id']); $rs_contacts = $this->m_compose->get_all_contacts($params); //assign var $this->smarty->assign("rs_contacts", $rs_contacts); // $filepath = base_url() . 'resource/doc/file/default.doc'; // if (!empty($result['email_attachment'])) { // $filepath_database = 'resource/doc/file/' . $result['email_attachment']; // if (is_file($filepath_database)) { // $filepath = base_url() . 'resource/doc/file/' . $result['email_attachment']; // } // } // $result['email_attachment'] = $filepath; // assign //$this->smarty->assign("result", $result); // notification $this->tnotification->display_notification(); $this->tnotification->display_last_field(); // display parent::display(); }
// Email Send public function email_send() { // cek input $this->tnotification->set_rules('email_to', 'Kepada', 'required'); $this->tnotification->set_rules('email_subject', 'Subyek', 'trim|required|max_length[100]'); $this->tnotification->set_rules('email_content', 'Message', 'trim|required|max_length[5000]'); // process if ($this->tnotification->run() !== FALSE) { $params = array($this->input->post('email_subject'), $this->com_user['user_mail'], $this->input->post('email_to'), $this->input->post('email_content')); // insert if ($this->m_compose->send_email($params)) { $this->load->library('tupload'); // upload config $config['upload_path'] = 'resource/doc/file/'; $config['allowed_types'] = 'doc|docx'; $config['max_size'] = '2048'; $config['overwrite'] = TRUE; // $config['file_name'] = $this->m_compose->get_last_data_by_id(`$email_id`); $this->tupload->initialize($config); // execute upload $this->tupload->do_upload('email_attachment'); // update gambar $params = array($this->tupload->file_name); $this->m_compose->insert_file($params); //get last id // notifikasi $this->tnotification->delete_last_field(); $this->tnotification->sent_notification("success", "Data berhasil disimpan"); } else { // default error $this->tnotification->sent_notification("error", "Data gagal disimpan"); } } else { // default error $this->tnotification->sent_notification("error", "Data gagal disimpan"); } redirect("latihan/compose"); }
} |
|
| kayanya mo nyobain pdo ya? ada binding2 gitu. kl iya, cb ubek2 deh ttg bindparam, bindvalue |
Tidak ada komentar:
Posting Komentar