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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T14:49:38+00:00 2026-06-17T14:49:38+00:00

I am using php to insert into Microsoft SQL table and the below is

  • 0

I am using php to insert into Microsoft SQL table and the below is my code:

$server = "**/**,1433";
$connectionInfo = array( "Database"=>"***", "UID"=>"**", "PWD"=>"******" );
$conn = sqlsrv_connect( $server, $connectionInfo );
if( $conn === false ) {
    die( print_r( sqlsrv_errors(), true));
}
if(!empty($_POST['check_list'])) {
    foreach($_POST['check_list'] as $check) {

$sql = "SELECT Item.HQID, Item.ItemLookupCode, Item.Description, Item.ExtendedDescription, Item.SalePrice, Item.Price, Item.CategoryID FROM Item WHERE Item.HQID = '$check'";
$stmt = sqlsrv_query( $conn, $sql );
if( $stmt === false) {
    die( print_r( sqlsrv_errors(), true) );
}

while( $row = sqlsrv_fetch_array( $stmt, SQLSRV_FETCH_ASSOC) ) {

 $html_table = '<table border="1" cellspacing="0" cellpadding="2">';

 $html_table .= '<form method="post" action="upload.php"><tr><td width="350" align ="center">' .$row['Description']. '</td><td width="350" align ="center">' .$row['ExtendedDescription']. '</td><td width="130" align="center">' 

.$row['ItemLookupCode']. '<td width="100" align="center">' .$row['SalePrice']. '</td><td width="100" align="center">' .$row['Price']. '</td><td width="200" align="center"><input 

type="text" size="24" name="stitle"></td><td width="100" align="center"><input type="text" size="8" name="wprice"></td><td width="120" align="center"><input type="text" size="10" name="scategory"></td><td width="220" align="center"><input 

type="text" size="28" name="sbody"></td></tr>';
$html_table .= '</table>'; 
echo $html_table;  
}
}
}
}
?>
<input type="submit" value="Upload this page" ></form>

I have an <input> with name="stitle" and I want the PHP code to take values from each <input> but currently it picks up the value just from the first <input>. How do I fix this?

  • 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-17T14:49:39+00:00Added an answer on June 17, 2026 at 2:49 pm

    Your post is horrible formatted, but I think you’re looking for the array notation.

    You can make something like that:

    <input type="text" size="24" name="stitle[]">
    

    The $_POST array field stitle is an array with all values after submitting the form.

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

Sidebar

Related Questions

I'm trying the code below to enter events into MySQL table using PHP .
I am using below code to upload excel and INSERT in mysql in php
Anyone see what is wrong with this line of code? using php/mysql $sqlInsert=INSERT INTO
Below I have an INSERT database function using php and mysqli: for ($i =
In PHP, I create and execute SQL queries like the following. INSERT INTO Table
I am using Php to insert values into MySQL table. What i am trying
I have a lot of text to insert into a MySQL table using PHP.
I am attempting to convert the MySQL table into an array using PHP. Each
how to insert inner array in mongodb using php I run this command in
I'm using the PHP PDO's to insert and update values in a table. The

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.