Jump to content

Help needed setting up cron job !!!


brownrock

Recommended Posts

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

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);

?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.