Jump to content
MakeWebGames

Recommended Posts

Posted

I've got a simple MySQL code, which takes inputted information then put's it in to a table, I was wondering if I could do that but put the MySQL code in a different file then use the include function to call it up in my php file. If I can should I do it or is there no need?

Posted

There's probably no need to. If you do, and you do it indefinitely, you'll have a lot of 1KB files - which isn't nice to eyes, my eyes anyway.

May I ask why you'd want to put it in a different file?

Answering your question, they'd have to be stored in a super-global, such as _POST or _GET, sanitized and filtered in the file containing the query, and then processed.

Posted

May I ask why you'd want to put it in a different file?

Yeah sure, I was honestly just wondering, it's just struck me and I was wondering if I could, thanks for the reply:)

  • 7 months later...
Posted
I've got a simple MySQL code, which takes inputted information then put's it in to a table.

Do you mean PHP code that fires a mysql execute function with a insert statement into a table ?

Or a stored procedure that has params that will be inserted ?

Please give more information:

- What do you try to do. (Like: Take input from GUI, check constains, insert in table...... jada, jada, jada....)

- What is your (best) motivation to do it. (Like: performance, clean coding, patterns, testing...)

Thanx. Happy Hacking: Roger

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.   Paste as plain text instead

  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...