Porkie Posted September 14, 2009 Share Posted September 14, 2009 echo"<textarea name='englandsong' cols='80' rows='30' value='{$stuff['Comp1england']}'</textarea>"; i have data in the database its just not being shown ? am i doin summit wrong? Please help cheers Quote Link to comment https://forums.phpfreaks.com/topic/174217-confused-with-an-error/ Share on other sites More sharing options...
Garethp Posted September 14, 2009 Share Posted September 14, 2009 Well show us the whole code. Also, try print_r($stuff); But seriously, show us the whole code Quote Link to comment https://forums.phpfreaks.com/topic/174217-confused-with-an-error/#findComment-918394 Share on other sites More sharing options...
sasa Posted September 14, 2009 Share Posted September 14, 2009 try to close open textarea tag echo"<textarea name='englandsong' cols='80' rows='30' value='{$stuff['Comp1england']}'></textarea>"; Quote Link to comment https://forums.phpfreaks.com/topic/174217-confused-with-an-error/#findComment-918396 Share on other sites More sharing options...
Garethp Posted September 14, 2009 Share Posted September 14, 2009 That's not how you set the value of the text area anyway. You do it as so echo"<textarea name='englandsong' cols='80' rows='30>{$stuff['Comp1england']}</textarea>"; Quote Link to comment https://forums.phpfreaks.com/topic/174217-confused-with-an-error/#findComment-918397 Share on other sites More sharing options...
Bricktop Posted September 14, 2009 Share Posted September 14, 2009 Hi Porkie, Are you able to show us the full code - how are you performing the MySQL query? From what you've posted you need to remove the value attribute as this can't be set on a textarea, and remove the curly brackets. So something like: echo"<textarea name='englandsong' cols='80' rows='30' >$stuff['Comp1england']</textarea>"; But depending on how you're MySQL query is being performed this may or may not output a result. Quote Link to comment https://forums.phpfreaks.com/topic/174217-confused-with-an-error/#findComment-918400 Share on other sites More sharing options...
Porkie Posted September 14, 2009 Author Share Posted September 14, 2009 thanks for all replies, that coding works now, however can you see a problem in this update piece of code, <?php require('core.inc.php'); if($_SERVER['REQUEST_METHOD'] == 'POST') { $Comp1England = addslashes($_POST['englandsong']); $sql = mysql_query("UPDATE gg_users SET $Comp1England = '".englandsong."' "); if ($sql) { echo "Updated successfully"; } else { echo "There was an error updating the database"; } } ?> Quote Link to comment https://forums.phpfreaks.com/topic/174217-confused-with-an-error/#findComment-918409 Share on other sites More sharing options...
Porkie Posted September 14, 2009 Author Share Posted September 14, 2009 sorry forgot to mention basically when i click update on my form this code is meant to update my work, it runs however doesnt update with data that was in my textbox, just updates and inserts nothing, no text is shown. Quote Link to comment https://forums.phpfreaks.com/topic/174217-confused-with-an-error/#findComment-918552 Share on other sites More sharing options...
Bricktop Posted September 15, 2009 Share Posted September 15, 2009 hi Porkie, The problem is with this line: $Comp1England = '".englandsong."' It should read something like: englandsong = '".$Comp1England."' Hope this helps. Quote Link to comment https://forums.phpfreaks.com/topic/174217-confused-with-an-error/#findComment-918756 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.