Thread Rating:
  • 3 Vote(s) - 3.67 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[TUT] Include mySQL into php.
#14
Also to avoid exceptions to be trow en you need to use
try catch finally commands while executing query on the mysql database
example
if you want to make update query and user forgot to enter value for the set something='.var.'
then exception will be trown so you should use this command structure
Code:
<?php

try {

$s = mysql_query('Update ...... set..... Select or anything');
}
catch (MyException $e){
echo $e;
}
finaly {
echo 'query executed succesfully';
}
?>

here is more info about php exceptions and how to use them for anything not just for mysql
http://php.net/manual/en/language.exceptions.php
Reply


Messages In This Thread
[TUT] Include mySQL into php. - by MyNameIs940 - 10-04-2009, 08:51 PM
RE: [TUT] Include mySQL into php. - by FBI - 10-05-2009, 09:44 AM
RE: [TUT] Include mySQL into php. - by xiofire - 10-05-2009, 05:30 PM
RE: [TUT] Include mySQL into php. - by wat - 12-21-2009, 01:21 PM
RE: [TUT] Include mySQL into php. - by immi - 10-06-2009, 08:48 AM
RE: [TUT] Include mySQL into php. - by xiofire - 10-06-2009, 02:29 PM
RE: [TUT] Include mySQL into php. - by GizSho - 10-07-2009, 03:20 PM
RE: [TUT] Include mySQL into php. - by El Zorro - 10-08-2009, 03:34 PM
RE: [TUT] Include mySQL into php. - by HuNt3R - 10-08-2009, 06:07 PM
RE: [TUT] Include mySQL into php. - by Legion - 10-09-2009, 02:11 PM
RE: [TUT] Include mySQL into php. - by manipulate - 12-17-2009, 03:53 AM
RE: [TUT] Include mySQL into php. - by Extasey - 12-17-2009, 03:58 AM
RE: [TUT] Include mySQL into php. - by spiro_dt - 12-17-2009, 10:57 AM
RE: [TUT] Include mySQL into php. - by Password - 01-15-2010, 10:19 AM
RE: [TUT] Include mySQL into php. - by Gaijin - 01-15-2010, 10:50 AM
RE: [TUT] Include mySQL into php. - by Password - 01-16-2010, 08:14 PM
RE: [TUT] Include mySQL into php. - by Gaijin - 01-16-2010, 08:28 PM
RE: [TUT] Include mySQL into php. - by Password - 01-17-2010, 02:07 AM
RE: [TUT] Include mySQL into php. - by Gaijin - 01-17-2010, 05:20 AM
RE: [TUT] Include mySQL into php. - by Password - 01-18-2010, 07:42 AM
RE: [TUT] Include mySQL into php. - by ShuTdown - 04-25-2010, 05:18 AM
RE: [TUT] Include mySQL into php. - by pers2981 - 09-09-2010, 06:17 PM
RE: [TUT] Include mySQL into php. - by Shirosaki. - 10-03-2010, 07:32 AM
RE: [TUT] Include mySQL into php. - by Arеs - 11-01-2010, 09:14 AM
RE: [TUT] Include mySQL into php. - by haphazard - 11-23-2010, 08:42 PM
RE: [TUT] Include mySQL into php. - by Preeminent - 11-24-2010, 04:40 AM
RE: [TUT] Include mySQL into php. - by Proof - 11-26-2010, 08:29 AM
RE: [TUT] Include mySQL into php. - by Bursihido - 12-11-2010, 04:15 PM
RE: [TUT] Include mySQL into php. - by Spafic - 12-12-2010, 12:41 AM
RE: [TUT] Include mySQL into php. - by ZxPwn420 - 12-21-2010, 11:39 PM
RE: [TUT] Include mySQL into php. - by nextlive - 12-25-2010, 10:47 AM
RE: [TUT] Include mySQL into php. - by Break - 01-05-2011, 11:49 AM
RE: [TUT] Include mySQL into php. - by Element - 02-26-2011, 02:49 PM
RE: [TUT] Include mySQL into php. - by spark™ - 04-25-2011, 12:02 AM
RE: [TUT] Include mySQL into php. - by harris21 - 04-26-2011, 07:13 AM
RE: [TUT] Include mySQL into php. - by hacker2012 - 05-24-2011, 10:06 PM
RE: [TUT] Include mySQL into php. - by Legit - 05-31-2011, 09:15 AM
RE: [TUT] Include mySQL into php. - by !LoL - 06-01-2011, 04:10 AM
RE: [TUT] Include mySQL into php. - by Strafeness - 01-14-2012, 04:45 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  vb6.0 + mysql Anurag.91 1 1,665 09-08-2012, 04:19 PM
Last Post: spesificrelax
  Creating and inserting data into a PHP and MySQL Database Peter L 9 4,068 03-24-2012, 10:49 AM
Last Post: Haxalot
  VB.NET MySql , Help please booterphhp 2 1,703 03-19-2012, 11:13 AM
Last Post: RainbowDashFTW
  MySQL (Innodb vs MyISAM) Omniscient 15 9,630 07-22-2011, 03:15 PM
Last Post: developer99
  MySQL question ImFocuzz 8 2,726 07-17-2011, 06:57 PM
Last Post: Pedo bear

Forum Jump:


Users browsing this thread: 5 Guest(s)