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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:49:41+00:00 2026-05-25T15:49:41+00:00

I have the following MySQL query: $imgDimensions_query = SELECT imgWidth, imgHeight FROM ( SELECT

  • 0

I have the following MySQL query:

$imgDimensions_query = "SELECT imgWidth, imgHeight FROM (
    SELECT imgHeight, imgWidth FROM primary_images WHERE imgId < 10
    UNION 
    SELECT imgHeight, imgWidth FROM secondary_images WHERE primaryId < 10) as imgDimensions";
$imgDimensions_data = mysql_query($imgDimensions_query) or die('MySql Error' . mysql_error());

I would like to place all the results in two separate arrays; One for imgWidth, and one for imgHeight.

I tried to do this using a while loop, but I didn’t know what to use inside the loop to create the arrays.

I’m going to explain what I will be doing with this information in case you think of a better method than using arrays: I will be first removing any results from imgWidth and imgHeight if they match an external set of values. Then I will find the maximum values of both imgWidth and imgHeight after said removal, and placing those two values in respective variables.

Thanks for your help.

  • 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-25T15:49:41+00:00Added an answer on May 25, 2026 at 3:49 pm

    You can use mysql_fetch_asoc() like this:

    while($row = mysql_fetch_assoc($imgDimensions_data)) {
        $imgWidth[] = $row['imgWidth'];
        $imgHeight[] = $row['imgHeight'];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following MYSQL query: SELECT categories.key, categories.name, count(*) as itemsCount FROM categories
I have the following MySQL query: SELECT Project.*, `trk_deleted`, `trk_status`, `trk_state` FROM `project` AS
I have the following simple MySQL query, called from PHP: SELECT foo_id, SUM(number_of_guests) FROM
I have the following MySQL query that I execute from a .php page SELECT
I have the following MySql query: select t1.* from Table1 t1 inner join Table2
I have the following mysql query: $products = mysql_query(SELECT * FROM dpweb_products WHERE id='$id')
I have the following query (MySQL): SELECT col1, col2 FROM database1.table ->WHERE col3 !=
I have a problem with the following MySQL query: SELECT * FROM TPDSessions WHERE
I have the following MySQL query: DELETE FROM catalogue WHERE catalogue_id IN ( SELECT
I have the following MySQL query: SELECT (COUNT(id) * 5) AS total FROM content

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.