This gives a plank page:
<?php
include("../includefiles/dbconnection.php");
$bk=isset($_GET["book".$no]) ? $_GET["book".$no] : "";
$ch=isset($_GET["chapter".$no]) ? $_GET["chapter".$no] : "";
$vs=isset($_GET["verse".$no]) ? $_GET["verse".$no] : "";
$source=isset($_GET["source".$no]) ? $_GET["source".$no] : "";
$sourceAbb=Array("kjv", "mt", "mtnv", "tr");
$SourceName=Array("King James", "Masoretic Text", "Masoretic No Vowels", "Textus Receptus");
$SourceTable=Array($dbTable3, $dbTable7, $dbTable9, $dbTable8);
for($i=0; $i<count($SourceTable); $i++){
if($source==$sourceAbb[$i]){
$sql = "SELECT * FROM ".$SourceTable[$i]." WHERE book = '".$bk."' AND chapter= '".$ch."'";
if($vs != 'all'){
$sql .= " AND verse= '".$vs."'";
}
$sql .= " ORDER BY id ASC";
//echo $sql;
}
}
if($result){
$result = mysql_query($query);
while($row = mysql_fetch_array($result)){
$id[] = $row['id'];
$bookTitle[] = $row['book_title'];
$book[] = $row['book'];
$bookAbb[] = $row['book_abb'];
$chapter[] = $row['chapter'];
$verse[] = $row['verse'];
$textData[] = $row['text_data'];
}
?>
<div style="float: left; margin: 5px 0px 0px 0px; background-color: #7A1010; width: 183px; height: 19px; border: 1px solid #7A1010; color: white; font-weight: bold; text-align: left; padding: 0px 0px 0px 5px;">
<span style="float: left; padding: 2px 10px 0px 2px; color: #FFFFFF; font-family: arial; font-weight:bold; font-size: 13px"><input id="chk_all" name="checkallresults" type="checkbox" style="float: left;" onClick="if(this.checked == true){for (i=0; i<document.getElementsByName('checkresult_<?php echo $no; ?>').length; i++){document.getElementsByName('checkresult_<?php echo $no; ?>')[i].checked = true ;
}}else{for (i=0;i<document.getElementsByName('checkresult_<?php echo $no; ?>').length; i++){document.getElementsByName('checkresult_<?php echo $no; ?>')[i].checked = false;}}" />all</span>
<span style="float: left; height: 10px; padding: 2px 10px 0px 2px; color: #FFFFFF; font-family: arial; font-weight: bold; font-size: 13px"><?php echo $bookTitle[0]. " " .$chapter[0];?></span>
</div>
<div id="txt_<?php echo $book[0]."_".$chapter[0]."_".$no; ?>" style="float: left; background-color: #EAE8C8; margin: 0px 0px 0px 0px; width: 178px; height: 407px; border: 1px solid #7A1010; padding: 5px 5px 0px 5px; overflow-y: auto; overflow-x: hidden;">
<?php
for($tdid=0; $tdid < count($id); $tdid++){
echo "\ \ \ \ \ <p id=\\"regular[]\\" name=\\"bibletext\\" style=\\"float: left; text-align: left; width: 155px; display: block; padding: 0px 2px 0px 2px; font-size: 12px;\\"><input id=\\"check".$no."_".$tdid."\\" name=\\"checkresult_".$no."\\" type=\\"checkbox\\" onclick=\\"\\" value=\\"".$id[$tdid]."\\" /><span style=\\"font-weight: bold; margin: 2px;\\">"."[".$id[$tdid]."] - ".$verse[$tdid]."</span>";
$strText = stripslashes(mysql_real_escape_string($textData[$tdid]));
include("../includefiles/highlight_getText.php");
echo "</p>\
";
}
echo "\ \ \ \ \ </div>\
";
}
mysql_close($con);
?>
But when I remove the if($result) then it would point out:
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in thewheelofgod\ wotexts\getfiles\getTextinclude.php on line 22
What’s the solution?