Jump to content

Archived

This topic is now archived and is closed to further replies.

TennesseeGuy

Update SQL Statement

Recommended Posts

Simple question for you gods of mysql. I have a simple upload include script within one of my pages. the include script is only called upon if certain criteria are met. If those criteria are met then the script process normally. The images are uploaded to the appropriate folder and the original is trashed from the temp folder. My question is how on the parent page can I extract the new file name (upload script has a unique renaming script) so I may include it in my insert into statement? Thanks all :)

Share this post


Link to post
Share on other sites
Not really a MySQL question, but of course I'll answer anyway.

The clean way to do something like that is to make the upload handler in the included file a function, and have it return the new filename. That way your scoping all works out. You can also use a global variable, the included file sets it, the calling file checks its value later. The "global" construct can be used to bring it into scope. i.e. "global $cfg; echo $cfg;"

Share this post


Link to post
Share on other sites
Thanks wick. The global vaiable worked perfectly. I was trying th return before but it wasn't working until I made it global. Thanks for your help :)

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.