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) Quote Link to comment 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); ?> Quote Link to comment 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 Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.