Close Menu
    DevStackTipsDevStackTips
    • Home
    • News & Updates
      1. Tech & Work
      2. View All

      CodeSOD: A Unique Way to Primary Key

      July 22, 2025

      BrowserStack launches Figma plugin for detecting accessibility issues in design phase

      July 22, 2025

      Parasoft brings agentic AI to service virtualization in latest release

      July 22, 2025

      Node.js vs. Python for Backend: 7 Reasons C-Level Leaders Choose Node.js Talent

      July 21, 2025

      The best CRM software with email marketing in 2025: Expert tested and reviewed

      July 22, 2025

      This multi-port car charger can power 4 gadgets at once – and it’s surprisingly cheap

      July 22, 2025

      I’m a wearables editor and here are the 7 Pixel Watch 4 rumors I’m most curious about

      July 22, 2025

      8 ways I quickly leveled up my Linux skills – and you can too

      July 22, 2025
    • Development
      1. Algorithms & Data Structures
      2. Artificial Intelligence
      3. Back-End Development
      4. Databases
      5. Front-End Development
      6. Libraries & Frameworks
      7. Machine Learning
      8. Security
      9. Software Engineering
      10. Tools & IDEs
      11. Web Design
      12. Web Development
      13. Web Security
      14. Programming Languages
        • PHP
        • JavaScript
      Featured

      The Intersection of Agile and Accessibility – A Series on Designing for Everyone

      July 22, 2025
      Recent

      The Intersection of Agile and Accessibility – A Series on Designing for Everyone

      July 22, 2025

      Zero Trust & Cybersecurity Mesh: Your Org’s Survival Guide

      July 22, 2025

      Execute Ping Commands and Get Back Structured Data in PHP

      July 22, 2025
    • Operating Systems
      1. Windows
      2. Linux
      3. macOS
      Featured

      A Tomb Raider composer has been jailed — His legacy overshadowed by $75k+ in loan fraud

      July 22, 2025
      Recent

      A Tomb Raider composer has been jailed — His legacy overshadowed by $75k+ in loan fraud

      July 22, 2025

      “I don’t think I changed his mind” — NVIDIA CEO comments on H20 AI GPU sales resuming in China following a meeting with President Trump

      July 22, 2025

      Galaxy Z Fold 7 review: Six years later — Samsung finally cracks the foldable code

      July 22, 2025
    • Learning Resources
      • Books
      • Cheatsheets
      • Tutorials & Guides
    Home»News & Updates»CodeSOD: Message Oriented Database

    CodeSOD: Message Oriented Database

    April 15, 2025

    Mark was debugging some database querying code, and got a bit confused about what it was actually doing. Specifically, it generated a query block like this:

    $statement="declare @status int
            declare @msg varchar(30)
            exec @status=sp_doSomething 'arg1', ...
            select @msg=convert(varchar(10),@status)
            print @msg
            ";
    
    $result = sybase_query ($statement, $this->connection);
    

    Run a stored procedure, capture its return value in a variable, stringify that variable and print it. The select/print must be for debugging, right? Leftover debugging code. Why else would you do something like that?

    if (sybase_get_last_message()!=='0') {
        ...
    }
    

    Oh no. sybase_get_last_message gets the last string printed out by a print statement. This is a pretty bonkers way to get the results of a function or procedure call back, especially when if there are any results (like a return value), they’ll be in the $result return value.

    Now that said, reading through those functions, it’s a little unclear if you can actually get the return value of a stored procedure this way. Without testing it myself (and no, I’m not doing that), we’re in a world where this might actually be the best way to do this.

    So I’m not 100% sure where the WTF lies. In the developer? In the API designers? Sybase being TRWTF is always a pretty reliable bet. I suppose there’s a reason why all those functions are listed as “REMOVED IN PHP 7.0.0”, which was was rolled out through 2015. So at least those functions have been dead for a decade.

    [Advertisement]
    Keep the plebs out of prod. Restrict NuGet feed privileges with ProGet. Learn more.

    Source: Read More 

    Facebook Twitter Reddit Email Copy Link
    Previous Article11 Vibe Coding Tools to 10x Your Development on Linux Desktop
    Next Article A Coding Guide to Build a Finance Analytics Tool for Extracting Yahoo Finance Data, Computing Financial Analysis, and Creating Custom PDF Reports

    Related Posts

    News & Updates

    The best CRM software with email marketing in 2025: Expert tested and reviewed

    July 22, 2025
    News & Updates

    This multi-port car charger can power 4 gadgets at once – and it’s surprisingly cheap

    July 22, 2025
    Leave A Reply Cancel Reply

    For security, use of Google's reCAPTCHA service is required which is subject to the Google Privacy Policy and Terms of Use.

    Continue Reading

    CVE-2025-47676 – Faiyaz Alam User Login History Stored Cross-site Scripting

    Common Vulnerabilities and Exposures (CVEs)

    Subject-Driven Image Evaluation Gets Simpler: Google Researchers Introduce REFVNLI to Jointly Score Textual Alignment and Subject Consistency Without Costly APIs

    Machine Learning

    CVE-2016-15043 – WordPress WP Mobile Detector Arbitrary File Upload Vulnerability

    Common Vulnerabilities and Exposures (CVEs)

    Devman Claims Cyberattack on Thailand Ministry of Labour, Demands $15M Ransom

    Security

    Highlights

    CVE-2025-5367 – “PHPGurukul Online Shopping Portal SQL Injection Vulnerability”

    May 31, 2025

    CVE ID : CVE-2025-5367

    Published : May 31, 2025, 2:15 a.m. | 3 hours, 27 minutes ago

    Description : A vulnerability was found in PHPGurukul Online Shopping Portal Project 1.0. It has been declared as critical. This vulnerability affects unknown code of the file /category.php. The manipulation of the argument Product leads to sql injection. The attack can be initiated remotely. The exploit has been disclosed to the public and may be used.

    Severity: 7.3 | HIGH

    Visit the link for more details, such as CVSS details, affected products, timeline, and more…

    CVE-2025-42964 – SAP NetWeaver Enterprise Portal Remote Code Execution Vulnerability

    July 7, 2025

    CVE-2025-48389 – FreeScout Deserialization Vulnerability (Arbitrary Code Execution)

    May 29, 2025

    iOS and Android juice jacking defenses have been trivial to bypass for years

    April 28, 2025
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.