Tag Archives: php

PHP / MySql – Export Data to Excel

A PHP Script to export MySql data to Excel.


<!--?php
$content=””;

if($_REQUEST[‘export’])
{


$select= "select user_id,email,fname,lname,bdate,fees from user order by fname";
$result = mysql_query($select);
$num_row = mysql_num_rows($result);
Continue reading

Advertisements

PHP : Resize embedded video

$video = stripslashes($embedded_video_code);

$video = preg_replace('~(]*width\s?=\s?["\'])[^"\']+(["\'])~i', '${1}300${2}', $video);

$video = preg_replace('~(]*height\s?=\s?["\'])[^"\']+(["\'])~i', '${1}200${2}', $video);

Joomla : How to remove Phoca Gallery footer?

In Joomla, Phoca Gallery does not give the option in the administration, whether you want to keep Phoca Gallery copyright information in footer or not.
For this you have to edit the code as follows.

Open following PHP file.

SITE_URL\components\com_phocagallery\views\category\tmpl\default.php


Remove the last line

PhocaGalleryUtils::footer();


Very simple.. isn’t it..?

PHP : Create array from MySql recordset

This PHP code is to create array from MySql record set.

<?php
$sel=”SELECT * FROM table_name”;
$rs=mysql_query($sel);
$i=0;
while ($row = mysql_fetch_assoc($rs))
{
$array[$i] = $row;
$i++;
}
?>