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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T09:39:51+00:00 2026-05-24T09:39:51+00:00

Baffled here: I am looking at a bunch of code written in PHP4 but

  • 0

Baffled here: I am looking at a bunch of code written in PHP4 but running under PHP5 – the code (abridged) looks like:

$pid=(int)$customer_exists['pid'];//this value comes from an earlier query & does exist

$query2 = mysql_query("SELECT * FROM `products` AS p, `products_description` AS pd WHERE pd.products_id=p.products_id AND p.products_id='".(int)$pid." '"   );

This gets no result from the database.
If the first line is changed to $pid=28; or if the query is changed to just search one table then we get a result.

Echo out $pid before and after the query will echo the value assigned in line 1

(have tried many versions of the actual $query2 – all get the same non-result)

What am I missing here?

  • 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-24T09:39:51+00:00Added an answer on May 24, 2026 at 9:39 am

    Can you try changing this

    AND p.products_id='".(int)$pid." '" 
    

    to

    AND p.products_id='".(int)$pid."'" 
    

    theres a space after double quote and before single quote which you don’t need.
    Also, you don’t need (int) here as you already do it in the previous line.

    Let me know if it works.

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

Sidebar

Related Questions

I'm a bit baffled here. But it might just be my lack of experience.
Alright I'm totally baffled. Here's my code: if ($password == $correct_password[0] && !isset($_COOKIE['user'])) {
This one has us all baffled at work. We have two services running on
I thought this would be fairly easy, but I'm totally baffled. I want one
I guess this question will sound familiar, but I am yet another programmer baffled
I am a bit baffled here; using IE7, ASP.NET 2.0 and Cassini (the VS
The other question (here: ) had solutions that I tried but they didn't work.
I'd consider myself a reasonable standard CSS/XHTML chap but I'm pretty baffled by this.
Another question about Web proxy. Here is my code: IWebProxy Proxya = System.Net.WebRequest.GetSystemWebProxy(); Proxya.Credentials
For some reason, the retain/release behavior in the following code has me completely baffled.

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.