RE: [PHP-DB] pg_connect gets fatal error

2005-08-14 Thread Jon Crump

On Sat, 13 Aug 2005, Bastien Koert wrote:


is php compiled with postgre support? probably not from the sounds of it

bastien


I'm guessing you're right, but it's not clear how I could tell. The output 
from ?php phpinfo() ? doesn't really help much unless I know what to 
look for. On the one hand it says that DBX support is enabled and 
PostgreSQL is one of the supported databases, on the other, MySQL support 
is described explicitly, as is ODBC, but there is no similar section for 
the other supported DBs. If php wasn't compiled with postgres support, 
do I have to recompile it? how? Apologies if these questions are naive, 
but I am a rank tyro in these matters.


Jon

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP-DB] pg_connect gets fatal error

2005-08-14 Thread Bastien Koert
http://ca.php.net/manual/en/ref.pgsql.php is the manual place to start 
looking...


i just enabled pg support with my windows machine..pgsql does show up as a 
separate entity in the php info listings...


Because you mentioned Postgre I am assuming your dev machine is a linux box.
http://ca.php.net/manual/en/install.unix.php
are the install notes for php, these will guide you in re compiling PHP to 
include postgre


bastien


From: Jon Crump [EMAIL PROTECTED]
To: Bastien Koert [EMAIL PROTECTED]
CC: php-db@lists.php.net
Subject: RE: [PHP-DB] pg_connect gets fatal error
Date: Sun, 14 Aug 2005 11:16:39 -0700 (PDT)

On Sat, 13 Aug 2005, Bastien Koert wrote:


is php compiled with postgre support? probably not from the sounds of it

bastien


I'm guessing you're right, but it's not clear how I could tell. The output 
from ?php phpinfo() ? doesn't really help much unless I know what to look 
for. On the one hand it says that DBX support is enabled and PostgreSQL is 
one of the supported databases, on the other, MySQL support is described 
explicitly, as is ODBC, but there is no similar section for the other 
supported DBs. If php wasn't compiled with postgres support, do I have to 
recompile it? how? Apologies if these questions are naive, but I am a rank 
tyro in these matters.


Jon


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Mysqli Problems with 5.1.0b3

2005-08-14 Thread Charlie Davis

Hey all!

So two days ago, just for kicks, I thought I'd update to 5.1.0b3.

On to my problem.

I use a custom Session class to basically store my session data in MysQL.

Here's my class:

class DBSession
{
static $dbh;

function open($save_path, $session_name)
{
self::$dbh = new mysqli(localhost, ..., ..., lists);
return(true);
}

function close()
{   
return(true);
}

function read($id)
{
$query = select session_data from sessions where session_id = 
'.$id.';
if(!$result = self::$dbh-query($query))
throw new MysqlException($this-dbh);
if($result-num_rows == 0)
{
return ;
}
$row = $result-fetch_assoc();
return $row['session_data'];
}

function write($id, $sess_data)
{
$clean_data = addslashes($sess_data);
*Error Here:	if(self::$dbh-query(update sessions set session_data 
='.$clean_data.', modtime=NOW() where id='.$id.'))

return(true);
else
throw new MysqlException(self::$dbh);
}


function destroy($id)
{
if(self::$dbh-query(delete from sessions where session_id = '$id'))
return(true);
else
return(false);
}

function gc($maxlifetime)
{
$ts = time() - $maxlifetime;
		if(self::$dbh-query(delete from sessions where modtime  
from_unixtimestamp($ts)))

return(true);
else
return(false);
}
}

And the error I get is Warning: Couldn't fetch mysqli in the file at 
the line that starts with a *


This works in 5.0.4. I haven't changed a thing and been beating myself 
against a wall trying to figure this out. Did something change in 5.1 
that I should know about?


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] writing foreign language chars from php5 to db (mysql4)

2005-08-14 Thread Louie Miranda
Does anybody knows how to insert a foreign lang. char into php5 to mysql4?

languages, ex:
- japanese (jis)
- german (de)

I now know, how to display it properly on a website using meta tags.

ex:
meta http-equiv=Content-Type content=text/html; charset=ISO-8859-1

And catching it over a php5 form.

But, when i insert it to a db. Everything's messed up.

// code
$languagechar = $_GET[languagechar];

$insert = 
INSERT INTO languages
(`char`)
values
('$languagechar')
;


$add_member = $dbData-query($insert);

if (DB::isError($add_member)) {
die($add_member-getMessage());
}
// code

Do i need to convert it to something? Im testing it my phpmyadmin, and 
phpmyadmin can insert it with the correct values and characters. How come on 
my code it does not.


-- 
Louie Miranda
http://www.axishift.com -- under development