LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 12-10-2019, 01:58 PM   #1
pizzipie
Member
 
Registered: Jun 2005
Location: Hayden, ID
Distribution: Ubuntu 20.04
Posts: 441

Rep: Reputation: 12
Results of sqlite query displayed in table won't stay on screen


Hi,

I queried a sqlite database successfully and displayed results in table. I've run this repeatedly with no problem, then inexplicably the results will no longer stay on the screen. All you see is the results flash by and then a blank screen.
The text from the two echo statements 'Opened Database Successfully' and 'Closed Database Successfully' does remain on the screen. I re-booted the computer but this condition did not change,

Thanks for help in advance. R

Here is code:

Code:
<?php
set_include_path( './include' );
error_reporting (E_ALL ^ E_NOTICE);

   class MyDB extends SQLite3 {
      function __construct() {
         $this->open('renoAZID.db');
      }
   }
   $db = new MyDB();
   if(!$db) {
      echo $db->lastErrorMsg();
   } else {
      echo "Opened Database Successfully\n";  
}

   $sql =<<<EOF
      SELECT * from rdata ORDER BY Category;      
EOF;

?>

<!DOCTYPE html>

<html> 
                                                                      
<head> 
<title>Wed 04 Dec 2019 Renovation Data</title>
<link rel="stylesheet " type="text/css" href="renoAZID.css" />
</head>
<body>

<table id="t01">

<th>Id</th> <th>Date</th> <th>Location</th> <th>Vendor</th> <th>Description</th> 
<th>Category</th> <th>Paid By</th> <th>AcctNo</th> <th>Amount</th>

<h2>Renovation Data</h2>

<?php
	$count=0;
   $ret = $db->query($sql);
   while($row = $ret->fetchArray(SQLITE3_ASSOC) ) {		// runs SELECTION query on Table rdata

?>
	<tr>
		<td> <?php echo $row['Id'] ?></td>                                                                      
		<td> <?php echo $row['Date']?></td>                                                   
		<td> <?php echo $row["Location"]?></td>                                                    
		<td> <?php echo $row["Vendor"]?></td>                                                  
		<td> <?php echo $row["Description"]?></td>                                                      
		<td> <?php echo $row["Category"]?></td>                                                    
		<td> <?php echo $row["PaidBy"]?></td>                                            
		<td> <?php echo $row["AcctNo"]?></td> 
		<td> <?php echo number_format($row["Amount"],2)?></td>
   </tr>
   
   <?php
   	$count++;
   	if($count==20) {		// lets see header line after 20 lines of data
   ?>
   
   <th>Id</th> <th>Date</th> <th>Location</th> <th>Vendor</th> <th>Description</th> 
   <th>Category</th> <th>Paid By</th> <th>AcctNo</th> <th>Amount</th>
   
   <?php
   	$count=0;
   	} // if
   	} // while 
   	 $db->close();
   	 echo "<br>Closed Database Successfully"; 
   ?>
   
 </table>  
 </body>
 </html>
 
Old 12-10-2019, 05:46 PM   #2
pizzipie
Member
 
Registered: Jun 2005
Location: Hayden, ID
Distribution: Ubuntu 20.04
Posts: 441

Original Poster
Rep: Reputation: 12
I FOUND THE ANSWER. I had changed the CSS file. Something I did there caused the problem.

Works fine now.

R
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Sending query results to another table - how do I convert the column titles? Freetimers Linux - General 2 11-29-2018 09:29 AM
What are the differences between the normal symbol table, the dynamic symbol table, and the debugging symbol table? watchintv Linux - Software 5 10-22-2016 08:38 AM
PHP-7: #2 mysqli query returns "no results" unless #1 query is closed first sundialsvcs Programming 3 05-20-2016 06:44 AM
[SOLVED] MySQL run SELECT on a table if column A form table 1 equals column A from table 2 robertjinx Linux - Software 1 01-15-2016 10:48 AM
LXer: Sqlite-Commander - A ncurses based tool to display the records and tables of a sqlite database LXer Syndicated Linux News 0 01-02-2011 08:11 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:06 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration