I've created joomla registration form works fine then I added a query to copy the results into another table called users the only problem i am having is the password ...I didn't want to copy the password because is hashed by joomla i added my own script to hash the password.
basically the script works only with one query at a time.
here's the code
here is the other query i've tried everything to include it inside the above script never worked.
Any ideas to combine these two?
Much appreciated
basically the script works only with one query at a time.
here's the code
$getpassword = JRequest::getString('password', '', 'post');
$salt = substr(md5($password), 0, 2);
$password = md5($salt . $getpassword ) . ':' . $salt;
$db = &JFactory::getDBO();
$query = "INSERT INTO users (id,name,email)
SELECT #_users.id, #_users.name, #_users.email
FROM #_users ORDER BY ID DESC LIMIT 1";
$db->setQuery($query);
$db->query();
here is the other query i've tried everything to include it inside the above script never worked.
INSERT INTO users (password) VALUES($password)
Any ideas to combine these two?
Much appreciated