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

      Sunshine And March Vibes (2025 Wallpapers Edition)

      June 2, 2025

      The Case For Minimal WordPress Setups: A Contrarian View On Theme Frameworks

      June 2, 2025

      How To Fix Largest Contentful Paint Issues With Subpart Analysis

      June 2, 2025

      How To Prevent WordPress SQL Injection Attacks

      June 2, 2025

      How Red Hat just quietly, radically transformed enterprise server Linux

      June 2, 2025

      OpenAI wants ChatGPT to be your ‘super assistant’ – what that means

      June 2, 2025

      The best Linux VPNs of 2025: Expert tested and reviewed

      June 2, 2025

      One of my favorite gaming PCs is 60% off right now

      June 2, 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

      `document.currentScript` is more useful than I thought.

      June 2, 2025
      Recent

      `document.currentScript` is more useful than I thought.

      June 2, 2025

      Adobe Sensei and GenAI in Practice for Enterprise CMS

      June 2, 2025

      Over The Air Updates for React Native Apps

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

      You can now open ChatGPT on Windows 11 with Win+C (if you change the Settings)

      June 2, 2025
      Recent

      You can now open ChatGPT on Windows 11 with Win+C (if you change the Settings)

      June 2, 2025

      Microsoft says Copilot can use location to change Outlook’s UI on Android

      June 2, 2025

      TempoMail — Command Line Temporary Email in Linux

      June 2, 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

    How Red Hat just quietly, radically transformed enterprise server Linux

    June 2, 2025
    News & Updates

    OpenAI wants ChatGPT to be your ‘super assistant’ – what that means

    June 2, 2025
    Leave A Reply Cancel Reply

    Continue Reading

    H-DPO: Advancing Language Model Alignment through Entropy Control

    Development

    CVE-2025-48844 – QNAP NAS Denial of Service

    Common Vulnerabilities and Exposures (CVEs)

    ‘Ninja Gaiden 2 Black’ highlights a major on-going issue with Xbox / PC Game Pass

    News & Updates

    CVE-2025-46580 – GoldenDB Database Information Disclosure and Privilege Escalation Vulnerability

    Common Vulnerabilities and Exposures (CVEs)

    Highlights

    Web Development

    Exploring the Essential Types of Enterprise Software for Modern Businesses

    March 20, 2025

    Enterprise software plays a crucial role in modern businesses, helping organizations streamline operations, enhance decision-making,…

    Researchers Warn of CatDDoS Botnet and DNSBomb DDoS Attack Technique

    May 28, 2024

    QTerminal – lightweight Qt-based terminal emulator

    January 16, 2025

    ZeniMax Media quality assurance workers reach tentative contract with Microsoft after almost two years

    May 30, 2025
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

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