Jump to content


Photo

why don't the results show? (link included)


  • Please log in to reply
4 replies to this topic

#1 87dave87

87dave87
  • Members
  • PipPipPip
  • Advanced Member
  • 86 posts

Posted 22 September 2006 - 03:55 PM

http://www.emulators.cc/search.php

On the results page nothing is appearing.

The coding for the search page is: -

<form name="emusearch" method="POST" action="searchresults.php">
  <p>
  <input type="text" name="emusearch" size="20"><input type="submit" value="Submit" name="emusearch"></p>
</form>

The coding for the results page is: -

<?php  
$database="mydatabase";  
mysql_connect ("localhost", "user", "pass");  
@mysql_select_db($database) or die( "Unable to select database");
$sql = mysql_query("select * from windows_atari2600 where emulator = '$emusearch'");
if(isset($sql)){
while ($get_info = mysql_fetch_row($sql)) {  
  echo "<tr>";  
  foreach ($get_info as $field) echo "<td>$field</td>\n";
  echo "</tr>\n";
}
}else{
  echo "<tr>";
  echo "We cannot find your infomation.";
  echo "</tr>\n";
}
?>


#2 BillyBoB

BillyBoB
  • Members
  • PipPipPip
  • Advanced Member
  • 630 posts

Posted 22 September 2006 - 03:58 PM

i think i have replied to this b4
you do not get the posted info just by say $emusearch

here is how it should be ...

<?php  
$database="mydatabase";  
mysql_connect ("localhost", "user", "pass");  
@mysql_select_db($database) or die( "Unable to select database");
$sql = mysql_query("select * from windows_atari2600 where emulator = '$_POST[emusearch]'");
if(isset($sql)){
while ($get_info = mysql_fetch_row($sql)) {  
  echo "<tr>";  
  foreach ($get_info as $field) echo "<td>$field</td>\n";
  echo "</tr>\n";
}
}else{
  echo "<tr>";
  echo "We cannot find your infomation.";
  echo "</tr>\n";
}
?>


#3 87dave87

87dave87
  • Members
  • PipPipPip
  • Advanced Member
  • 86 posts

Posted 22 September 2006 - 04:17 PM

yes that works now, but the 'cannot find information' part is still not working.

#4 BillyBoB

BillyBoB
  • Members
  • PipPipPip
  • Advanced Member
  • 630 posts

Posted 22 September 2006 - 04:21 PM

try this i dont know if it will work

<?php  
$database="mydatabase";  
mysql_connect ("localhost", "user", "pass");  
@mysql_select_db($database) or die( "Unable to select database");
$sql = mysql_query("select * from windows_atari2600 where emulator = '$_POST[emusearch]'");
if($sql==""){
while ($get_info = mysql_fetch_row($sql)) {  
  echo "<tr>";  
  foreach ($get_info as $field) echo "<td>$field</td>\n";
  echo "</tr>\n";
}
}else{
  echo "<tr>";
  echo "We cannot find your infomation.";
  echo "</tr>\n";
}
?>


#5 87dave87

87dave87
  • Members
  • PipPipPip
  • Advanced Member
  • 86 posts

Posted 22 September 2006 - 04:55 PM

No doesn't seem to, just displays 'We cannot find your infomation' no matter what is entered :?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users