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 8421163
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T03:04:20+00:00 2026-06-10T03:04:20+00:00

i have this code which permits me to do a request in order to

  • 0

i have this code which permits me to do a request in order to make a query!

Now the form which is processed has this code:

<form action="edit_images.php" method="post">
<input type="hidden" value="<? echo $gal_id1 ?>" name="img_id1"  />
<input type="submit" value="Edit All Images"  />
</form>

While the query is like this :

$img_id=$_REQUEST['img_id1'];
$sql="SELECT * FROM tbl_images WHERE Img_gal_id='$img_id'";

But it seems like it won’t take the value…
I mean, it doesn’t recognize the $img_id, which i have printed before and takes the exact value.

Let me show you the query i use in order to retrieve it:

$sql = "SELECT gal_id,gal_title,gal_image FROM tbl_galleries where gal_id='" . $_REQUEST['gid'] ."';";
      $query = mysql_query($sql) or $myErrorsP = mysql_error();
      if(isset($myErrors) && $myErrorsP!=''){     
      } else {          
          $row = mysql_fetch_row($query);
          mysql_free_result($query);
          $gal_id    = $row[0];
          $gal_id1    = $row[0];
          $gal_title = $row[1];
          $gal_image = $row[2];                     
      } 
  • 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-06-10T03:04:22+00:00Added an answer on June 10, 2026 at 3:04 am

    You are missing a ; on the end of your echo that isn’t outputting the value as expected. Additionally, you are using short tags, which could be causing problems. You might want to swtich to using <?php as an opening over <? on it’s own.

    <input type="hidden" value="<?php echo $gal_id1; ?>" name="img_id1"  />
    

    Lastly, you are using zero protection against injection attacks. Please, research prepared statements in PDO and update your code. The first injection attack you don’t have will thank you for it.

    Edit: When you run into a problem like this, it is often good practice to echo out the $sql just before you execute it.

    you could do this in the future with:

    $sql = "SELECT gal_id,gal_title,gal_image FROM tbl_galleries where gal_id='" . $_REQUEST['gid'] ."';";
    echo $sql."<br>\n";
    $query = mysql_query($sql) or $myErrorsP = mysql_error();
    

    which would have probably given you an excellent indication of what the problem was.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have this quick issue please. I have this code here which permits me
I have this code which retrieves some data from a sql query and place
I have this code which is ok $row->main_auto_make_make But I want to make something
I have this code which works. $(document).ready(function(){ $('form').live('submit', function(){ // have to do it
I have this code which successfully makes an HTTP request: //Successful request var requestInBytes
I have this code which permits me to display all the data in the
I have this code which adds a x number of views to a Multiview
I have this code which does the trick: #include <stdio.h> int main() { int
I have this code which is called at an onChange event of an function
I have this code which gets WP posts, but it gets all the posts

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.