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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T00:10:46+00:00 2026-05-14T00:10:46+00:00

This sounds like a really simple question, but I am new to PHP. If

  • 0

This sounds like a really simple question, but I am new to PHP. If I have a statement like this:

$r =& $db->query("insert into table (col1, col2) values (10, 20)");

Do I have to still execute it, or does it get executed when I reference it? I have another case where I have a select query, which seems logically to run only when I call fetchrow, but the code I am copying from does not call execute or fetch. I would have expected it to, so I cannot tell if it is just that I don’t get it, or that the missing execute statement is the problem. It also does not insert the record, but it does not throw an error I can find.

Also, I am a little confused by the =& notation. I looked it up on google, and found a few mentions of it, but I am still not clear on it.

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-14T00:10:46+00:00Added an answer on May 14, 2026 at 12:10 am

    It will be executed when you call query()

    The =& notation is obsolete… it used to make the function return a reference to the resource object. But current versions of PHP (>5.0, I think) always pass (and return) objects by reference, so it doesn’t really change anything anymore.

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

Sidebar

Related Questions

Sounds like a weird question, but say I have something like this: $.post( /myajax.php,
Sorry if this sounds like a really stupid question, but I need to make
I know this sounds like a really obvious question, but it's proving harder to
Okay, Now admittedly this sounds like a silly question; But, I actually have a
This sounds really simple but it's like an onion - lots of layers as
im really new to linq-to-SQL so this may sound like a really dumb question,
This sounds like a look-up-in-the-manual question to me, but I can't find it. Suppose
I'm sure this sounds like a n00b question, but how do I add sub
This sounds like a stupid question, but thought I would post anyway... I am
Unfortunately, the answer to this question isn't quite as simple as it sounds... but

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.