This is a discussion on "Include PHP in MYSQL Function?" within the PHP Forum section. This forum, and the thread "Include PHP in MYSQL Function? are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
Include PHP in MYSQL Function?
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
||||
|
||||
|
Include PHP in MYSQL Function?
This might really confuse you, but I'll try my best.
I'm attempting to very slowly redo my blog into OOP. I'm creating a class that allows you to give it parameters. Those are then inserted into the MySQL query. EG
I need to check if the user has included them, and if they have, add them to the MySQL statement. My plan was to create functions like:
Jack --- Also,
__________________
Jack Franklin - Webforumz Moderator (x)HTML | CSS | PHP | MySQL | JQuery (Javascript) Contact: My Blog | Twitter | Delicious Want Lessons? PM me. If you think I've helped, please press the 'Thanks' Button.
Last Blog Entry: A Week with VBulletin (Aug 28th, 2008)
Last edited by Jack Franklin; Mar 24th, 2008 at 18:11. |
|
|
|
#2
|
||||
|
||||
|
Re: Include PHP in MYSQL Function?
Infact, here is the entire code. It is my first real go at something useful in OOP, so be nice
__________________
Jack Franklin - Webforumz Moderator (x)HTML | CSS | PHP | MySQL | JQuery (Javascript) Contact: My Blog | Twitter | Delicious Want Lessons? PM me. If you think I've helped, please press the 'Thanks' Button.
Last Blog Entry: A Week with VBulletin (Aug 28th, 2008)
|
|
#3
|
||||
|
||||
|
Re: Include PHP in MYSQL Function?
You gotta do something like this:
hope it answers your question.
__________________
Web Design And Development: Other Road Design | Problems with IE6?: KApp | My Blog: Only Nerds Allowed | Learning PHP? Lessons
Last Blog Entry: Hilarious Rapper (Jul 29th, 2008)
|
|
#4
|
|||
|
|||
|
Re: Include PHP in MYSQL Function?
Also, in queries, don't use single quotes, as it will take it literally, not as a variable I believe
|
![]() |
| Tags |
| functions, mysql, php, problems |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [SOLVED] Does using PHP include() function affect my SEO ? | RohanShenoy | Search Engine Optimization (SEO) | 3 | Nov 22nd, 2007 18:13 |
| Function parameters that include quotes | loorp | JavaScript Forum | 7 | Sep 17th, 2006 04:18 |
| js include | timmytots | JavaScript Forum | 5 | Jul 8th, 2006 12:43 |
| mysql query in a function | Redempt1on | PHP Forum | 6 | May 19th, 2006 01:25 |
| Help need with php include!! | allstar | PHP Forum | 7 | Dec 29th, 2005 15:09 |