Jump to content

Search the Community

Showing results for tags 'stored procedures'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 3 results

  1. Hi, I have an adverts table that has records of currently running adverts, i have not used stored procedures or triggers before. I would like to create a stored procedure or a trigger using phpmyadmin for mysql. Exactly what i want to achieve is, when a record is accessed in adverts table, it causes a table called HITS to create a record that has the adverts_id, IP where the advert was clicked from, current date. Is that possible?
  2. I'm trying to pass a NULL to a stored procedure in a PHP script to MySQL, and I am scrubbing the variables using mysql_real_escape_string, but the NULLs that are passed are giving me problems. My script should look like this: call spMyStoredProc(1,2,NULL,'username'); but unfortunately I get: call spMyStoredProc(1,2,,'username'); I am wondering if I want to move away from using mysql_real_escape_string, and possibly write my own function? Anybody have any ideas? thanks, Frank C
  3. Hello guys, I am building an application where I am using a stored procedure in MySQL. In this stored procedure, some errors can occur, such as duplicate entry on a unique column. This would give an error with the code 1062. My question is if I should be checking on this code in my application like below or use signalling in the database (or something else). try { // Call stored procedure } catch (Exception $e) { if ($e->getCode() == 1062) { // Duplicate entry } } The above is convenient because it allows me to easily determine what went wrong so I can either log it or give the user a precise error message. My worry is that the error code (1062 in this example) is specific to MySQL, so if I were to change database vendor in the future, I would have to refactor my application (update error codes) and my stored procedures. It is unlikely that I will change vendor, but I like to build my application to support future changes. Alternatively, I believe that I could use signalling in my stored procedure. That is, if I detect an error 1062, I can signal an error with my own error code. This allows me to create error codes that are independent of my database vendor, such that if I were to change vendor, all I would have to do would be to change my stored procedure and thus leave my application intact (hopefully). The idea is that I could use error codes that are not already used by the various vendors. I have not checked which ranges are available yet. Perhaps there are other ways to go about it. I would love to hear your thoughts on this. Thanks, Andy
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.