SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict
    Join Date
    Sep 2006
    Posts
    238
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    display message after mysql insert

    Hi,

    How do I display a message after a mysql insert? e.g

    if INSERT success
    display "Success"

    if INSERT failed
    display "Failed"

  2. #2
    Twitter: @AnthonySterling silver trophy AnthonySterling's Avatar
    Join Date
    Apr 2008
    Location
    North-East, UK.
    Posts
    6,111
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Code PHP:
    <?php
    if(mysql_query($query))
    {
        echo 'Yay, we persisted that mofo';
    }
    else
    {
        echo 'Dammit, the server lost your data whilst mocking us with ' . mysql_error();
    }
    @AnthonySterling: I'm a PHP developer, a consultant for oopnorth.com and the organiser of @phpne, a PHP User Group covering the North-East of England.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •