Re: VFP 6 via ODBC and data integrity questions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> I have just began work on a project to let users subscribe to a service
and
> place orders into a database that is VFP 6 based.
>
> Using PHP4, I am able to interface with their program (that also uses ODBC
> locally) in all aspects (INSERT, UPDATE, DELETE, and SELECT).
>
> My worries come when inserting a new user/order from the web.
>
> The morons who designed the database made the Primary Key as character and
> NULLable (once only of course), but I have to deal with that.
>
> My question is this...
>
> How can I know the new user I INSERT will be unique? (the field is
> character, but counts like a number field)  This especially holds true
> since I have to deal with local users possibly adding at the exact same
> moment as PHP (ie. a racing issue).
>
> Can anyone tell me how to avoid problems?
>
> Would odbc_prepare() reserve a new key for me?

Just insert the name and look for an error coming back to you. There's some
way to get the error reported by the database with ODBC, isn't there? Parse
the error returned for something like "duplicate key" and then you'll know
the username wasn't unique and they need to find another.

---John Holmes...


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux