Jump to content


Photo

Searching a database, using %


  • Please log in to reply
25 replies to this topic

#21 DaveLinger

DaveLinger
  • Members
  • PipPipPip
  • Advanced Member
  • 268 posts
  • LocationWV, USA

Posted 11 July 2006 - 06:41 PM

sorry X_X

any ideas anyone?
http://www.DaveLinger.com
dave at linger dot com

#22 DaveLinger

DaveLinger
  • Members
  • PipPipPip
  • Advanced Member
  • 268 posts
  • LocationWV, USA

Posted 11 July 2006 - 06:56 PM

I tried changing gosearch.php to:

<?php
echo $_POST['platform'];
?>

and it correctly echos % if I have Any selected or the corresponding id...
http://www.DaveLinger.com
dave at linger dot com

#23 kenrbnsn

kenrbnsn
  • Staff Alumni
  • Advanced Member
  • 8,235 posts
  • LocationHillsborough, NJ, USA

Posted 11 July 2006 - 07:03 PM

Change it to
<?php echo '<pre>' . print_r($_POST,true) . '</pre>'; ?>
and post the results.

Ken

#24 DaveLinger

DaveLinger
  • Members
  • PipPipPip
  • Advanced Member
  • 268 posts
  • LocationWV, USA

Posted 11 July 2006 - 07:13 PM

Array
(
    [platform] => %
    [fletter] => %
    [developer] => %
    [publisher] => %
    [sort] => score6
)

http://www.DaveLinger.com
dave at linger dot com

#25 kenrbnsn

kenrbnsn
  • Staff Alumni
  • Advanced Member
  • 8,235 posts
  • LocationHillsborough, NJ, USA

Posted 11 July 2006 - 07:43 PM

Ok, now start adding the code you had back into the script, line by line, testing after each line. If the script works fine after all the lines have been added back, then there must have been an unseen character in the file that stopped the script from running properly.

Ken

#26 DaveLinger

DaveLinger
  • Members
  • PipPipPip
  • Advanced Member
  • 268 posts
  • LocationWV, USA

Posted 12 July 2006 - 02:41 PM

hokay, I rewrote it all. Here's my current code.

<?php
include('includes/config.php');
include('includes/header.php');

$platform = $_POST['platform'];
$developer = $_POST['developer'];
$publisher = $_POST['publisher'];
$fletter = $_POST['fletter'];
$sortby = $_POST['sort'];

if (!$link = mysql_connect($sqlserver, $sqlusername, $sqlpassword)) {
   echo 'Could not connect to mysql';
   exit;
}

if (!mysql_select_db($sqldatabase, $link)) {
   echo 'Could not select database';
   exit;
}

if($fletter == '%'){
$query="SELECT * FROM nuke_seccont WHERE secid LIKE '$platform' AND developer LIKE '$developer' AND publisher LIKE '$publisher' ORDER BY $sortby DESC";
}ELSE{
$query="SELECT * FROM nuke_seccont WHERE secid LIKE '$platform' AND developer LIKE '$developer' AND publisher LIKE '$publisher' AND fletter='$fletter' ORDER BY $sortby DESC";
}
$result = mysql_query($query) or die("Problem with the query: $query<br>" . mysql_error());

while ($row = mysql_fetch_assoc())
{
$artid = $row['artid'];
$secid = $row['secid'];
$title = $row['title'];
$counter = $row['counter'];
echo "$artid<br>$secid<br>$title<br>$counter<br><br>";
}

include('includes/footer.php');

?>

I have discovered that if I try to echo anything before I echo the results it causes the white screen problem. Even now, no results are displayed. Any ideas?
http://www.DaveLinger.com
dave at linger dot com




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users