sql lesson

i havent got to get ultra-edit working. i dont know what happened, it was working this afternoon but now, hours later, i wouldnt go beyond the starting dialog box of the application. tried moving the folder into a different drive, un-installing + reinstalling... it just wouldnt work! m$ must have figured out how to delay my project again. so im going back to allaire homesite, my ex-text editor..anyway, have this sql query on my shipping module:

SELECT * FROM transactions_temp
ON transactions_temp.userid = users.userid
INNER JOIN locations
ON transactions_temp.locationid = locations.locationid
INNER JOIN services
ON transactions_temp.serviceid = services.serviceid
INNER JOIN packages
ON transactions_temp.send_packageid = packages.packageid
ON transactions_temp.send_packageid = rates.packageid
ORDER BY trans_tempid DESC LIMIT 1

when i had created the database schema, i had two identical tables, transactions and transactions_temp, whom i added without thinking., days later i was wondering why i inserted all the shipment data into transactions_temp and not to the transactions window? why did i create two identical tables? i guess by now its all clear because, ill be using ONLY the transactions_temp table for the shipment, all the data will be passed there temporarily, and after the user clicks 'DONE', all the data will be duplicated into the transactions table, and the row in the temporary table will be deleted. it has something to do with that sql query. because when i typed directly the url, ...user_home.php?print_label, it shows the query result of the last entry in the temp table. that disaster could be solved by copying the row from transactions_temp table into the transactions table. it would show up as null. first its a workaround, second it would be more secure. only at the last part of the shipping module, the transactions table would be used, as opposed to transactions_temp.. and the latter gets cleaned up after every successful display of the package label.

having coffee at this early morning. will be going downstairs for a smoke. (mom's here with me)

No comments: