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

?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.