vibhaJ 126 Master Poster

Usually when you install WAMP, mysql is automatically configured.You don't need extra efforts.
After successful installation when you open http://localhost/phpmyadmin you can see phpmyadmin window.
Try to reinstall wamp.

vibhaJ 126 Master Poster

Yes i do understand your point.
You have included file using require and your loading time is showing in minus for some reason.I think require should not create any issue. Posted link was just for sharing.
Can you post your php code for review?

vibhaJ 126 Master Poster
vibhaJ 126 Master Poster

MySQL is a relational database management system.
Phpmyadmin is just a user interface with mysql.
There are some software based tool like Workbench, SQLyog, Mysql query browser and some web based application like phpmyadmin.

vibhaJ 126 Master Poster

Loading time is not fixed every time.
It may differ. check this for any site.

vibhaJ 126 Master Poster

Your code is right.
Are you facing any error?

vibhaJ 126 Master Poster

You can use 'selected' for that.
Check below code you will understand.

<select name="selectbox">
<option value="">- - Select - -</option>
<option value="Computer">Computer</option>
<option value="Hello" selected="selected">Hello</option>
<option value="World">World</option>
</select>
vibhaJ 126 Master Poster

Frankly speaking i hate reg expression, because its output is also unpredictable and we cant debug it.
I always used to google it and use it.
I found it here http://php.net/manual/en/function.preg-match-all.php#allnotes

vibhaJ 126 Master Poster

Try this.

<?
	$replaced_content = " abcs is here {blog:vibhadevit} mnop dsgdh 3535 {blog:computer} after blog content";
	preg_match_all('/{blog:[A-Za-z0-9_]+}/', $replaced_content, $matches, PREG_SET_ORDER);
	echo '<pre>';
	print_r($matches);
?>
vibhaJ 126 Master Poster
dalip_007 commented: excellent +3
vibhaJ 126 Master Poster

Here is a code for exporting table to csv.

<?
	mysql_connect('localhost','root','');
	mysql_select_db('test');
	
	$sql = "select student_name,student_sirname from student";

	// Query Database	
	$filename = 'file.csv';		
	$rsSearchResults = mysql_query($sql) or die(mysql_error());
	
	$out = '';
	
	// fiels to export
	$out .='Student Name,Sirname';
	$out .="\n";
	
	// Add all values in the table
	while ($l = mysql_fetch_array($rsSearchResults)) {
	for ($i = 0; $i < 2; $i++) {
	$out .=''.$l["$i"].',';
	}
	$out .="\n";
	}
	// Output to browser with appropriate mime type
	header("Content-type: text/x-csv");	
	header("Content-Disposition: attachment; filename=$filename");
	echo $out;
	exit;	
?>
vibhaJ 126 Master Poster

As kartik said you only need to run query part in phpmyadmin, not PHP.

vibhaJ 126 Master Poster

As i asked you before your php open tag seems closed. Try below code.

<?php error_reporting(E_ALL);?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<?php
	/* CREATE TABLE `tbl_hindi` (
	  `data` varchar(1000) character set utf8 collate utf8_bin default NULL
	) ENGINE=InnoDB DEFAULT CHARSET=latin1;
	
	INSERT INTO `tbl_hindi` VALUES ('कंप्यूटर'); */
	
	mysql_connect('localhost','root','');
	mysql_select_db('test');	
	
	mysql_query('SET character_set_results=utf8');
	mysql_query('SET names=utf8');
	mysql_query('SET character_set_client=utf8');
	mysql_query('SET character_set_connection=utf8');
	mysql_query('SET character_set_results=utf8');
	mysql_query('SET collation_connection=utf8_general_ci');
	
	if(isset($_POST['save']))
	{
		$sql = "insert into tbl_hindi values ('".$_POST['data']."')";
		mysql_query($sql);
		echo '<br />Data inserted successfully.<br />';
	}
	
	$sql = "select * from tbl_hindi";
	$res = mysql_query($sql);		
		
?>
<form  method="post">
<table width="900%" border="0">
  <tr>
    <td>Add New : <input type="text" name="data" size="20" />
<input type="submit" name="save" value="Save" /></td>
  </tr>
  <tr>
    <td>-----------------------------</td>
  </tr>
  <tr>
    <td><strong>Hindi Data</strong></td>
  </tr>
  <?php while($sar = mysql_fetch_assoc($res)) { ?>
  <tr>
    <td><?php echo $sar['data'];?></td>
  </tr>
  <?php } ?>
</table>
</form>
</body>
</html>
vibhaJ 126 Master Poster

I was also facing so many issues for mail attachment.
Finally i end up with this.
I have made this function, hope this helps you.

<?php

	//=======================================
	//   mail sending start
	//=======================================
		$to = 'vibha@domainname.com';
		$fromName = 'Administrator';
		$fromEmail = 'admin@domainname.com';
		$subject = 'Subjest is here';		
		$message = 'Message is here..Message is here..Message is here......Message is here';
		$template = 'demo.tpl';				
		$files = array('demo.txt','demo.xlsx');		
		if(sendEmail($to,$fromName,$fromEmail,$subject,$message,$cc='',$bcc='',$files))
			echo 'Mail successfully sent.';
		else
			echo 'Mail sending failed.';
	//=======================================
	//   mail sending end
	//=======================================	


function sendEmail($to,$fromName,$fromEmail,$subject,$message,$cc='',$bcc='',$files=array(),$debug=false)
{
	// starting of headers
	$headers = 'From: '.$fromName.' <'.$fromEmail.'>';
	if($cc != '')
		$headers .= "\r\nCc: ". $cc;
	if($bcc != '')
		$headers .= "\r\nBcc: ". $bcc;
		
	// boundary 
	$semi_rand = md5(time()); 
	$mime_boundary = "==Multipart_Boundary_x{$semi_rand}x"; 
	 
	// headers for attachment 
	$headers .= "\nMIME-Version: 1.0\n" . "Content-Type: multipart/mixed;\n" . " boundary=\"{$mime_boundary}\""; 
	 
	// multipart boundary 
	$message = "This is a multi-part message in MIME format.\n\n" . "--{$mime_boundary}\n" . "Content-Type: text/html; charset=\"iso-8859-1\"\n" . "Content-Transfer-Encoding: 7bit\n\n" . $message . "\n\n"; 
	if(count($files))
		$message .= "--{$mime_boundary}\n";
	 
	// preparing attachments
	for($x=0;$x<count($files);$x++)
	{
		$file = fopen($files[$x],"rb");
		$data = fread($file,filesize($files[$x]));
		fclose($file);
		$data = chunk_split(base64_encode($data));
		$message .= "Content-Type: {\"application/octet-stream\"};\n" . " name=\"$files[$x]\"\n" . 
		"Content-Disposition: attachment;\n" . " filename=\"$files[$x]\"\n" . 
		"Content-Transfer-Encoding: base64\n\n" . $data . "\n\n";
		if($x < (count($files)-1))
			$message .= "--{$mime_boundary}\n";
		else
			$message .= "--{$mime_boundary}--\n";	
		
	}
		
	if($debug)
	{
		echo '<br />$to: '.$to;
		echo '<br />$fromName: '.$fromName;
		echo '<br />$fromEmail: '.$fromEmail;
		echo '<br />$subject: '.$subject;
		echo '<br />$message: '.$message;
		echo '<br />$cc: '.$cc;
		echo '<br />$bcc: '.$bcc;
		echo '<br />$file: '.print_r($file);		
	}
	
	if(mail($to, $subject, $message, $headers))
	{		
		return true;
	} …
vibhaJ 126 Master Poster
vibhaJ 126 Master Poster

Try this.

RewriteEngine On                          
RewriteRule ^([^/]+)$ /index.php?url=$1 [L]
RewriteRule ^/article/([^/]+)$ /index.php?url=$1&type=news [L]
vibhaJ 126 Master Poster

Can you use your login credentials in below code and post output.
Because i think there is something wrong in credentials only.

<?php

$db_host = "localhost";
$db_user = "root";
$db_password = "";
$db_database = "db_name"

$link = mysql_connect($db_host, $db_user, $db_password);
if (!$link) {
    die('Not connected : ' . mysql_error());
}

// make foo the current db
$db_selected = mysql_select_db($db_database, $link);
if (!$db_selected) {
    die ('Db selection error : ' . mysql_error());
}

?>
lovell_82 commented: great help +1
vibhaJ 126 Master Poster

With form ...

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<?
	/* CREATE TABLE `tbl_hindi` (
	  `data` varchar(1000) character set utf8 collate utf8_bin default NULL
	) ENGINE=InnoDB DEFAULT CHARSET=latin1;
	
	INSERT INTO `tbl_hindi` VALUES ('कंप्यूटर'); */
	
	mysql_connect('localhost','root','');
	mysql_select_db('test');	
	
	mysql_query('SET character_set_results=utf8');
	mysql_query('SET names=utf8');
	mysql_query('SET character_set_client=utf8');
	mysql_query('SET character_set_connection=utf8');
	mysql_query('SET character_set_results=utf8');
	mysql_query('SET collation_connection=utf8_general_ci');
	
	if(isset($_POST['save']))
	{
		$sql = "insert into tbl_hindi values ('".$_POST['data']."')";
		mysql_query($sql);
	}
	
	$sql = "select * from tbl_hindi";
	$res = mysql_query($sql);		
		
?>
<form  method="post">
<table width="900%" border="0">
  <tr>
    <td>Add New : <input type="text" name="data" size="20" />
<input type="submit" name="save" value="Save" /></td>
  </tr>
  <tr>
    <td>-----------------------------</td>
  </tr>
  <tr>
    <td><strong>Hindi Data</strong></td>
  </tr>
  <? while($sar = mysql_fetch_assoc($res)) { ?>
  <tr>
    <td><?=$sar['data'];?></td>
  </tr>
  <? } ?>
</table>
</form>
</body>
</html>
diafol commented: nice one - like it +13
vibhaJ 126 Master Poster

Post complete loop code.
There should be something wrong in loop only.

vibhaJ 126 Master Poster

Okay dude..
This is with form code.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<?
	mysql_connect('localhost','root','');
	mysql_select_db('test');	
	
	mysql_query('SET character_set_results=utf8');
	mysql_query('SET names=utf8');
	mysql_query('SET character_set_client=utf8');
	mysql_query('SET character_set_connection=utf8');
	mysql_query('SET character_set_results=utf8');
	mysql_query('SET collation_connection=utf8_general_ci');
	
	if(isset($_POST['save']))
	{
		$sql = "insert into tbl_hindi values ('".$_POST['data']."')";
		mysql_query($sql);
	}
	
	$sql = "select * from tbl_hindi";
	$res = mysql_query($sql);		
		
?>
<form  method="post">
<table width="900%" border="0">
  <tr>
    <td>Add New : <input type="text" name="data" size="20" />
<input type="submit" name="save" value="Save" /></td>
  </tr>
  <tr>
    <td>-----------------------------</td>
  </tr>
  <tr>
    <td><strong>Hindi Data</strong></td>
  </tr>
  <? while($sar = mysql_fetch_assoc($res)) { ?>
  <tr>
    <td><?=$sar['data'];?></td>
  </tr>
  <? } ?>
</table>
</form>
</body>
</html>
dalip_007 commented: fabulous , awsome , thanks +3
vibhaJ 126 Master Poster

I have tried with following php code to insert hindi data.
And also using phpmyadmin tab.

<?
	mysql_connect('localhost','root','');
	mysql_select_db('test');
	
	mysql_query('SET character_set_results=utf8');
	mysql_query('SET names=utf8');
	mysql_query('SET character_set_client=utf8');
	mysql_query('SET character_set_connection=utf8');
	mysql_query('SET character_set_results=utf8');
	mysql_query('SET collation_connection=utf8_general_ci');
	
	$sql = "insert into tbl_hindi values ('कंप्यूटर कंप्यूटर ')";
	mysql_query($sql);
	
	$sql = "select * from tbl_hindi";
	$res = mysql_query($sql);
	while($sar = mysql_fetch_assoc($res))
	{		
		print_r($sar);
	}
?>
vibhaJ 126 Master Poster

Below is mysql code.

CREATE TABLE `tbl_hindi` (
  `data` varchar(1000) character set utf8 collate utf8_bin default NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

INSERT INTO `tbl_hindi` VALUES ('कंप्यूटर');

Below is PHP code

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<?
	mysql_connect('localhost','root','');
	mysql_select_db('test');
	mysql_query("SET NAMES utf8"); 
	
	$sql = "select * from tbl_hindi";
	$res = mysql_query($sql);
	$sar = mysql_fetch_assoc($res);
	echo $sar['data'];
?>
</body>
</html>

I didnt get why this is not working for you.
See attached image, it works for me.

vibhaJ 126 Master Poster

Your loop is messy.
This code shows simple looping for showing data in tabular form.

<?php
 $username="root";
 $password="";
 $database="";

 mysql_connect('localhost',$username,$password);
 @mysql_select_db($database) or die( "Unable to select database");
 $query="SELECT * FROM jokes";
 $result=mysql_query($query);

 echo '<table width="900%" border="0">';
 while($sar = mysql_fetch_assoc($result))
 {
 	echo '<tr>
    <td>'.$sar['name'].'</td>
    <td>'.$sar['content'].'</td>
  </tr>';
 }
 echo '</table>';
 mysql_close();
 ?>
vibhaJ 126 Master Poster

Firstly you need to log some table data to compare in future.
Lets say primary key of table.
Create one table table_log which will have all primary key.

tbl_log:
id primary_key datetime
1 12,13,14,16,19,20,21 timestamp
2 12,13,14,19,20,21,22,23 timestamp

Now make one php script which will be set in cron job.
Task of php script is as below:
It takes last entry from table_log and export primary_key by ','
Then make a loop to compare with existing table primary_key.
Based on that you can check whether record is deleted or added and you can make an email for that.
Lastly take all primary key from you table and implode it and insert into table table_log for next compare.

vibhaJ 126 Master Poster

Sorry last attachment was incorrect.

vibhaJ 126 Master Poster

Try this demo code.
See attached output image.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title>Google Maps JavaScript API Example</title>    
    <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAwoZubRYDwEsxPfeOl798iRS9zaDN-rzK-R-PNcf5yAaJ9r7Z4BTy9LU9DUBfJ7r-F6C7tX-2AidMHQ&sensor=true"
            type="text/javascript"></script>
    <script type="text/javascript">

    function initialize() 
	{
      if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById("map_canvas"));
        map.setCenter(new GLatLng(23.005, 72.5959), 15);
        map.setUIToDefault(); // will add top menu,left menu etc	
		
		var new_icon = new GIcon();  
		new_icon.image = "images/car_blue.png" ;
		new_icon.size = new GSize(16,16) ; 
		new_icon.iconAnchor = new GPoint(6, 20);
		new_icon.infoWindowAnchor = new GPoint(5,1)  ;		
		var marker = new GMarker(new GLatLng(23.005, 72.5959), new_icon);
		map.addOverlay(marker);
		}		
	}
	 </script>
  </head>
  <body onload="initialize()" onunload="GUnload()">
    <div id="map_canvas" style="width: 700px; height: 500px"></div>
  </body>
