ezSQL Database Class (2.03)

Due to spam issues, ezSQL has been moved. You can now get it from the following location: For ezSQL discussion Help and News

Problem With Multibyte Characters

Hi all,

Personally, I think ezSQL is a great tools for working with MySQL. Hopefully, someone could help me with this issue that I am having.

Is there any way to get ezSQL to set the results return to be UTF-8? Apparently, I am getting weird characters for characters like a-tilde, etc... I've set my headers to use UTF-8 as a character set but its still showing funny characters on the browser.

Someone then suggested me to use mysqli


$mysqli = new mysqli(DB_SERVER, DB_SERVER_USERNAME, DB_SERVER_PASSWORD, DB_DATABASE);

$mysqli->set_charset("utf8");


Using mysqli, it displayed the characters correctly in the browsers, so apparently it was an issue with ezSQL.

n/a

seeing if there's a query error

Right now, I don't see if there's an easy way to retreieve it theres an error with the query in get_results() or get_row() or query(). how do you differenciate in code between no results, and a SQL error?
I don't see nay functions to do that..that would be my biggest request!!

Thanks

n/a

Seen this: Warning: sqlite_open() [function.sqlite-open]: file is encrypted or is not a database, then some more Q.

I installed SQLite today as well as the ez_sql from this site.

Used some time to find out why it did not work against my SQLite db.

Then I found this on a php forum:

If you get an error message:
Warning: sqlite_open() [function.sqlite-open]: file is encrypted or is not a database then most probably your code is accessing a SQLite3 database.

sqlite_open() only supports SQLite2.
Use PDO to access SQLite3.

Well, if you are a newbie like me and want to install SQLite then it is quite normal, I guess, to install the latest version you find on www.sqlite.org
which is not compatible with current version of ez_sql.

Dump debug output to file

Here's a little addon that will dump the debug output to a file. You could spruce this up by having it email the webmaster I suppose. I use it by keeping the debug output silent ($db->debug_echo_is_on = false;) and then creating the file instead.

First, you'll need to add two (2) variables to the core file:

var $debug_dump = false;
var $debug_dir = null;

It will be off by default. Then, on the debug() function, you'll need to add the following code anywhere after the $html = ob_get_contents();, because that's the information that's going to be written to the file.

Using MS-SQL (MSSQL) with ezSQL?

ezSQL is a widget that makes it ridiculously easy for you to use mySQL, Oracle8, InterBase/FireBird, PostgreSQL, SQLite (PHP), SQLite (C++) or MS-SQL database(s) within your PHP/C++ scripts (more db's coming soon)

Am I blind or is MS-SQL / MSSQL not available in the archive? I know the description says MS-SQL is included but I just can't find it. I only see MySQL, Oracle, and SQL Lite.

Ok so I'm being stupid...

In index.php:

require_once("ez_sql.php");
require_once("mailfunction.php");
require_once("functions.php");

then in functions.php :

$db->debug();
$db->get_var("SELECT count(*) FROM settings");

The result:
Fatal error: Call to a member function on a non-object in /functions.php on line 5

Can someone please point me in the right direction?

PHP 4 Apache 1.3 if it helps at all. And I've been using the damned class for years and never had a single problm. Not sure what I'm missing.

Thanks in advance

Reborn

v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
b\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}

Geral

22858575
22860000

(`@````$````
309
310
263
5

110183775
110185200

C:\Documents and Settings\Utilizador\Os meus documentos\A minha música\Stone Sour\Come What(ever) May\06 - Reborn.mp3

2
alguem@example.com
Resposta a um formulário do Web site
As suas informações foram recebidas
FORMDATA.HTM
1
http://example.microsoft.com/~user/ispscript.cgi

True
True
3
(```````````
(```````````
0
315

image684.gif

True
True
3
(```````````
(```````````
0
317

image317.jpg

Geral