Search Results

Search found 4 results on 1 pages for 'esq'.

Page 1/1 | 1 

  • Method with throws Exception: Where is it actually handled?

    - by Esq
    Here is an example code, I am throwing an exception here, it works perfectly fine without the try/catch block of code for some reason. Do I have to handle this inside this method "EntryDelete" or Do I have to handle this where the method is called from? If so can I see an example, what do I have to import in there? What is the acceptable syntax or method to do this? public boolean EntryDelete(int entryId) throws SQLException{ this.open(); kDatabase.delete(kENTRY_TABLE, kENTRY_ENTRY_ID + "=" + entryId, null); this.close(); return true; } Thanks

    Read the article

  • Connecting to external MySQL DB from a web server not running MySQL

    - by jrb04c
    While I've been working with MySQL for years, this is the first time I've run across this very newbie-esq issue. Due to a client demand, I must host their website files (PHP) on a IIS server that is not running MySQL (instead, they are running MSSQL). However, I have developed the site using a MySQL database which is located on an external host (Rackspace Cloud). Obviously, my mysql_connect function is now bombing because MySQL is not running on localhost. Question: Is it even possible to hit an external MySQL database if localhost is not running MySQL? Apologies for the rookie question, and many thanks in advance.

    Read the article

  • Email php isn't working, please help?

    - by laurence-benson
    Hey Guys, My email code isn't working, can anyone help? Thanks. <?php if(isset($_POST['send'])){ $to = "[email protected]" ; // change all the following to $_POST $from = $_REQUEST['Email'] ; $name = $_REQUEST['Name'] ; $headers = "From: $from"; $subject = "Web Contact Data"; $fields = array(); $fields{"Name"} = "Name"; $fields{"Email"} = "Email"; $body = "We have received the following information:\n\n"; foreach($fields as $a => $b){ $body .= sprintf("%20s: %s\n",$b,$_REQUEST[$a]); } $subject2 = "Thank you for contacting us."; $autoreply = "<html><body><p>Dear " . $name . ",</p><p>Thank you for registering with ERB Images.</p> <p>To make sure that you continue to receive our email communications, we suggest that you add [email protected] to your address book or Safe Senders list. </p> <p>In Microsoft Outlook, for example, you can add us to your address book by right clicking our address in the 'From' area above and selecting 'Add to Outlook Contacts' in the list that appears.</p> <p>We look forward to you visiting the site, and can assure you that your privacy will continue to be respected at all times.</p><p>Yours sincerely.</p><p>Edward R Benson</p><p>Edward Benson Esq.<br />Founder<br />ERB Images</p><p>www.erbimages.com</p></body></html>"; $headers2 = 'MIME-Version: 1.0' . "\r\n"; $headers2 .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers2 .= 'From: [email protected]' . "\r\n"; mail($from, $subject2, $autoreply, $headers2); $send=false; if($name == '') {$error= "You did not enter your name, please try again.";} else { if(!preg_match("/^[[:alnum:]][a-z0-9_.'+-]*@[a-z0-9-]+(\.[a-z0-9-]{2,})+$/",$from)) {$error= "You did not enter a valid email address, please try again.";} else { $send = mail($to, $subject, $body, $headers); $send2 = mail($from, $subject2, $autoreply, $headers2); } if(!isset($error) && !$send) $error= "We have encountered an error sending your mail, please notify [email protected]"; } }// end of if(isset($_POST['send'])) ?> <?php include("http://erbimages.com/php/doctype/index.php"); ?> <?php include("http://erbimages.com/php/head/index.php"); ?> <div class="newsletter"> <ul> <form method="post" action="http://lilyandbenson.com/newletter/index.php"> <li> <input size="20" maxlength="50" name="Name" value="Name" onfocus="if(this.value==this.defaultValue) this.value='';" onblur="if(this.value=='') this.value=this.defaultValue;"> </li> <li> <input size="20" maxlength="50" name="Email" value="Email" onfocus="if(this.value==this.defaultValue) this.value='';" onblur="if(this.value=='') this.value=this.defaultValue;"> </li> <li> <input type="submit" name="send" value="Send" id="register_send"> </li> </form> <?php ?> </ul> <div class="clear"></div> </div> <div class="section_error"> <?php if(isset($error)) echo '<span id="section_error">'.$error.'</span>'; if(isset($send) && $send== true){ echo 'Thank you, your message has been sent.'; } if(!isset($_POST['send']) || isset($error)) ?> <div class="clear"></div> </div> </body> </html>

    Read the article

1