Warning: fopen(graphic_design/files/thread-948-1.txt) [function.fopen]: failed to open stream: Permission denied in /graphic_design/global.php on line 421 file NOT opened
If anyone will know this, it will be Octane. -
I'm copying the local tv events DB. Aside from the event information table, there is a related table for the dates of the event. You can't add an event date until the event is added. This means that users must go through 2 steps to add an event. I want to make this one step.
In mysql, is there a way to get the next value of auto_increment and reserve it without adding a record, and then add a record to that id later? maybe I'm better to store the information in a cookie or session variable and add it after the record? Or create a table to temporarily store the date information until the event is added using a session id and then transfer the data?
Arch Stanton
06-01-2004, 09:02 PM
So I just went ahead with the session variable thing. Works quite well. If anyone is interested in my form:
To use the session thing, you have to check the reoccuring event box.
Octane
06-02-2004, 12:30 AM
looks like u got it working pretty good ... just have to test for a date entered. I'm not a fan of the session variables anymore. I had some trouble with a couple sites on different servers where the page would freeze when calling the session. From then on, i stopped using them.
As for using the id, i'm not sure if i understood you correctly, but you can add the information to the DB and then retrieve the ID using "SELECT LAST_INSERT_ID() AS nextval" to be used later.
I would probably have to see the DB to get an idea of how you are entering the data in relation to the form ... but, if what u got works, why change it.
PS - i really like that menu u've got going ... is that ur handywork??
Arch Stanton
06-02-2004, 07:21 AM
Thanks, I was looking for something like "LAST_INSERT_ID()". Although, if more than one person is adding an event at around the same time, I think this could cause bad relations.
Which menu, the top one, or the one on the left? All of the code in this site was implemented by me. Although the menu on the left I adapted from another site, can't remember which one, I've used it a few times since then.
Octane
06-02-2004, 12:24 PM
actually, MySQL did this function very well ... it works on a per-connection basis, so there won't be a conflict.
I like the menu at the top ... the one that brings up a secondary menu below the main when mouseovering the top nav. What does the left side menu do? It's just a straightforward menu, unless it's not working for me or i'm on the wrong page.
Arch Stanton
06-02-2004, 01:02 PM
It's working now.
Octane
06-03-2004, 07:23 AM
ahhh, much better ... but i still like the top nav better ... it's very clean.
Jeff O.
06-03-2004, 09:40 AM
Octane, I was wondering, if you've stopped using session variables, how do you maintain state (persistence) from page to page. Do you use query strings to pass the values that you need from page to page? I too am growing tired of using session varaibles, for exactly some of the reasons that you mention above, but still I have to admit that session variables seem to be a neccessary evil that I frequently have to rely upon for persistence from page to page.
Thanks! :)
Octane
06-03-2004, 11:35 PM
oh, that's simple ... cookies. they are much more reliable as 99% of the sites use them, so no one shuts them off anymore. You can't shop on any of the big sites without them, so, if u have a well designed professional site, you shouldn't have any trouble with people shutting their cookie acceptance off. Besides, session variables use a type of cookie anyway, so if that's ur worry, then sessions wouldn't work very well for those users either.
Arch Stanton
06-04-2004, 07:42 AM
Get more cookie acceptance with a p3p policy.
http://www.w3.org/P3P/
Handy Tool
http://www.alphaworks.ibm.com/tech/p3peditor
Jeff O.
06-04-2004, 08:41 AM
Yeah... cookies. Unfortunately, I have a lot intimate experience developing with those things. Thanks for the info and Joel thanks for the p3p policy link. Very helpful. :)
Octane
06-04-2004, 09:03 AM
interesting ... don't think it'll work, but interesting none-the-less.