Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4612362
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T01:23:34+00:00 2026-05-22T01:23:34+00:00

This script is supposed to get the content of a text area and submit

  • 0

This script is supposed to get the content of a text area and submit it to mysql, but it isnt can anyone see why?

    if ($_SERVER["REQUEST_METHOD"] == "POST") 
{
$error = '';
$like = mysql_real_escape_string($_POST['like_box']);

mysql_query("INSERT INTO likes (like) VALUES ($like)");

$id = mysql_query("SELECT id FROM likes WHERE like=$like");
header('Location:like.php?id='.$id.'');
}?>



<form method="post" action="post.php">
                <textarea name="like_box" id="like_box" style="border-style: none; border-color: inherit; border-width: 0; width: 458px; height: 65px" class="style11120"></textarea>

            <tr>
                <td style="height: 53px">
                <div class="style11116" style="width: 417px">
                    <input name="Submit" type="submit" value="submit" />
                    </form>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T01:23:34+00:00Added an answer on May 22, 2026 at 1:23 am

    Having some error reporting would tell you that you need ‘ around the $like and you need ` around like in the columns section, since like is a reserved word, inside the insert.

    mysql_query("INSERT INTO likes (`like`) VALUES ('$like')") or trigger_error('Query Error: ' . mysql_error());
    

    Should work.


    Also you will need to enclose the like in ` for the select:

    $id = mysql_query("SELECT id FROM likes WHERE `like`=$like") or trigger_error('Query Failed: ' . mysql_error());
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This script is supposed to to get a multidimensional array and iterate through the
I have a Perl script, that's supposed to match this string: Sometimes, he says
I need to write a java script. This is supposed to validate if the
For this script, it checks to see if the file is a microsoft words
I have this script: select name,create_date,modify_date from sys.procedures order by modify_date desc I can
I'm using this script to display all the images in a folder, but I
Can someone explain why this script throws an exception? $byteArray = @(1,2,3) write-Output (
You can see the way its suppose to work by visiting: link text That
i have this code: <script> $(document).ready(function() { refresh(); }); function refresh() { $.get('getMessageDetails.php', function
i hope you can help me with this one. The code is supposed to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.