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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T02:11:03+00:00 2026-06-14T02:11:03+00:00

I am having trouble with executing numerous ms_sql queries at once in PHP: Below

  • 0

I am having trouble with executing numerous ms_sql queries at once in PHP:

Below is a simplified version of what I am trying to do:

$updatesql = "UPDATE Pricing SET Price = '".$_POST['price1']."' WHERE PriceID = 1 ";
$updatesql = "UPDATE Pricing SET Price = '".$_POST['price2']."' WHERE PriceID = 2 ";
$updatesql = "UPDATE Pricing SET Price = '".$_POST['price3']."' WHERE PriceID = 3 ";
$updatesql = "UPDATE Pricing SET Price = '".$_POST['price4']."' WHERE PriceID = 4 ";
$updatesql = "UPDATE Pricing SET Price = '".$_POST['price5']."' WHERE PriceID = 5 ";
$updatesql = "UPDATE Pricing SET Price = '".$_POST['price6']."' WHERE PriceID = 6 ";
$updatesql = "UPDATE Pricing SET Price = '".$_POST['price7']."' WHERE PriceID = 7 ";
$updatesql = "UPDATE Pricing SET Price = '".$_POST['price8']."' WHERE PriceID = 8 ";

$executesql = mssql_query($updatesql);

When I go through them one by one they all work, however when I try to execute them all at once, only the LAST query seems to get executed.

Is what I’m trying to do possible? Any pointers where Im going wrong? Sorry fairly new to PHP.

  • 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-14T02:11:05+00:00Added an answer on June 14, 2026 at 2:11 am

    Try this

    $updatesql = "UPDATE Pricing SET Price = '".$_POST['price1']."' WHERE PriceID = 1 ;";
    $updatesql.= "UPDATE Pricing SET Price = '".$_POST['price2']."' WHERE PriceID = 2 ;";
    $updatesql.= "UPDATE Pricing SET Price = '".$_POST['price3']."' WHERE PriceID = 3 ;";
    $updatesql.= "UPDATE Pricing SET Price = '".$_POST['price4']."' WHERE PriceID = 4 ;";
    $updatesql.= "UPDATE Pricing SET Price = '".$_POST['price5']."' WHERE PriceID = 5 ;";
    $updatesql.= "UPDATE Pricing SET Price = '".$_POST['price6']."' WHERE PriceID = 6 ;";
    $updatesql.= "UPDATE Pricing SET Price = '".$_POST['price7']."' WHERE PriceID = 7 ;";
    $updatesql.= "UPDATE Pricing SET Price = '".$_POST['price8']."' WHERE PriceID = 8 ;";
    
    $executesql = mssql_query($updatesql);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am having trouble executing at command via php. When I start this job,
I'm having some trouble executing the slideDown() function in the code below. I'm using
I'm having trouble executing the lessc compiler from PHP. I'm using Symfony, and have
I'm having trouble executing an UPDATE-query with fmdb. It locks the application without any
I'm having trouble with a line inside an if statement executing before the conditional
I'm having trouble with Grails 2.0 and Postgresql 9.1 I'm trying to map an
I'm having trouble with an Expect regular expression. I'm trying to match on this
I'm having some trouble executing a nested sql query. It works fine when i
I am trying incorporate some javascript within the php below to pass a variable
I'm using MongoMapper with Padrino, and I'm having trouble with executing any padrino tasks.

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.