# \[PHP, MySQL, FLASH\] - Search Query p2

**URL:** <https://forum.kirupa.com/t/php-mysql-flash-search-query-p2/191878>\
**Category:** programming\
**Created:** [June 23, 2006, 4:25pm UTC](https://forum.kirupa.com/t/php-mysql-flash-search-query-p2/191878 "2006-06-23T16:25:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Flash\_Man1](https://avatars.discourse-cdn.com/v4/letter/f/8797f3/32.png) [@Flash\_Man1](https://forum.kirupa.com/u/Flash_Man1)\
**Post date:** [June 23, 2006, 4:25pm UTC](https://forum.kirupa.com/t/php-mysql-flash-search-query-p2/191878/1 "2006-06-23T16:25:27Z")

</div>

Hey all,

just wondering with this script i have shown below, if its possible to edit it so that i could have the user type any of the input fields in flash instead of all in order to produce the complete results of the record.

at the moment its only out putting one of the record fields ‘NAME’ and they all must be filled in order to conduct search “which is not what i want”.

Here is the code:

\<?  
$name=$\_GET[‘name’];  
$company=$\_GET[‘company’];  
$address=$\_GET[‘address’];  
$phone=$\_GET[‘phone’];  
$email=$\_GET[‘email’];  
$web=$\_GET[‘web’];

```
mysql_pconnect("host","random","random") or die ("didn't connect to mysql");
mysql_select_db("database") or die ("no database");

```

$query = “SELECT \* FROM tbl\_name  
WHERE Name = ‘$name’  
AND Company = ‘$company’  
AND Address = ‘$address’  
AND Phone = ‘$phone’  
AND Email = ‘$email’  
AND Web = ‘$web’”;  
$result = mysql\_query( $query ) or die ( mysql\_error() );

$num = mysql\_num\_rows( $result );  
//echo ($num);  
if ($num == 1){  
while ($line=mysql\_fetch\_array($result)) {  
$profile = “name\_show=” . $line[‘Name’];  
$profile = “company\_show=” . $line[‘Company’];  
$profile = “address\_show=” . $line[‘Address’];  
$profile = “phone\_show=” . $line[‘Phone’];  
$profile = “email\_show=” . $line[‘Email’];  
$profile = “web\_show=” . $line[‘Web’];

```
}
print $profile;

```

} else {  
print “error=Sorry, but I can’t show results”;  
}  
?\>

if you see anything wrong with this code as to my questions above any help will be great!!

Thanks in advance ppls!! :hr::hr:
