bookmark_borderget database structure using PHP

I was facing problem to connect a mysql host, as it was only accepting connection from a specific server. But I need to know the database structure to design some report.

At last I have written a simple php code to print the table name along with the structure.

   mysql_connect("host_name","user","password") or die(mysql_error());
   mysql_select_db("database_name") or die(mysql_error());

   $result = mysql_query("SHOW TABLES;") or die(mysql_error());  

   while($row = mysql_fetch_array($result)){
 echo $row[0]; //print the table name
 $result2 = mysql_query("DESCRIBE ".$row[0].";") or die(mysql_error()); //get details schema for each table
 echo "<table border='1' width='70%'>";
 echo "<tr><td>Field</td><td>Type</td><td>Null</td><td>Key</td><td>Default</td><td>Extra</td>";
 while($row2 = mysql_fetch_array($result2)){
  for($i=0; $i<6; $i++){ 
   if($row2[$i] == "" || $row2[$i] == NULL){
    $row2[$i] = " ";
  echo "<tr>";
  echo "<td>".$row2[0]."</td><td>".$row2[1]."</td><td>".$row2[2]."</td><td>".$row2[3]."</td><td>".$row2[4]."</td><td>".$row2[5];
  echo "</tr>";
 echo "</table>"; 
 echo "<br/>";


Just change your database configuration then upload in your server. Browse the url and you must delete the file from server after get the structure. Be safe…

bookmark_borderflash/swf height width in CodeIgniter 1.6

In libraries/Upload.php

Edit the function is_image().

add the ‘application/x-shockwave-flash’ in $img_mimes

$img_mimes = array(

It simply allow set_image_properties function to read the height & width for flash.

//now this will not call for flash
if ( ! $this->is_image())

bookmark_borderWhich user remove my facebook application

To remove the user who remove your application from facebook automatically.

In the settings of the application,
“Can your application be added on Facebook?” set it yes.

Scroll down, you will get a Post-Remove URL input box.

Facebook will send data to the post remove url page about the user removing the application.
The post_remove.php example from my server.


//facebook lib
require_once 'fbclient/facebook.php';

//my database config
require_once 'config/config.php';

$appapikey = 'you_app_api_key';
$appsecret = 'your_app_secret_key';

$facebook = new Facebook($appapikey, $appsecret);
$user_id = $facebook->require_login();

$user = $facebook->get_loggedin_user();

if ($user != NULL && $facebook->fb_params['uninstall'] == 1)
  //The user has removed your app
  mysql_query("DELETE FROM users WHERE userid='$user_id'")  or die(mysql_error());


Creating Your First Application Facebook wiki
Post-Remove URL Facebook wiki

Today I got success to configure phpbb with wordpress.It will enable the phpbb registered user to login the wordpress blog (after get approve from admin) with same id and password.I tried with phpBB-2.0.22 and wordpress-2.2.1Simply after install both in a same database.create a connections.php in the includes directory of the phpbbconnections.php

<?php$con = mysql_connect(“localhost”,”your_username”,”your_password”);

if (!$con){die(‘Could not connect: ‘ . mysql_error());}mysql_select_db(“your_database”, $con);?>

edit includes/usercp_register.php of the phpbbaround 630 lines you will find some line like this

/ Get current date//$sql = “INSERT INTO ” . USERS_TABLE . ” (user_id, …);

Bellow this line add

// added by salahuddin66include_once(“connections.php”);

$query = “INSERT INTO wp_users (user_login, user_nicename, display_name, user_pass, user_email, user_registered) VALUES (‘” . str_replace(“‘”, “””, $username) . “‘, ‘” . str_replace(“‘”, “””, $username) . “‘, ‘”. str_replace(“‘”, “””, $username) . “‘, ‘” . str_replace(“‘”, “””, $new_password) . “‘, ‘” . str_replace(“‘”, “””, $email).”‘, NOW() )”;

if (!mysql_query($query,$con)){die(‘Error: ‘ . mysql_error());}

// finish added by salahuddin66

done..Now the users will register for the phpbb forum will also register for the wordpress blog automatically.To enable his wordpress account, wordpress admin need to give him approve/some role.

bookmark_borderBangla to Hex

Here is my Bangla to Hex converter using php and little ajax. Thanks to Mr. Jamil for giving me this idea.


<script type=”text/javascript” src=”ajax.js”> </script>
<div align=”center”><h1>Bangla HEX</h1></div>
<div align=”center”></div>
Input in UTF-8: <input type=”text” name=”input” onkeyup=”show(this.value)”>
<p>Hex: <span id=”txtHint”></span></p>


var xmlHttp

function show(str0)
if (xmlHttp==null)
alert (“Browser does not support HTTP Request”)
var url=”show.php”

function stateChanged()
if (xmlHttp.readyState==4 || xmlHttp.readyState==”complete”)

function GetXmlHttpObject()
var xmlHttp=null;
// Firefox, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
catch (e)
//Internet Explorer
xmlHttp=new ActiveXObject(“Msxml2.XMLHTTP”);
catch (e)
xmlHttp=new ActiveXObject(“Microsoft.XMLHTTP”);
return xmlHttp;





function unibin2hex($u) {
$k = mb_convert_encoding($u, ‘UCS-2LE’, ‘UTF-8’);

$position = 0;

$run = strlen($u)/3;

for($i=0; $i