Jump to content

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 :)
Link to comment
https://forums.phpfreaks.com/topic/6680-update-sql-statement/
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;"
Link to comment
https://forums.phpfreaks.com/topic/6680-update-sql-statement/#findComment-24367
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.