brownrock Posted October 2, 2007 Share Posted October 2, 2007 I need help creating a PHP script that will ... import - ID, user_login and user_pass - into wp_users from another table called jos_users (located in the same database) where these three fields are called - id, username and password. I need to set up a cron job to do this because new users are being continuously added to the source table. I can decipher PHP but I can't write it. So, I need someone to code this for me. Hoping some kind and knowledgeable soul will read this and offer their services. Linux, i686 SQL: 4.1.22-standard PHP: 4.4.7 Apache: 1.3.37 (Unix) Link to comment https://forums.phpfreaks.com/topic/71465-help-needed-setting-up-cron-job/ Share on other sites More sharing options...
clearstatcache Posted October 2, 2007 Share Posted October 2, 2007 how about trying ds code..... <?php $link = mysql_connect($server, $db_user, $db_passwd); if (!$link) { die('Could not connect: ' . mysql_error(). '\n'); } mysql_select_db('jos_users'); $sql = "select * from jos_users"; $result = mysql_query($sql); while($row = mysql_fetch_array($result) ) { $insert_sql = "insert into wp_users (id, username, password) values('{$row['id']}', '{$row['username']}', '{$row['password']}')"; mysql_query($insert_sql); } mysql_close($link); ?> Link to comment https://forums.phpfreaks.com/topic/71465-help-needed-setting-up-cron-job/#findComment-359842 Share on other sites More sharing options...
brownrock Posted October 3, 2007 Author Share Posted October 3, 2007 Thanks for the code, I'm still working on getting it to work, Will keep you posted Link to comment https://forums.phpfreaks.com/topic/71465-help-needed-setting-up-cron-job/#findComment-360769 Share on other sites More sharing options...
brownrock Posted October 3, 2007 Author Share Posted October 3, 2007 jd2007, Received your message but for whatever reason I'm not allowed to reply!!! Can you send me an email address where I can reach you, Thanks Link to comment https://forums.phpfreaks.com/topic/71465-help-needed-setting-up-cron-job/#findComment-360771 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.