Jump to content

Checking Updated records in PHP an mySQL

Featured Replies

Anyone knows how I can make sure a record is actually inserted properly into the mySQL database through PHP ?

 

I remember there's something like "Records Affected" in ASP but I have no idea what it is in PHP, so far i'm doing it in the long and idiotic way of extracting them from the DB again to make sure its inserted properly ...

 

anyone ?

 

~moo

Most things in PHP return TRUE or FALSE when they succeed or fail.

 

You can if( ) that returned value and, based on the results, echo a message like "records inserted" or "update failed! :-(".

  • Author

yeah Sayo, but I'm trying to find the WAY to find if they were inserted correctly or not, not the way to present them to my users.

 

But yeah its a good idea to do in general as a debugging tool.

 

Thanks Dave!!! I'll go check it out.

 

:)

 

 

btw did you know PHP's origin is israel, and that's why it has a few special Hebrew commands (like something like hebdevc() or something like that)... is that cool or WHAT! ha, I'm probly the only hebrew speaking person here so I'm prtobly the only one who finds it kool.. but still :P

 

hehe thanks guys :)

 

~moo

I understand what you're trying to do - checking if a routine returns true or false is incredibly versatile (and good for providing an alternative route if something critical can't complete!).

Archived

This topic is now archived and is closed to further replies.

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.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.