Re: [PHP-DB] Where does the mysqli extension find the default connection charset?

2007-05-02 Thread Georg Richter
Jean-Noël Rivasseau wrote:
 Hello there,
 
 I'd like to know which configuration file or setting is used by PHP mysqli
 extension to know the default charset connection to the database.

mysqli (and also mysql) extension uses the default character set for
libmysql  This can be package dependend: Several distros deliver utf8 as
default, others latin1.

To be on the safe side, you should call mysqli_set_charset($link,
utf8/latin1/whatever) to set the character set for each connection.

/Georg
-- 
Georg Richter, Development Manager - Connectors  Client Connectivity
MySQL GmbH, Radlkoferstr. 2, D-81373 München, www.mysql.com
Geschäftsführer: Hans von Bell, Kaj Arnö - HRB München 162140

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



Re: [PHP-DB] mysqli_prepare

2007-04-11 Thread Georg Richter
Craig Hoffman wrote:
 Can you use the mysqli_prepare function to UPDATE  MySQL or is it just
 limited to an INSERT statement?
 

mysqli_prepare works for mostly all statements, except
calling stored procedures, create commands and several show commands.

Full support is planned (and partially integrated already)

/Georg

-- 
Georg Richter, Development Manager - Connectors  Client Connectivity
MySQL GmbH, Radlkoferstr. 2, D-81373 München, www.mysql.com
Geschäftsführer: Hans von Bell, Kaj Arnö - HRB München 162140

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



Re: [PHP-DB] mysqli_stmt_bind_param with lists

2006-06-13 Thread Georg Richter
Am Di, den 13.06.2006 schrieb Bluejack um 7:31:
 Is there any way to get mysqli_stmt_bind_param to take the bind
 parameters as an array? It seems to see an array as a single item,
 rather than detecting an array and expanding the elements.

see

http://www.php.net/call_user_func_array

/Georg

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



Re: [PHP-DB] MySQLi Prepared Statements

2006-03-27 Thread Georg Richter
Am Mo, den 27.03.2006 schrieb Rob Hamilton um 19:37:

Hello Rob,

 Is it possible to construct an array of this type and pass it to these 
 functions, and if so how?

For such cases you should use call_user_func_array.

/Georg

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



Re: [PHP-DB] Getting PHP 5 w/mysqli to communicate with MySQL 5

2006-01-22 Thread Georg Richter
Am Fr, den 20.01.2006 schrieb Allen Schultz um 1:16:
 Hi, all:
 
 I having trouble getting my php to communicate with my MySQL database.
 I have it where I can connect, but afterwards, it sees nothing for
 information after being connected.

Any additonal information would be helpful...

a) what doesn't work ?
b) do you get any error messages?
c) which platform and versions of PHP and MYSQL do you use?

/Georg

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



Re: [PHP-DB] mysqli_stmt_bind_result

2005-07-19 Thread Georg Richter
Am So, den 10.07.2005 schrieb d3vnull um 12:06:
 
 According to the PHP manual it's quite normal that the above throws an error 
 message, because mysqli_stmt_bind_result() expects one variable for each 
 database field that you selected. If you just select a few fields from your 
 database that's perfectly ok, but if you select something like 20 fields 
 this can be really annoying.
 Is there a way to make the above work like in the old version, meaning 
 fetching the result of mysqli_stmt_execute() into into an array that has its 
 indices automagically named like the according database fields just like 
 mysql_fetch_array() does?
 

If you want to implement a similiar behaviour you should do that in
userland code, by retrieving metadata, initializing an array with
fieldnames as keys and using call_user_func_array function.

/Georg

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



Re: [PHP-DB] Prepared Statement not working (mysql 5)

2005-07-19 Thread Georg Richter
Am Do, den 14.07.2005 schrieb Marco Bascietto um 13:15:

 
 It looks like there is a problem with mysqli PS when the client and the
 server share the same machine. 
 Does anyone have a clue on what is going on or point me to some tests I
 can do?
 

There is no problem when running client and server on the same machine.
The only problem seems to be that you don't have any error handling in
your script: mysqli_connect_error and mysqli_error are your friends!

