retrieve the php code from database

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cheku
    New Member
    • Jul 2008
    • 3

    retrieve the php code from database

    How to retrieve the php code from database and deploy it as a php statement in my php file??
  • coolsti
    Contributor
    • Mar 2008
    • 310

    #2
    Why would you want to do that? Can't you figure out a different way to achieve what you are trying to achieve?

    Firstly, you would do this by using some sort of statement that executes a string variable as PHP code.

    But then you would be "coding blindly", executing code that you may no longer have direct control over. What if you made a mistake in the database entry? What if you made a mistake in the select statement to retrieve the data representing the PHP code? What if another user has access and puts something into the database that causes problems?

    Far better would be to use database entries to make decisions about which already present code should be carried out, such as by using a switch statement.

    Comment

    • Markus
      Recognized Expert Expert
      • Jun 2007
      • 6092

      #3
      You can eval() your code.

      Comment

      • cheku
        New Member
        • Jul 2008
        • 3

        #4
        Thanks for your reply..........

        eval() function helps me.......

        Comment

        • Markus
          Recognized Expert Expert
          • Jun 2007
          • 6092

          #5
          Originally posted by cheku
          Thanks for your reply..........

          eval() function helps me.......
          Glad to help.

          Comment

          Working...