A question about mysql

--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.



--
*Best,
*
*Guru=99*

--000e0cdfd7eab04abb04a6f92df2--
nagendra802000 [ Fr, 01 Juli 2011 04:57 ] [ ID #2061685 ]

Re: A question about mysql

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

<input type=3D"text" name=3D"name1" value=3D"persons name"
disabled=3D"disabled" />
or
<input type=3D"text" name=3D"name1" value=3D"persons name"
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
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
> form for the
> 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 $name1
> 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.
>
>
>
> --
> *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
Karl DeSaulniers [ Fr, 01 Juli 2011 05:30 ] [ ID #2061686 ]

Re: A question about mysql

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 =

> for the
> 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 $name1
> 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.

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

locking.)

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

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
Tamara Temple [ Fr, 01 Juli 2011 22:56 ] [ ID #2061687 ]
PHP » gmane.comp.php.database » A question about mysql

Vorheriges Thema: vend-bot?
Nächstes Thema: What is wrong with this code??