Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_php thread: How to convert Mysql instructions to PHP exclusive??


Message #1 by guru@i... on Tue, 7 Aug 2001 05:21:40
// Set the user id and return a password.
function setupAccount($first, $last, &$user_id){
  $user_id = substr($first, 0, 1).$last;
  return substr(md5($user_id.$first.$last),0,6);
}

This is an untested code snippet.  However, I believe this will work.
I think this is what you want.  If not, elaborate?

-----Original Message-----
From: guru@i... [mailto:guru@i...]
Sent: Tuesday, August 07, 2001 5:22 AM
To: professional php
Subject: [pro_php] How to convert Mysql instructions to PHP exclusive??


Can someone tell me how to convert the following SQL code so that I can 
run them directly from php...

Username Generation
UPDATE guests SET UserID = CONCAT(left(FirstName,1),LastName)

Password Generation
UPDATE guests SET Password =left(md5(CONCAT(UserID,FirstName,LastName)),6);


any help/ideas etc etc would be highly appreciated

Elliott




  Return to Index