flx = FlexGrid Name
Just set flx.row=0 and flx.col=0
Just set flx.row=0 and flx.col=0
Private Sub FlexToExcel() | ||||||
Dim xlObject As Excel.Application | ||||||
Dim xlWB As Excel.Workbook | ||||||
Set xlObject = New Excel.Application | ||||||
'This Adds a new woorkbook, you could open the workbook from file also | ||||||
Set xlWB = xlObject.Workbooks.Add | ||||||
Clipboard.Clear 'Clear the Clipboard | ||||||
With MSFlexGrid1 | ||||||
'Select Full Contents (You could also select partial content) | ||||||
.Col = 0 'From first column | ||||||
.Row = 0 'From first Row (header) | ||||||
.ColSel = .Cols - 1 'Select all columns | ||||||
.RowSel = .Rows - 1 'Select all rows | ||||||
Clipboard.SetText .Clip 'Send to Clipboard | ||||||
End With | ||||||
With xlObject.ActiveWorkbook.ActiveSheet | ||||||
.Range("A1").Select 'Select Cell A1 (will paste from here, to different cells) | ||||||
.Paste 'Paste clipboard contents | ||||||
End With | ||||||
' This makes Excel visible | ||||||
xlObject.Visible = True | ||||||
End Sub |
$db = mysqli_connect("localhost","root","","DbName"); //keep your db name
$image = addslashes(file_get_contents($_FILES['images']['tmp_name']));
//you keep your column name setting for insertion. I keep image type Blob.
$query = "INSERT INTO products (id,image) VALUES('','$image')";
$qry = mysqli_query($db, $query);
Akses Image dari BLOB :$db = mysqli_connect("localhost","root","","DbName"); //keep your db name $sql = "SELECT * FROM products WHERE id = $id"; $sth = $db->query($sql); $result=mysqli_fetch_array($sth);
echo '(img src="data:image/jpeg;base64,'.base64_encode( $result['image'] ).'"/)';
Change
$config['mailtype'] = 'html';
and use
or
Use double-quotes "
instead of single-quotes '
. This way the newline \n
will work.
"\n";
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class CIPHP extends CI_Controller {
function __construct(){
parent::__construct();
$this->load->library('phpmailer');
}
function send_email() {
$subject = 'Test Email';
$name = 'resta';
$email = 'resta_ok@yahoo.co.id';
$body = "body Message";
$this->phpmailer->AddAddress($email);
$this->phpmailer->IsMail();
$this->phpmailer->From = 'info@resta-ok.co.id';
$this->phpmailer->FromName = 'user name';
$this->phpmailer->IsHTML(true);
$this->phpmailer->Subject = $subject;
$this->phpmailer->Body = $body;
$this->phpmailer->Send();
}
}
Use
nl2br
$name = htmlspecialchars($_POST['name']);
$message = nl2br(htmlspecialchars($_POST['message']));
//begin of HTML message $message = <<<EOF Name:</b><br> {$name} Message:</b><br> {$message} </body> </html> EOF;