MySQL Update and Sort Queries

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

 



hi all,

1) Question on UPDATE
----------------------------
My situation is this: I want to update Table1 with values that can be found in Table2.. in short, I would like to do the following:

$query = "update Table1, Table2 set Table1.field1 = Table2.field2 where Table1.no = Table2.no";

however, only MySQL 4.0.4 allows multiple updates and mine is 3.23.54... is there a way to achieve the same effect in one MySQL statement but WITHOUT using this multiple update technique?


2) Question on SORT
-------------------------
I would like to retrive my data from the database in the order which I had inserted it in.. is there a way to tell MySQL NOT to sort it in a certain way?? apparently, the result set i got seem to be sorted according to NAME although I did NOT append my query with an "ORDER BY"...  i'm using phpMyAdmin to view my database records and they are in the order which I inserted them in.. i would like to see this order too when i issue a SELECT on it.. how can I do this?

$query2 = "select * from GUEST where Hotel = 'PPH'";

Thank you so much! I look forward to hearing from you!

Hwee :o)

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

  Powered by Linux