not loading data

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
CoolAsCarlito
Forum Contributor
Posts: 192
Joined: Sat May 31, 2008 3:27 pm
Contact:

not loading data

Post by CoolAsCarlito »

My problem is that it's not getting the value of the quote and placing it inside input tag.

Code: Select all

<?php 
    $e = <<<here
        <script src="./jscripts/scriptaculous/prototype.js" type="text/javascript"></script>
        <script src="./jscripts/scriptaculous/scriptaculous.js" type="text/javascript"></script>
        <script type="text/javascript" src="./jscripts/ajax.js"></script>
here;
    switch ($_REQUEST['option']) {
        case 2:
            echo $e;
            require_once('../backstagefunctions.php');
            require_once('../backstageconfig.php');
            $id = $_GET['id']; 
            $query = mysql_query("SELECT * FROM `efed_bio_quotes` WHERE `id` = '" . $id . "'");
            $row = mysql_fetch_array($query); 
            ?>
            <h1 class=backstage>Quote Management</h1><br />
            <h2 class=backstage>Edit Quote</h2><br />
            <form name="editquote" method="post"> 
                <input type="hidden" name="action" value="quote" />
            <table width="100%" class="table2">
                <tr>
                    <td class=rowheading width=120>Quote:</td><td class=row3><input type="text" name="quote" class="fieldtext490" value="<?php $row['quote'];?>"></td>
                </tr>
            </table><br />
            <input type="hidden" name="oldquote" value="'.$row['quote'].'">
            <input type="hidden" name="defaultcharacterid" value="<?php echo $defaultcharacterid; ?>">
            <input type=submit value="Edit Quote" class=button></form><br />
            <form method=POST><input type=hidden name=action value=quotes><input type=submit value="Return to Quotes List" class=button200></form><br />
        </form>
            <?php
            returnmain();
        break;
    }
    function quotes($fedid,$uname,$pword,$userid,$isadmin,$admincssfile,$dbname,$defaultcharacterid,$defaultcharactername) {
        if ((!empty($_POST['editted']))) {
            $quote = mysql_real_escape_string($_POST['quote']);  
            $oldquote = mysql_real_escape_string($_POST['oldquote']); 
            $query = "UPDATE efed_bio_quotes SET quote = '$quote' WHERE quote = '$oldquote'";  
            mysql_query($query);
        }
    }
?>
User avatar
AbraCadaver
DevNet Master
Posts: 2572
Joined: Mon Feb 24, 2003 10:12 am
Location: The Republic of Texas
Contact:

Re: not loading data

Post by AbraCadaver »

Maybe try actually echoing it:

Code: Select all

value="<?php [b][u]echo[/u][/b] $row['quote']; ?>"
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
Post Reply