Jump to content

Commands, but no output?


redcrusher

Recommended Posts

When i get onto a new server, i put a php file on it and see what versions of php sqlite and mysql there are.

 

For some reason, when i put it on this server, it does not show anything ...

 

2 of the lines:

 

echo sqlite_libversion();
echo phpversion();

 

Other php commands work and i am able to call simple methods and what not.  But for some reason those commands and a sqlite query is not working .

 

Any ideas?

Link to comment
Share on other sites

ok so,

 

IF i use:

echo phpinfo();
echo phpversion();

It works.

 

But if i use:

echo sqlite_libversion();

if does not work and nothing under it works either.

 

On that path,

 

$db = "database/mtg.db3"; 

// open database file 
$handle = sqlite_open($db) or die("Could not open database"); 

// generate query string 
$query = "SELECT * FROM cards"; 

// execute query 
$result = sqlite_query($handle, $query) or die("Error in query: ".sqlite_error_string(sqlite_last_error($handle))); 

// if rows exist 
if (sqlite_num_rows($result) > 0) { 
    // get each row as an array 
    // print values 
    echo "<table cellpadding=10 border=1>"; 
    while($row = sqlite_fetch_array($result)) { 
        echo "<tr>"; 
        echo "<td>".$row[0]."</td>"; 
        echo "<td>".$row[1]."</td>"; 
        echo "<td>".$row[2]."</td>"; 
        echo "</tr>"; 
    } 
    echo "</table>"; 
} 

// all done 
// close database file 
sqlite_close($handle); 

 

This does not output anything.

Link to comment
Share on other sites

[~]$ yum list | grep -i sqlite
python-sqlite.i386                       1.1.7-1.2.1                   installed
sqlite.i386                              3.3.6-5                       installed
mono-data-sqlite.i386                    1.2.4-2.el5.centos            extras   
pdns-backend-sqlite.i386                 2.9.21-4.el5.centos           extras   
qt4-sqlite.i386                          4.2.1-1                       base     
sqlite-devel.i386                        3.3.6-5                       base     

Link to comment
Share on other sites

That just shows the you have sqlite installed on the server.

Is it configured in PHP?

 

If you turn on error reporting in your script

error_reporting(E_ALL);

You will most likely see an undefined function error.

 

Check your PHP config file to see if the sqlite extension is enabled.

Link to comment
Share on other sites

error_reporting(E_ALL);	
echo sqlite_libversion();
        ect...

 

This works just like before. nothing shows up ...

 

as for sqlite ... if i do phpinfo() i get:

 

 

pdo_sqlite

 

PDO Driver for SQLite 3.x enabled

PECL Module version 1.0.1 $Id: pdo_sqlite.c,v 1.10.2.6 2006/01/01 12:50:12 sniper Exp $

SQLite Library 3.3.6

 

Link to comment
Share on other sites

when errors are displaying:

 

Fatal error: Call to undefined function sqlite_libversion() in /var/www/vhosts/mtgproxydeckbuilder.com/subdomains/alpha/httpdocs/test.php on line 8
[/doce]

and

[code]
Fatal error: Class 'SQLite3' not found in /var/www/vhosts/mtgproxydeckbuilder.com/subdomains/alpha/httpdocs/test.php on line 10

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.