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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T11:39:35+00:00 2026-05-12T11:39:35+00:00

I have the following mysql query which I am running with php like so.

  • 0

I have the following mysql query which I am running with php like so. Notice that the update query is updating multiple tables at the same time.

$sql1 = <<<TEST1
UPDATE catalog_topics a
LEFT JOIN catalog_files_join b ON a.catalogID = b.foreignKey
LEFT JOIN catalog_files_join c ON c.foreignKey = b.catalogFileID
LEFT JOIN catalog_files d ON d.catalogFileID = b.catalogFileID
LEFT JOIN catalog_lu_topics e ON a.topicID = e.topicID
SET d.catalogFileID = 'test1',
    b.catalogFileID = 'test1',
    c.foreignKey = 'test1'
WHERE b.fileTypeID = 'gvl401'
AND c.fileTypeID = 'gvl25'
AND e.parentID = 'top305'
AND a.sortorder =1
AND e.topicID = 'top312';
TEST1;
echo $sql1;
$returnVal = mysql_query($sql1);

I am seeing weird results if I run this query from php compared to when I run it directly in mysql. So I am wondering if there is some other way in php to handle queries that update multiple tables at same time?

Eventhough, the above query runs fine (because $returnVal is 1) …I dont see all the records updated in the DB.

Is there a way in php to get back the number of records that got updated?

  • 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-12T11:39:35+00:00Added an answer on May 12, 2026 at 11:39 am

    mysql_affected_rows() will return the amount of records that has been updated

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

Sidebar

Related Questions

I currently have the following MySQL query, which I would like to include in
I have the following MySQL query that I execute from a .php page SELECT
I have the following MySQL query, which I'm using with PHP (5.2). DELETE t1.*,
I have the following MySQL query and tables from which I am querying: SELECT
I have an application that executes the following MySQL query: SELECT 402 AS user_id,
I have the following mysql query which is taking about 3 minutes to run.
I have the following MYSQL query which when executed shows me all the invalid
I have the following MySQL query, which produces the result I want: SELECT `l`.`status`,
I currently have the following MySQL query, which executes fine without any errors: SELECT
I have the following MySQL query which gets all the bookings for an agent,

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.