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

  • Home
  • SEARCH
  • 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 5930053
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T14:30:17+00:00 2026-05-22T14:30:17+00:00

Hi I’m having an issue with a small php script. I am trying to

  • 0

Hi I’m having an issue with a small php script. I am trying to get my user to change the status of a “job” so I am having to use option and post.

I can get the option answer but not the id. So how do I pass the id to then new script bellow are the scripts.

<?php
$conx; //connection object to the server
$comd;//instance of a command object
$sql; //string variable to hold the SQL commands
$itemsAdded; //numeric var to hold num records added to table (1 or 0)
$dbpath;

$db = realpath("../Database/iceserv.mdb");

$conn = new COM('ADODB.Connection') or exit('Cannot start ADO.');

$connStr = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=$db";

$conn->Open($connStr);

$sql = "SELECT callback.*,  status.stat_disc AS Status
FROM callback INNER JOIN  status ON callback.callback_STATID = status.stat_ID";

$rs = $conn->Execute($sql);
if (!$rs) {exit("Error in SQL");}
echo "<form method='post' action='../scripts/update_stat.php' id='status' name='status'><table><tr>";
echo "<th> Cutomer ID</th>";
echo "<th>Customer First Name</th>";
echo "<th>Customer Surname</th>";
echo "<th>Customer Phone Number</th>";
echo "<th>Customer Reason For Callback</th>";
echo "<th>Callback Status</th>";
echo "<th>Change Status</th>";
echo "<th></th>";

while (!$rs->EOF) {

     $callid=$rs->Fields['callback_ID']->Value;
     //echo $callid;
     $fname=$rs->Fields['callback_fname']->Value;
     $sname=$rs->Fields['callback_sname']->Value;
     $phone=$rs->Fields['callback_phnum']->Value;
     $reason=$rs->Fields['callback_reason']->Value;
     $status=$rs->Fields['Status']->Value;
     echo "<tr><td align='center'>$callid</td>";
     echo "<td align='center'>$fname</td>";
     echo "<td align = 'center'>$sname</td>";
     echo "<td align = 'center'>$phone</td>";
     echo "<td align = 'center'>$reason</td>";
     echo "<td align = 'center'>$status</td>";
     //echo "<td align = 'center'><input type='text' name='calledid' value = '$callid'></td>";
     echo"<td align = 'center'><select name ='status' size='1'>
     <option value =''>Choose status</option>
     <option value ='1'>Open </option>
     <option value ='2'>Waiting Qoute</option>
     <option value ='3'>Closed </option></td>
     </select>";
     echo  "<td><input type='submit' name='submit_btn' id='submit_btn' value='Update' class='submit_btn1'</input></td></tr></table></form>";

  exit;
  }
?>

So the above script is calling and pulling the information from the database

    <?php

    //variable listing and usage
    $conx; //connection object to the server
    $comd;//instance of a command object
    $sql_comd; //string variable to hold the SQL commands
    $itemsAdded; //numeric var to hold num records added to table (1 or 0)
    $dbpath;

        $db = realpath("../Database/iceserv.mdb");

        $conn = new COM('ADODB.Connection') or exit('Cannot start ADO.');

        $connStr = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=$db";

        $conn->Open($connStr);
              $id = $_POST['callid'];
              echo "ID is " +$id;
              $option= $_POST['status'];

    $sql_comd="UPDATE callback
    SET callback_STATID=$option
    WHERE callback_ID=$id
    ";
    $conn->Execute($sql_comd);

//$result = null;
$conn = null;

header('Location: ../admin/callback.php');

?>

The above script is trying to update the table but the id is not passing through so how do I get the ID to be passed to the script?

Please ask if ive been unclear

  • 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-22T14:30:18+00:00Added an answer on May 22, 2026 at 2:30 pm

    You can set the value of the select like: <option value ='{$callid}|1'>Open </option> and then explode by “|” to split the result list($id,$option)=explode("|",$_REQUEST['status'])

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

Sidebar

Related Questions

I'm trying to create an if statement in PHP that prevents a single post
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I want to count how many characters a certain string has in PHP, but
I used javascript for loading a picture on my website depending on which small
Basically, what I'm trying to create is a page of div tags, each has
this is what i have right now Drawing an RSS feed into the php,
I want use html5's new tag to play a wav file (currently only supported
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and

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.