</html>
karthik_ppts commented: helpful post +3
vibhaJ 126 Master Poster

Can you give live link if possible?

vibhaJ 126 Master Poster

Can you replace your code with this.
Also make sure image exists in given path.

var new_icon = new GIcon();  
new_icon.image = "images/car_blue.png" ;
new_icon.size = new GSize(16,16) ; 
new_icon.iconAnchor = new GPoint(6, 20);
new_icon.infoWindowAnchor = new GPoint(5,1)  ;

var marker = new GMarker(point, new_icon);
map.addOverlay(marker);
vibhaJ 126 Master Poster

Replace this much code and check whether all three values are coming correct or not.
If its correct that means code is right and problem is in mysql credentials.

function DBLogin()
{
echo '--host--'.$this->db_host.'--username--'.$this->username.'--pwd--'.$this->pwd;
$this->connection = mysql_connect($this->db_host,$this->username,$this->pwd);
vibhaJ 126 Master Poster

Here is a code for date difference you can use $days and save it in your database.

<?
	$duedate = '2011-04-29';
	$currdate = date('Y-m-d');
	
	$date1 = $duedate;
	$date2 = $currdate;
	
	$diff = abs(strtotime($date2) - strtotime($date1));
	
	$years = floor($diff / (365*60*60*24));
	$months = floor(($diff - $years * 365*60*60*24) / (30*60*60*24));
	$days = floor(($diff - $years * 365*60*60*24 - $months*30*60*60*24)/ (60*60*24));
	
	echo "Difference is $years years, $months months, $days days.";
?>
vibhaJ 126 Master Poster

What is the code to save the last url? Thanks!

This is the simplest way to save current page url.
<?
	$_SESSION['sess_currPageName'] = basename($_SERVER['PHP_SELF']).'?'.$_SERVER['QUERY_STRING'];
?>

Agree to ardav, i also prefer ajax than iframe.
As in ajax all controls are in your hand.

vibhaJ 126 Master Poster

If iframe's search page is your php code then you can make a session and save last url in that session.
When page is loaded or refreshed you can use session's remembered url as a src of iframe.

vibhaJ 126 Master Poster

Export your table structure and post it here.
I will give you code.

vibhaJ 126 Master Poster

This is because you may have incorrect data in query output.
comment all header lines and check mysql_fetch_row is returning proper output or not?
Also check all list function arguments.

while(list($name,$sirname)=mysql_fetch_row($result))
vibhaJ 126 Master Poster

This is simple code for exporting student table to excel.
Hope this helps you.

<?
	mysql_connect('localhost','root','');
	mysql_select_db('test');
	
	$sql = "select name,sirname from student";

	// Query Database
	$result=mysql_query($sql);
	$filename = 'file.xls';
		
	// Send Header
	header("Pragma: public");
	header("Expires: 0");
	header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
	header("Content-Type: application/force-download");
	header("Content-Type: application/octet-stream");
	header("Content-Type: application/download");;
	header("Content-Disposition: attachment;filename=$filename");
	header("Content-Transfer-Encoding: binary ");
	
	// XLS Data Cell
	
	xlsBOF();	  
	xlsWriteLabel(0,0,"Name : ");
	xlsWriteLabel(0,1,"Sirname :");
   
	$xlsRow = 1;
	while(list($name,$sirname)=mysql_fetch_row($result)) 
	{		
		++$i;
		xlsWriteLabel($xlsRow,0,"$name");
		xlsWriteLabel($xlsRow,1,"$sirname");                         
		$xlsRow++;
	}
	xlsEOF();
	exit();

function xlsBOF() {
    echo pack("ssssss", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);  
    return;
}

function xlsEOF() {
    echo pack("ss", 0x0A, 0x00);
    return;
}

function xlsWriteNumber($Row, $Col, $Value) {
    echo pack("sssss", 0x203, 14, $Row, $Col, 0x0);
    echo pack("d", $Value);
    return;
}

function xlsWriteLabel($Row, $Col, $Value ) {
    $L = strlen($Value);
    echo pack("ssssss", 0x204, 8 + $L, $Row, $Col, 0x0, $L);
    echo $Value;
return;
} 

?>
vibhaJ 126 Master Poster

Below is mysql code.

CREATE TABLE `tbl_hindi` (
  `data` varchar(1000) character set utf8 collate utf8_bin default NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

INSERT INTO `tbl_hindi` VALUES ('कंप्यूटर');

Below is PHP code

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<?
	mysql_connect('localhost','root','');
	mysql_select_db('test');
	mysql_query("SET NAMES utf8"); 
	
	$sql = "select * from tbl_hindi";
	$res = mysql_query($sql);
	$sar = mysql_fetch_assoc($res);
	echo $sar['data'];
?>
</body>
</html>
vibhaJ 126 Master Poster

Yup..
Your logic is absolutely right. :)

vibhaJ 126 Master Poster

If you dont want to use database then you can use one simple txt file for lock and unlock.
If master login add text in txt file as 'ON'. Make it 'OFF' when logout.
If slave login then read txt file, if it is 'ON' then only slave can login.

vibhaJ 126 Master Poster

I am still confused what is your exact requirement?
Why don't you directly write loop on index.php.
What is the use of all.php?

vibhaJ 126 Master Poster

Try this code.
It will print all php configuration.
So that you can check existing dlls.

<?php

// Show all information, defaults to INFO_ALL
phpinfo();

// Show just the module information.
// phpinfo(8) yields identical results.
phpinfo(INFO_MODULES);

?>
vibhaJ 126 Master Poster

Did it worked or not????

vibhaJ 126 Master Poster

THE complete code

<?php

include 'connect.php';

$arrQueryParts = array();
$arrQueryParts['Age'] = $_POST['AgeF']; 
$arrQueryParts['Sex'] = $_POST['SexF']; 
$arrQueryParts['Hair'] = $_POST['HairF']; 
$arrQueryParts['Dress'] = $_POST['DressF']; 

foreach($arrQueryParts as $key=>$value)
{ 
    $strVarName = $key . "F";
    if($value != 'No Preference')
    {   
       $arrQueryParts[$key] = " AND ".ucwords($key)."='".$value."'";
    }   
}

//your query
$strAddQuery = $arrQueryParts['Age'] . $arrQueryParts['Sex'] . $arrQueryParts['Hair'] . $arrQueryParts['Dress'];
$strQuery = "select * from people " . (trim($strAddQuery) != ""?" where 1=1 ":"") . $strAddQuery . " order by Name";
$rs = mysql_query($strQuery);
while($row = mysql_fetch_assoc($rs))
{

$ID = $row['ID'];

$Name = $row['Name'];

$Phone_Number = $row['Phone_Number'];

$Age = $row['Age'];

$Sex = $row['Sex'];

$Hair = $row['Hair'];



echo "<table>"; 



echo "<tr><td>";

echo "<a href='www.example.com'>".$Name."</a></td>";

echo "<td>";
echo "<a href='www.example.com'>".$Phone_Number."</a></td>";

echo "<td>";
echo "<a href='www.example.com'>".$Age."</a></td>";

echo "<td align='center'>";

echo "<a href='www.example.com'>".$Sex."</a></td>";

echo "<td align='center'>";

echo "<a href='www.example.com'>".$Hair."</a></td></tr>";

echo "</table>"; }
?>
vibhaJ 126 Master Poster

Either do
1)

