Jump to content

joshstevens19

Members
  • Posts

    30
  • Joined

  • Last visited

joshstevens19's Achievements

Newbie

Newbie (1/5)

1

Reputation

  1. okay that did help me mix my code up but now im getting this error?? error inserting new recordUnknown column 'TEST' in 'field list' this happens when i enter information and press enter?
  2. oh sorry i posted in wrong code that code works perfectly: have a look at this one please if (isset($_POST['submitted'])) { $name = $_POST['entername']; $usernameorguest =$_POST['usernameorguest']; $reply =$_POST['reply']; $sqlinsert = "UPDATE `forumposts`(`REPLY`) VALUES('$reply') WHERE `POSTID`=1"; $query = mysql_query($sqlinsert); if (!$query) { echo "error inserting new record" . mysql_error(); } } // end of mani if statment //$newrecord ="1 record added to the database"; my table is defined all correctly not posted the connection code as i didnt think that was relevant
  3. oh sorry i posted in wrong code that code works perfectly: have a look at this one please if (isset($_POST['submitted'])) { $name = $_POST['entername']; $usernameorguest =$_POST['usernameorguest']; $reply =$_POST['reply']; $sqlinsert = "UPDATE `forumposts`(`REPLY`) VALUES('$reply') WHERE `POSTID`=1"; $query = mysql_query($sqlinsert); if (!$query) { echo "error inserting new record" . mysql_error(); } } // end of mani if statment //$newrecord ="1 record added to the database"; ?> i know i have missed a couple of vaiables out but i am just testing it to make sure it works first? any ideas
  4. hey guys rite i have created a website and i am trying to insert a indivual piece of data into 1 column of my phpmyadmin page table. But i am doing a TV show website and just creating a easy and basic forumn.. i am trying to insert a reply code which when you enter the details in the reply box and sumit it insert it into ID number 1 of column reply.. at the moment all it does it insert it into the end of another ID which it is creating automatically can anyone help me .. i have attached my table on to this message so you can see what the table is like!! here is my code? <?php if (isset($_POST['submitted'])) { $posttopic = $_POST['POSTTOPIC']; $postdeatils =$_POST['POSTDEATILS']; $postauthor=$_POST['POSTAUTHOR']; $sqlinsert = "INSERT INTO forumposts (`POSTTOPIC`, `POSTDEATILS`, `POSTAUTHOR`) VALUES('$posttopic', '$postdeatils', '$postauthor')"; $query = mysql_query($sqlinsert); if (!$query) { echo "error inserting new record" . mysql_error(); } } // end of mani if statment //$newrecord ="1 record added to the database"; ?>
  5. i have done and it brings up this error ? error inserting new recordYou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(`REPLY`) VALUES('pdijspdjf') WHERE `POSTID`=1' at line 1
  6. it is a column that already exsists in my phpmyadmin table.. it is empty and this code should post it in to that column.. i change it to INSERT and it comes up with this error message error inserting new recordYou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INTO `forumposts`(`REPLY`) VALUES('test') WHERE `POSTID`=1' at line 1 saying the code is incorrect.. when i have ran it without the insert of POSTID it insert but not on the one i want it to it creates a new ID as that is on ai and posts it in that section?? any ideas?? thanks josh
  7. <?php if (isset($_POST['submitted'])) { $name = $_POST['entername']; $usernameorguest =$_POST['usernameorguest']; $reply =$_POST['reply']; $sqlinsert = "INSERT INTO `forumposts`(`REPLY`) VALUES('$reply') WHERE `POSTID`=1"; $query = mysql_query($sqlinsert); if (!$query) { echo "error inserting new record" . mysql_error(); } } // end of mani if statment //$newrecord ="1 record added to the database"; ?> this is my code now
  8. sorry guys i knew i wrote it wrong.. okay i have replaced the code and now it comes up with this error? error inserting new recordYou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE `POSTID`=1' at line 1 what does this mean?? just want to insert the data in my valables into the result column in ID1 ? i dont understand why it will not work? thanks a lot josh
  9. sorry guys i knew i wrote it wrong.. okay i have replaced the code and now it comes up with this error? error inserting new recordYou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE `POSTID`=1' at line 1 what does this mean?? just want to insert the data in my valables into the result column in ID1 ? i dont understand why it will not work? thanks a lot josh
  10. i know i have undefined variables at the moment just trying to get it to insert into the correct box
  11. hey guys rite i have created a website and i am trying to insert a indivual piece of data into 1 column of my phpmyadmin page table. But i am doing a TV show website and just creating a easy and basic forumn.. i am trying to insert a reply code which when you press reply it insert it into ID number 1 of column reply.. at the moment all it does it insert it into the end of another ID which it is creating can anyone help me here is my code? <?php if (isset($_POST['submitted'])) { $name = $_POST['entername']; $usernameorguest =$_POST['usernameorguest']; $reply =$_POST['reply']; $sqlinsert = "INSERT INTO `forumposts` WHERE (`POSTID`=1) INTO (`REPLY`) VALUES('$reply')"; $query = mysql_query($sqlinsert); if (!$query) { echo "error inserting new record" . mysql_error(); } } // end of mani if statment //$newrecord ="1 record added to the database"; ?>
  12. yes the bracket is done on it.. okay i understand a little bit mac but i still dont have a clue how to fix it as soon as i can fix this im laughing! lolll sorry i sound so dumb
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.