Search

Alves Singh

Month

February 2012

How to reuse the resulted variable after executing a mysql query

$query = “SELECT * FROM tablename WHERE 1”;
$result = mysql_query($query);

while($row = mysql_fetch_array($result))
{
// Here you can use the $row 
}

// PHP Statment
// PHP Statment
// PHP Statment
// Again if you want to use the same $result variable. Then no need to Execute Query again just put the below function and you can use it again

mysql_data_seek($result,0);
while($ors = mysql_fetch_array($result)) 
{
// Here you can use the $row 
}

// PHP Statment
// PHP Statment
// PHP Statment
// Again if you want to use the same $result variable. Then no need to Execute Query again just put the below function and you can use it again

mysql_data_seek($result,0);
while($ors = mysql_fetch_array($result)) 
{
// Here you can use the $row 
}

Facebook Share Button

<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN”>
<html>

<head>
<title>Facebook Share Button – External Website</title>

<style type=”text/css”>

body {
background:#f5f5f5;
font: 14px/150% ‘century gothic’,helvetica,arial;
}

#container {
margin:5px auto;
padding:25px;
width:400px;
border:1px solid #999;
border-radius:8px; -moz-border-radius:8px; -webkit-border-radius:8px;
background:#fff;
}
</style>

</head>

<body>

<div id=”container”>

<p>Below is an example of the “classic” Facebook Share Button on a non-Facebook Web page.</p>

<div id=”fb-root”></div>

<!– USE ‘Asynchronous Loading’ version, for IE8 to work
http://developers.facebook.com/docs/reference/javascript/FB.init/ –>

<script>
window.fbAsyncInit = function() {
FB.init({
appId  : ‘173102622756584’,
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml  : true  // parse XFBML
});
};

(function() {
var e = document.createElement(‘script’);
e.src = document.location.protocol + ‘//connect.facebook.net/en_US/all.js’;
e.async = true;
document.getElementById(‘fb-root’).appendChild(e);
}());
</script>

<script src=”http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js&#8221; type=”text/javascript”></script>

<img id = “share_button” src = “http://app.tabpress.com/fbui_share/share_button.png”&gt;

<script type=”text/javascript”>
$(document).ready(function(){
$(‘#share_button’).click(function(e){
e.preventDefault();
FB.ui(
{
method: ‘feed’,
name: ‘HyperArts Blog’,
link: ‘http://hyperarts.com/blog&#8217;,
picture: ‘http://www.hyperarts.com/_img/TabPress-LOGO-Home.png&#8217;,
caption: ‘I love HyperArts tutorials’,
description: ‘The HyperArts Blog provides tutorials for all things Facebook’,
message: ”
});
});
});
</script>

</div>

</body>
</html>

Create a free website or blog at WordPress.com.

Up ↑