• I want to insert data into the table ‘cls_users’ of an external Mysql database.
    I started with this:

    try {
    		$cmsadb = new wpdb(CMSA_USERNAME, CMSA_PASSWORD, CMSA_DATABASE, CMSA_HOSTNAME);
    		$cmsadb->show_errors();
    	} catch (Exception $e)	{
    		writeLogWP("Connection error: " . $e->getMessage());
    	}

    with no error; then I tryed to insert into table ‘cls_users’:

    $name = 'john';
    $email = '[email protected]';
    $result = $cmsadb->insert('cls_users',
    			array(
    				'name' => $name,'mail' => $email));

    But got $result = false.
    What am I do wrong? Thanks

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Insert row in external database’ is closed to new replies.