if($value != 'No Preference')

OR 2)
In dropdown in option value

<option value="">No Preference</option>

and in coding use,

if($value != '')

This is the query that is returned:

select * from people where 1=1 AND Age='19' AND Sex='No Preference' AND Hair='No Preference' AND Dress='No Preference' order by Name

Now the problem is that No Preference is supposed to be like a select all in that category because that doesn't narrow the search field down at all.

How do I make it so that when it is No Preference is selected it doesn't restrict the query?

vibhaJ 126 Master Poster

Replace this much code. and then check it.

foreach($arrQueryParts as $key=>$value)
{ 
    $strVarName = $key . "F";
    if(strtolower($strVarName) != 'no preference')
    {   
       $arrQueryParts[$key] = " AND ".ucwords($key)."='".$value."'";
    }   
}

//your query
$strAddQuery = $arrQueryParts['Age'] . $arrQueryParts['Sex'] . $arrQueryParts['Hair'] . $arrQueryParts['Dress'];
echo $strQuery = "select * from people " . (trim($strAddQuery) != ""?"where 1=1 ":"") . $strAddQuery . " order by Name";
 exit;
vibhaJ 126 Master Poster

APC is a PECL Extension

Try Getting the package and install
for more info on apc Extension
http://pecl.php.net/package/APC

vibhaJ 126 Master Poster

On onclick event of button you can call one js function.
In js function call ajax to increment click counter.

vibhaJ 126 Master Poster

post your code.
I use below searching logic:
1. Create join query which will have all five parameters as a result.
2. now create where condition by concatenation.
e.g.

if(isset($_POST['color']))
  $where.= " AND table1.color=".$_POST['color'];
if()
  ....

3. So your final query will be.
$sql = " select... WHERE 1=1 ".$where;

vibhaJ 126 Master Poster

Code is looking w/o error.
can you check $tbl_name variable in both page.

vibhaJ 126 Master Poster

1. count distance between x and y point.
2. check wheather it is less than radious (y is inside)
it is greater than radious (y is outside)

karthik_ppts commented: its really helpful to me. +1
vibhaJ 126 Master Poster

try without single quote.

in_array($user_em,$pieces)