A question about mysql

A question about mysql

am 01.07.2011 04:57:30 von nagendra802000

--000e0cdfd7eab04abb04a6f92df2
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: quoted-printable

Hi All,

I have a question about php-mysql. Is it possible that I can have 2
different fields in a mysql table, and when a user fill out the form for th=
e
first time the input goes to first field and when the second user fill out
the form the input goes to 2nd field. For example: Lets say I have 2 fields
called $name1 and $name2. Now when 1st user input the data it goes to $name=
1
and then when the second user input the data it should check if the $name2
is NULL and if yes then the data goes to $name2 otherwise it should again
start with $name1.



--=20
*Best,
*
*Guru=99*

--000e0cdfd7eab04abb04a6f92df2--

Re: A question about mysql

am 01.07.2011 05:30:47 von Karl DeSaulniers

Hi Guru,
You could disable the input field or set it to readonly after it has =20
been filled in...

disabled=3D"disabled" />
or
readonly=3D"readonly" />

but you will have to do that client side with some javascript.
Unless you have the page refresh after each field is filled in, then =20
you could disable/readonly it via PHP.

HTH,

Best,
Karl



On Jun 30, 2011, at 9:57 PM, Guru=99 wrote:

> Hi All,
>
> I have a question about php-mysql. Is it possible that I can have 2
> different fields in a mysql table, and when a user fill out the =20
> form for the
> first time the input goes to first field and when the second user =20
> fill out
> the form the input goes to 2nd field. For example: Lets say I have =20
> 2 fields
> called $name1 and $name2. Now when 1st user input the data it goes =20
> to $name1
> and then when the second user input the data it should check if the =20=

> $name2
> is NULL and if yes then the data goes to $name2 otherwise it should =20=

> again
> start with $name1.
>
>
>
> --=20
> *Best,
> *
> *Guru=99*

Karl DeSaulniers
Design Drumm
http://designdrumm.com


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

Re: A question about mysql

am 01.07.2011 22:56:41 von Tamara Temple

On Jun 30, 2011, at 9:57 PM, Guru=99 wrote:
> I have a question about php-mysql. Is it possible that I can have 2
> different fields in a mysql table, and when a user fill out the form =20=

> for the
> first time the input goes to first field and when the second user =20
> fill out
> the form the input goes to 2nd field. For example: Lets say I have 2 =20=

> fields
> called $name1 and $name2. Now when 1st user input the data it goes =20
> to $name1
> and then when the second user input the data it should check if the =20=

> $name2
> is NULL and if yes then the data goes to $name2 otherwise it should =20=

> again
> start with $name1.

I'm sure it is quite possible. I am assuming these are independent =20
transactions, i.e, they don't happen simultaneously? (If there is a =20
chance they may happen simultaneously, you'll need to implement record =20=

locking.)

You'll want to do this with MySQL's GET_LOCK and RELEASE_LOCK so you =20
can do both a lookup to see if $name1 is set and if it's not set it =20
before another process comes along which may try to do the same thing. =20=

Also, not sure what happens when person 3 comes along?



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