Re: DatabaseAccess
Re: DatabaseAccess
- Subject: Re: DatabaseAccess
- From: David LeBer <email@hidden>
- Date: Wed, 12 May 2004 08:37:59 -0400
On 12-May-04, at 12:30 AM, WELEMSKI wrote:
Hi, I am new to webObjects I have this problem which I havn't figured
out yet. I am a php programmer before I switch to webObjects...
How am I able to fetch all the data on the database in to an array
type of variable so I can compare the data in the future.
e.g. in php we have " mysql_fetch_array($result_query) " where the
"$result_query" is the result of the mysql queries ;
$result_query=mysql_query("SELECT * FROM tblname");
So I could compare the data in the future when the value of the
database if the data are already fetched in the variable.
I am making a database where the username is unique I want the
webObjects to identify if the username is in use or not and redirected
to another page or else save the data in to the database..
You could do something like this:
NSArray existingUsers = EOUtilities.objectsMatchingKeyAndValue(ec,
"User", theUsername, "username");
if (existingUsers != null && existingUsers.count() > 0) {
//there is an existing user... deal with it.
} else {
//it's OK to add the user...
}
;david
--
David LeBer
Codebase Software Systems
site: http://www.codebase.ca
blog: http://david.codebase.ca
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.