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

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

      June 4, 2025

      How To Fix Largest Contentful Paint Issues With Subpart Analysis

      June 4, 2025

      How To Prevent WordPress SQL Injection Attacks

      June 4, 2025

      Smashing Animations Part 4: Optimising SVGs

      June 4, 2025

      I test AI tools for a living. Here are 3 image generators I actually use and how

      June 4, 2025

      The world’s smallest 65W USB-C charger is my latest travel essential

      June 4, 2025

      This Spotlight alternative for Mac is my secret weapon for AI-powered search

      June 4, 2025

      Tech prophet Mary Meeker just dropped a massive report on AI trends – here’s your TL;DR

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

      Beyond AEM: How Adobe Sensei Powers the Full Enterprise Experience

      June 4, 2025
      Recent

      Beyond AEM: How Adobe Sensei Powers the Full Enterprise Experience

      June 4, 2025

      Simplify Negative Relation Queries with Laravel’s whereDoesntHaveRelation Methods

      June 4, 2025

      Cast Model Properties to a Uri Instance in 12.17

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

      My Favorite Obsidian Plugins and Their Hidden Settings

      June 4, 2025
      Recent

      My Favorite Obsidian Plugins and Their Hidden Settings

      June 4, 2025

      Rilasciata /e/OS 3.0: Nuova Vita per Android Senza Google, Più Privacy e Controllo per l’Utente

      June 4, 2025

      Rilasciata Oracle Linux 9.6: Scopri le Novità e i Miglioramenti nella Sicurezza e nelle Prestazioni

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

    I test AI tools for a living. Here are 3 image generators I actually use and how

    June 4, 2025
    News & Updates

    The world’s smallest 65W USB-C charger is my latest travel essential

    June 4, 2025
    Leave A Reply Cancel Reply

    Continue Reading

    October report 2024

    Development

    CVE-2025-4158 – PCMan FTP Server Buffer Overflow Vulnerability

    Common Vulnerabilities and Exposures (CVEs)

    Multi-Task Learning with Regression and Classification Tasks: MTLComb

    Development

    CVE-2025-5515 – TOTOLINK X2000R Command Injection Vulnerability

    Common Vulnerabilities and Exposures (CVEs)

    Highlights

    21 Best Free and Open Source DNS Servers

    March 19, 2025

    Domain Name System (DNS) is the internet’s directory service. We recommend the best free and…

    These XR glasses gave me a 120-inch screen to work with – and they’re surprisingly affordable

    April 3, 2025

    How the Change to TLS Certificate Lifetimes Will Affect Sitecore Projects (and How to Prepare)

    April 18, 2025

    Perficient Achieves AWS DevOps Competency

    June 4, 2024
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

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