Also there is no need for an additional call $mysql-select_db, you can
select default db already during connect.

/Georg

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



Re: [PHP-DB] Problem with MySQL Extension

2005-06-25 Thread Georg Richter
Am Do, den 23.06.2005 schrieb Bomgardner, Mark A um 22:44:

 
 I upgrade the php-mysql extension from 4.3.2-8 to 4.3.2-23, which is the
 most current rpm and still no luck.  I now get the message that it can't
 find mysqli extension.
 
mysqli extension is part of PHP5, not of PHP4.

/Georg

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



Re: [PHP-DB] Memory

2005-05-01 Thread Georg Richter
Am Mi, den 27.04.2005 schrieb [FOTOList.com] Suporte um 15:46:
 Hi,
 
 When I get something from database, using this function: pg_query 
 (postgresql) or mysql_query and after put this result in somes 
 variables, Am I using double memory to same data or this new variable 
 point to variable with db result?

A normal mysql_query or mysqli_query function allocates a char** pointer
(in libmysql) for all data in resultset until it's freed via
mysql_free_result.

If you have to retrieve a large amount of data (and you don't use nested
selects) you should use mysql_unbuffered_query instead. This method can
be also faster.

/Georg

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



Re: [PHP-DB] Extending MySQLi_Result object

2004-11-16 Thread Georg Richter
Am Di, den 16.11.2004 schrieb Joe Bandenburg um 21:15:
 i there,
 
 It's my first post here, so go gentle.

It's your 2nd post - you sent the same post one Nov. 8th, but I was on a
conference and not able to answer :)
 
 I have run into a problem when trying to extend the MySQLi_result object 
 because the MySQLi object's method query always returns a 
 MySQLi_result and, to my knowledge, it is impossible to make it do 
 otherwise. So, my question is, how do I alter the query method to 
 return my new MySQLi_result object instead of the base object? Or, is 
 there another/better way of achieving what I'm looking for? Am I missing 
 something very obvious here? :)

Currently mysqli_result has no default constructor, and I still don't
know how to implement a good solution for, cause beside mysql_query
there is also mysql_store_result and mysql_use_result which returns a
mysqli_result object.

Also mysqli_stmt object isn't really extendable.

We are working on a solution for PHP 5.1 now (which will be released
next year).

/Georg
-- 
Georg Richter, Senior Software Developer
MySQL AB, www.mysql.com

Are you MySQL certified?  www.mysql.com/certification

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



Re: [PHP-DB] mysqli prepared statement query result sets

2004-10-26 Thread Georg Richter
Am Di, den 26.10.2004 schrieb Hans Lellelid um 12:57:

 Ooops, I guess I should have searched the list itself; I did some google 
 searches to no avail.  This is really unfortunate.  This API sucks!  


Prepared api calls use a binary protocol, which is totally different
from the old protocol. If you don't need binary protocol for prepared
statements, why don't you use native SQL Implementation for prepared
statements instead ??

It's always easy to claim that stuff other people created (and spent a
lot of time on it) sucks. But it sucks definitely more, if people are
not able to read the PHP and MySQL Documentation carefully.

Just my 2 cents

Georg

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



Re: [PHP-DB] Finding the value of the COMMENT in a table column

2004-09-21 Thread Georg Richter

 Hi all,
 
 Anyone know how to access the optional COMMENT you can add to columns 
 during table creation?
 

If you don't expect 20 diffrent answers for 20 different databases you
should be more specific. Nobody knows which database do you use.

/Georg

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



Re: [PHP-DB] mysqli_result() ?

2004-09-18 Thread Georg Richter
Am Sa, den 18.09.2004 schrieb Chris um 0:50:
 Hi, is there any MySQLi equivalent to the mysql_result function?

Nope.

mysql_result is very slow, so we didn't implement it. Use
mysql_fetch_row instead and use the row offsets to retrieve the content
of a column. See also http://www.php.net/mysql_result.

On my todo for 5.1 is a row object which will have several properties to
retrieve column contents (and metadata).

/Georg

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