Jump to content

[SOLVED] Whats wrong with this code?


curt22

Recommended Posts

<?php
include 'connect.php';
$sql = 'SELECT * FROM bible WHERE MATCH($_post[\'field\'])
. ' AGAINST('$_post[\'find\']' IN BOOLEAN MODE) LIMIT 0, 30 ';
$result = mysql_query($sql) or die(mysql_error());

while($row = mysql_fetch_array($result)){
echo $row['testimate'] . " " . $row['book'] . " " . $row['chapter'] . " " . $row['verse'] . " " . $row['verse text'];
echo "<br/>";
}

?>
Link to comment
Share on other sites

He already told you what's wrong with it.
Single quotes wont interpret variables, only double quotes will.

BTW, if you are trying to put the whole bible into a mysql database, you're reinventing the wheel. Use the Sword project's diatheke instead. That way you can switch translations on a whim and its search response times are pretty amazing.
Link to comment
Share on other sites

[code]
<?php
include 'connect.php';
$sql = "SELECT * FROM bible WHERE MATCH($_POST[field])
      AGAINST('$_POST[find]' IN BOOLEAN MODE) LIMIT 0, 30 ";
$result = mysql_query($sql) or die(mysql_error());

while($row = mysql_fetch_array($result)){
    echo "\n$row[testimate] $row[book] $row[chapter]:$row[verse] <pre>\n$row[verse_text]</pre>";
}
?>[/code]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.