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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:33:50+00:00 2026-05-26T17:33:50+00:00

I just don’t get it where is the problem but here’s the error: Fatal

  • 0

I just don’t get it where is the problem but here’s the error:

Fatal error: Can’t use function return value in write context in
D:\wamp\www\system\classes\database.class.php on line 70

Code:

public function query($sql) {
        if(!is_string() or empty(trim($sql))) {
            throw new Exception('No sql statement was entered.');
        }

        $query = @mysql_query($sql);

        if(!$query) {
            throw new Exception('Query could not be executed because of an error: [#' . mysql_errno() . '] - ' . mysql_error());
        }

        return $query;
    }

Line 70:

 if(!is_string() or empty(trim($sql))) {
  • 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-26T17:33:50+00:00Added an answer on May 26, 2026 at 5:33 pm

    It’s right there in the manual for the empty function: http://php.net/empty

    empty() only checks variables as anything else will result in a parse error. In other words, the following will not work: empty(trim($name)).

    To fix it you need to do something like:

    $sql = trim($sql);
    if(!is_string() or empty($sql)) {
    ...
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Maybe I'm slow, but I just don't get why you would ever use an
I just don't get it, it's actually so basic, but I just can't make
I just don't get it, class MyClass { const constant = 'constant value'; function
I'm trying to retrive a dataset to a Gridview, but I just don't get
I just don't get it: when I use the camera with an intent and
Sry but I just don't understand what is wrong in my syntext, can you
I just don't get the various elements of the traceview output, and I can't
OK, I've tried but I just don't get it. I have two classes logger
I just don't know why i get this error: 2010-10-28 16:32:29,925 ERROR [ache.commons.digester.Digester.error :1635]
this is a silly n00b question but i just don't get it to work.

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.