mocheng
Forum Replies Created
-
Forum: Plugins
In reply to: How to get primary key of last inserted row into database?correct:) stackoverflow is another good source as codex does.
Forum: Plugins
In reply to: How to get primary key of last inserted row into database?I found the correct way.
http://codex.wordpress.org/Function_Reference/wpdb_Class#Class%5FVariablesI checked wordpress sourcecode. The class varialbe $wpdb->insert_id is updated with mysql_insert_id with connection identifier.
Forum: Plugins
In reply to: How to get primary key of last inserted row into database?Hi Michael,
If some more rows are inserted by other session before the $wpdb->get_col(…) is executed, would it be return invalid value?
What I want is to using AJAX to post data to server to insert into DB. The new row ID is returned in the AJAX response to update client status. It is possible that multiple clients are posting data to server at the same time. So, I have to make sure that each AJAX request get the EXACT new row ID in response.
Forum: Plugins
In reply to: How to make __() and _e() work in any PHP file?BTW, what is “define(‘WP_USE_THEMES’, false);” for?
Is it necessary? I remove this line and it still works.Forum: Plugins
In reply to: How to make __() and _e() work in any PHP file?Thanks ericmann.
It works.