Date: 12/28/99
- Next message: Kristian Köhntopp: "Re: [PHPLIB] file upload problem"
- Previous message: Florian Gnägi: "Re: [PHPLIB] Multiple users, same username/password"
- In reply to: Joel: "[PHPLIB] a fool"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
> Please allow me to ask a couple of foolish question.
> 1. How to convert a string to numbers in mysql sql statement?
> eg. "select user_id from members order by user_id desc"
> however, the user_id type is string type.
hi joel
it should work out of the box. order works with ascii too...
> 2. How to issue a lock table command with the use of phplib? And how to
> avoid dead lock when I need to lock 2 tables?
> eg. I have 2 tables, table A and table B. I get a column from table A
> and insert into table B, how can I achieve a atomic transaction?
$db->query("LOCK TABLES A WRITE ,B WRITE");
// do your queries here
$db->query("UNLOCK TABLES");
or:
$db->query("INSERT INTO B (value1, value2) SELECT val1,val2 FROM A where
id='$bla'");
this is an atomic operation and therefore you won't need any locks. read
the mysql manual to read about when you can use this query type...
however, in both cases this has nothing to do with phplib.
cheers
-florian
>
> Best regard,
> Joel
>
> -
> PHP3 Base Library Mailing List. Send messages to <phplib <email protected>>.
> To unsubscribe, send "unsubscribe" to <phplib-request <email protected>> in
> the body, not the subject, of your message.
>
-
PHP3 Base Library Mailing List. Send messages to <phplib <email protected>>.
To unsubscribe, send "unsubscribe" to <phplib-request <email protected>> in
the body, not the subject, of your message.
- Next message: Kristian Köhntopp: "Re: [PHPLIB] file upload problem"
- Previous message: Florian Gnägi: "Re: [PHPLIB] Multiple users, same username/password"
- In reply to: Joel: "[PHPLIB] a fool"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

