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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T01:42:02+00:00 2026-05-15T01:42:02+00:00

I would like to know whether this MySql statement will be executed correctly, SELECT

  • 0

I would like to know whether this MySql statement will be executed correctly,

"SELECT sum(price) FROM products WHERE productid IN (SELECT productid FROM shoppingcart WHERE sessionid=".$this->$sessionid.")"

And if not please give me pointers as to where I am wrong.

Thanks

  • 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-15T01:42:03+00:00Added an answer on May 15, 2026 at 1:42 am

    I’m sure you meant

    $this->sessionid
    

    not

    $this->$sessionid
    

    (the second one returns value of property, which name is stored in sessionid, thus, when $sessionid is ‘abcdef’, it tries to return value of $this->abcdef property).

    Also, enclose in ‘ AND escape all parameters.

    "SELECT sum(price) FROM products WHERE productid IN (SELECT productid FROM shoppingcart WHERE sessionid='".mysql_escape_string($this->sessionid)."')";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 496k
  • Answers 496k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer this is a known bug that we've fixed in gingerbread;… May 16, 2026 at 11:39 am
  • Editorial Team
    Editorial Team added an answer What would be a better solution looking at the fact… May 16, 2026 at 11:39 am
  • Editorial Team
    Editorial Team added an answer You can build gcc 4.4.3 from source - http://gcc.gnu.org/install/ Or… May 16, 2026 at 11:39 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

In MySQL I have to check whether select query has returned any records, if
I'm a total newbie to Facebook programming and would like to know, as a
i am using excel to connect to a mysql database i am doing this:
I am currently using this type of SQL on MySQL to insert multiple rows
I am using Jython 2.2.1 and MySQL Connector/J 5.1 to access a MySQL database.
I need to run an application in an embedded system continuously. While implementing this
After asking this question and reading up a lot on templates, I am wondering
I'm working with SQL Server and I'm pretty new to SQL in general, so
I'm a bit of a PHP newbie so go easy on me :) I
I have a situation where I have to update a web site on a

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.