I tried my best last evening but i could not get much done. It seems that
the solution is in nested if...else statements but i got confused after the
third else. could you please include comments thanks a lot
<?php
// Connect to the database server
$dbcnx = @mysql_connect('localhost', 'root', 'triadpass');
if (!$dbcnx) {
exit('<p>Unable to connect to the ' .
'database server at this time.</p>');
}
// Select the website database
if ([EMAIL PROTECTED]('website')) {
exit('<p>Unable to locate the Recipe ' .
'database at this time.</p>');
}
?>
<?php
if (isset($_GET['stext'])){
$stext = $_GET['stext'];
}
if(strlen($stext) < 4)
{
exit ( '<h3>Your query must be more 3 letters long!</h3>');
}
$stext ='"'.$stext.'"';
// Request the text of all the recipes
$result = @mysql_query("SELECT * FROM recipes WHERE MATCH
(recipe_name,ingrediants) AGAINST ($stext)");
if (!$result)
{
exit('<p>Error performing query: ' . mysql_error() . '</p>');
}
$num_rows = mysql_num_rows($result);
if ($num_rows < 1){
//echo "$num_rows recipe(s) found\n";
exit ( '<h3>We do not seem to have a match at this time!</h3>');
}
// Display the text of each joke in a paragraph
echo '<table >
<tr>
<td><strong>Recipe Name</strong></td>
<td><strong>Ingrediants</strong></td>
<td><strong>Donated By</strong></td>
</tr>';
while ($row = mysql_fetch_array($result)) {
$ftext= $row['recipe_id'];
$recipe_name = $row[recipe_name];
$ingrediants= $row[ingrediants];
$ingrediants= substr("$ingrediants" ,0,50);
$ingrediants= $ingrediants ;
$method= $row[method];
$comments= $row[$comments];
$donated_by= $row[donated_by];
echo '<tr>';
echo '<td><a href="found.php?findtext=' . $ftext .'">'. $recipe_name.
'</a></td>';
echo '<td>'. $ingrediants . '</td>';
echo '<td>'. $donated_by . '</td>';
echo '<tr>';
//echo '<p> <a href="found.php?findtext=' . $ftext .'">'.
$row['recipe_name'] . '</a>__ ' . $row['donated_by'] . ' </p>';
}
echo '</table>';
?>
From: Matthew Macdonald-Wallace <[EMAIL PROTECTED]>
Reply-To: [email protected]
To: [email protected]
Subject: Re: [wdvltalk] PhP
Date: Tue, 03 Oct 2006 16:30:47 +0100
Quoting Micheal Mann <[EMAIL PROTECTED]>:
Hi
I am doing my very first website (Php/ MySql) and my problem is this :
i have a php script with some HTML hard coded (for formating)after the
script, i also have few conditional statements in this script if the
script is allowed to go through to the end it will allow the HTML to be
displayed but if it branches it will not allow the HTML to be
displayed. it seems to work fine during testing but if i go to view
page source i can see where it stops and why i get the result i am
expecting. I am about to do a section by section testing to see if i
can find the problem. I would like some suggestion of what i should
look for.
Michael,
Can you post the soruce code or put it on-line somewhere so we can take a
look?
Cheers,
Matt
--
Matthew Macdonald-Wallace
[EMAIL PROTECTED]
"Sed quis custodiet ipsos custodies?"
____ The WDVL Discussion List from WDVL.COM ____
To Join wdvltalk, Send An Email To:
mailto:[EMAIL PROTECTED] or
use the web interface
http://e-newsletters.internet.com/discussionlists.html/
Send Your Posts To: [email protected]
To change subscription settings, add a password or view the web interface:
http://intm-dl.sparklist.com/read/?forum=wdvltalk
________________ http://www.wdvl.com _______________________
You are currently subscribed to wdvltalk as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
To unsubscribe via postal mail, please contact us at:
Jupitermedia Corp.
Attn: Discussion List Management
475 Park Avenue South
New York, NY 10016
Please include the email address which you have been contacted with.
_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
____ The WDVL Discussion List from WDVL.COM ____
To Join wdvltalk, Send An Email To: mailto:[EMAIL PROTECTED] or
use the web interface http://e-newsletters.internet.com/discussionlists.html/
Send Your Posts To: [email protected]
To change subscription settings, add a password or view the web interface:
http://intm-dl.sparklist.com/read/?forum=wdvltalk
________________ http://www.wdvl.com _______________________
You are currently subscribed to wdvltalk as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]
To unsubscribe via postal mail, please contact us at:
Jupitermedia Corp.
Attn: Discussion List Management
475 Park Avenue South
New York, NY 10016
Please include the email address which you have been contacted with.