TM3909 Posted July 7, 2009 Share Posted July 7, 2009 Hey all, I'm fairly new and need a little bit of help. I have a user submit data via a form, then it goes into the database, is pulled out, reformatted, and put back in into another table. All of this works, until I get to the putting it back formatted. You can see the code here: http://snipplr.com/view/16708/php-help/ and the issue starts at about line 56 I want to say. Any help would be amazing, I've been coding for 10+ hours and need the help!!! Quote Link to comment https://forums.phpfreaks.com/topic/165015-need-php-database-help/ Share on other sites More sharing options...
wildteen88 Posted July 7, 2009 Share Posted July 7, 2009 You cannot assign an echo to a variable. $post_title = echo $rev_title; $post_author = echo "7"; $post_content = echo $all; $post_type = echo "post"; $post_status = echo "publish"; $comment_status = echo "publish"; $post_date_gmt = echo $gmtdate; $post_date = echo $date; $post_category = echo "1"; The correct syntax for defining variables is $myVariable = 'somevalue'; // or $myVariable = $someOtherVariable You also do not need to keep connecting to/closing mysql everytime you perform a MySQL query. You should only connect once at the start of the script and close then connection at the end of the script (however PHP will automaitcally close the connection once the script has been processed). Quote Link to comment https://forums.phpfreaks.com/topic/165015-need-php-database-help/#findComment-870453 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.