simcoweb Posted January 3, 2008 Share Posted January 3, 2008 Here's the code for the query: <?php include 'db_config.php'; /** * @author rockmetal * @copyright 2007 */ // query for extracting lenders from amember database $category = strip_tags(trim($_POST['category'])); $loantype = strip_tags(trim($_POST['loan_type'])); $loanamount = strip_tags(trim($_POST['loan_size'])); $sql = "SELECT * FROM amember_members WHERE is_lender='Yes' AND '$category' IN (category_1, category_2, category_3, category_4, category_5) AND loan_type='$loantype' AND loan_size='$loanamount' ORDER BY top_3 LIMIT 10"; $results = mysql_query($sql) or die(mysql_error()); $numrows = mysql_num_rows($results) or die(mysql_error()); if($numrows == 0){ echo "<h3>No Results Found</h3><br> <p class='bodytext'>No lenders matched your search criteria. Try modifying the search parameters for broader results.<br>\n"; } else { // create display of results in abbreviated format while ($row = mysql_fetch_array($results)) { echo "<table width='550' border='0'> <tr colspan='2'><td class='lendertitle'>".$row['company_name']."</td></tr> <tr><td class='lenderdesc'>".$row['company_desc']."</td></tr> <tr><td>Rating:". include('star_rating')."</td><td><a class='lenderlink' href='loanrequest.php?lenderid=".$row['member_id'].">Full Details</a></td></tr> </table><br />\n "; } } ?> The database DOES contain at least one record that would meet the requirements of the query. However, nothing displays. Furthermore, if there were no results then it should display the message to that affect. Instead the page is completely blank when the search is performed. Scratching my head ??? Quote Link to comment Share on other sites More sharing options...
hitman6003 Posted January 3, 2008 Share Posted January 3, 2008 Make sure error reporting is set high enough and display errors is turned on: Insert the following at the top of your script (above the include). ini_set("display_errors", 1); error_reporting(E_ALL); ini_set("display_startup_errors", 1); Quote Link to comment Share on other sites More sharing options...
revraz Posted January 3, 2008 Share Posted January 3, 2008 What does this mean include('star_rating') Quote Link to comment Share on other sites More sharing options...
teng84 Posted January 3, 2008 Share Posted January 3, 2008 dont you have any extension name for this file include('star_rating') Quote Link to comment Share on other sites More sharing options...
simcoweb Posted January 3, 2008 Author Share Posted January 3, 2008 Ok, that's what was breaking it. The rating include. Actually it's supposed to be there but I didn't modify the code to correct syntax. Here's the recommended 'tag' they suggest using. However, this is including additional PHP echo commands that I don't need since it will be inserted into a block of HTML that is already being echoed. <? echo pullRating(35,false,false,false,NULL); ?> So, say I wanted to place this where the include('star_rating') code is now. How/what would I modify to make this work? I've tried a few combos but my PHP editor reports errors. Quote Link to comment Share on other sites More sharing options...
teng84 Posted January 3, 2008 Share Posted January 3, 2008 sorry i don't get it Quote Link to comment Share on other sites More sharing options...
simcoweb Posted January 3, 2008 Author Share Posted January 3, 2008 Ok, i'll see if I can clarify. The results of the query are displayed in HTML via echo. In that block of HTML code I have a 5 star rating system i'd like to include in there that, in itself, uses an 'include' statement to call it (the one I posted in previous response). However, that include statement also includes the <? ?> tags and an additional 'echo' statement. Assuming I don't need either of those since that entire block is already being echoed, what changes would I make to that tag in order for it to summon in that location? Make sense? This may help. It's the instructions from their download: The tags that MUST appear on your page(s) are as follows: <? include("includes/rating_functions.php"); ?> <link href="css/rating_style.css" rel="stylesheet" type="text/css" media="all"> <script type="text/javascript" src="js/rating_update.js"></script> Now to call the rating bar we simply insert this PHP snippet. <? echo pullRating(35,false,false,false,NULL); ?> 1) 35 would be your unique rating id (usually people put $_GET['id'] in there) Quote Link to comment Share on other sites More sharing options...
teng84 Posted January 3, 2008 Share Posted January 3, 2008 *if you save your data as html in some case it will not recognize the php tags and print that as it was *you can try saving your images as image having one star image 2 having 2 star then echo that as <img src="$onestar"/> *or count the point and call the images in a loop to get all the needed stars (bad idea) hope that helps Quote Link to comment Share on other sites More sharing options...
simcoweb Posted January 3, 2008 Author Share Posted January 3, 2008 Or, I could do it like this where I separate the echo statement: echo "<h3>The following lenders meet your search criteria.</h3><br>\n"; // create display of results in abbreviated format while ($row = mysql_fetch_array($results)) { echo "<table width='550' border='0'> <tr colspan='2'><td class='lendertitle'>".$row['company_name']."</td></tr> <tr><td class='lenderdesc'>Company phone: ".$row['company_phone']."</td></tr> <tr><td>Company contact: ".$row['company_contact']."</td><td><a class='lenderlink' href='loanrequest.php?lenderid=".$row['member_id'].">Submit Loan Request</a></td></tr><tr><td>"; echo pullRating(35,false,false,false,NULL); echo "</td></tr></table><br />\n "; } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.