Re: [PHP-DB] Can't find sqlite_open
> Hello, > I have a script that is calling sqlite_open, however, sqlite_open can't be > found on my systems. I'm running RHEL5 and I get the following relevant > output from php -i: > > PDO support => enabled > PDO drivers => odbc, sqlite > > 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 > > From searching around, it seems like there is a PDO version, which looks to > be enabled here, and a older version, which would provide sqlite_open. Is > that correct? sqlite_open is not a PDO statement. It belongs to the PECL SQLite extension. This extension is quite old and is superseded by the SQLite3 extension and/or PDO. > Thanks! > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- Niel Archer niel.archer (at) blueyonder.co.uk -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: Top 10 Query
I had an extra “=” sign by the WHERE, my mistake, I couldn’t see it originally. Ron The Verse of the Day “Encouragement from God’s Word” http://www.TheVerseOfTheDay.info From: Ron Piggott Sent: Saturday, January 08, 2011 7:42 AM To: php-db@lists.php.net Subject: Top 10 Query I am trying to write a mySQL query to determine if the current word being displayed in the game is one of the top 10 most popular. I am trying to achieve this by creating a table that tracks how many times each word was accessed. A new row is created for each access to the word. The table structure is as follows: CREATE TABLE IF NOT EXISTS `bible_word_scramble_usage` ( `reference` int(25) NOT NULL AUTO_INCREMENT, `bible_dictionary_reference` int(4) NOT NULL, `ip_address` varchar(20) NOT NULL, `date_accessed` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`reference`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=122 ; The following is the SELECT query I need help tweaking. What I am trying to do is select the top 10 most popular words and then use a second select to see if the word being displayed is one of the top 10 (IE using the search results of the 10 top SELECT query). The error this query is currently giving me is: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '= `top_ten`.`bible_dictionary_reference` = 1 LIMIT 1' This is the query: SELECT `top_ten`.`bible_dictionary_reference` FROM ( SELECT `bible_dictionary_reference` , COUNT( `reference` ) AS word_usage FROM `bible_word_scramble_usage` GROUP BY `bible_dictionary_reference` ORDER BY word_usage DESC LIMIT 10 ) AS top_ten WHERE = `top_ten`.`bible_dictionary_reference` =1 LIMIT 1 Thank you for helping me. Ron The Verse of the Day “Encouragement from God’s Word” http://www.TheVerseOfTheDay.info
[PHP-DB] Top 10 Query
I am trying to write a mySQL query to determine if the current word being displayed in the game is one of the top 10 most popular. I am trying to achieve this by creating a table that tracks how many times each word was accessed. A new row is created for each access to the word. The table structure is as follows: CREATE TABLE IF NOT EXISTS `bible_word_scramble_usage` ( `reference` int(25) NOT NULL AUTO_INCREMENT, `bible_dictionary_reference` int(4) NOT NULL, `ip_address` varchar(20) NOT NULL, `date_accessed` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`reference`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=122 ; The following is the SELECT query I need help tweaking. What I am trying to do is select the top 10 most popular words and then use a second select to see if the word being displayed is one of the top 10 (IE using the search results of the 10 top SELECT query). The error this query is currently giving me is: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '= `top_ten`.`bible_dictionary_reference` = 1 LIMIT 1' This is the query: SELECT `top_ten`.`bible_dictionary_reference` FROM ( SELECT `bible_dictionary_reference` , COUNT( `reference` ) AS word_usage FROM `bible_word_scramble_usage` GROUP BY `bible_dictionary_reference` ORDER BY word_usage DESC LIMIT 10 ) AS top_ten WHERE = `top_ten`.`bible_dictionary_reference` =1 LIMIT 1 Thank you for helping me. Ron The Verse of the Day “Encouragement from God’s Word” http://www.TheVerseOfTheDay.info