The forums have permanently moved to This forum will be kept around in read-only mode for archival purposes. To learn how to continue using your existing account on the new forums, check out this thread.

Results 1 to 6 of 6

Thread: PHP in MYSQL

  1. #1

    Barcode PHP in MYSQL


    how I can store PHP code in a line of mySQL database?

    Like these

    PHP Code:
     <?php print 'Hi'?>

  2. #2
    Hmmm, I'd say this isn't the best of ideas. At best it could lead to confusion, at worst, some sort of appocolyptic database / php catastrophe.

    What is it you are wanting to do?

  3. #3


    I´m trying to execute a php code in mySQL.

    I made a system using DIVs, when a call for a DIV “X” with “ID” = 1, for example. It has access the table of the database in the column “content” and line “1” and reads the content php and executes in the page.

    Which is the best way to make this?

  4. #4
    So why not just have static content being output from the db into the div? Why do you need to store procedures in your db?

  5. #5
    Because i have some models of DIV.

    I want to be able to create other models dinamicly, that they will be safe in table DIVS.

    When adding one item home in the site, i want to choose the divs that they will be in the content of this page.

  6. #6
    you could just encode it , then eval it.

    be carefull though , as if someone injects some other code in your database ,
    your game might be over.


    $Sstring = base64_encode('<?php echo "eval it";?>');
    //you can store it now in the db
    eval("?>" . base64_decode($Sstring));// will output: eval it

    $Sstring2 = base64_encode('<?php echo "eval it"; echo "<br />"; $poos = array("php","is","easy"); foreach($poos as $poo) { echo $poo."<br/>"; }; ?>');
    eval("?>" . base64_decode($Sstring2));

    Last edited by kenisfam; January 30th, 2007 at 02:54 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Home About Meet the Moderators Advertise

 Link to Us


Copyright 1999 - 2012