Why not using PDO ? It is a global and standardized method to access
to data. :-)
2009/10/27 Giff Hammar gham...@sv-phoenix.com:
I started having trouble with a DBI interface to my PostgreSQL database
after I built a new Ubuntu machine. The Postgres version is 8.3 and the
DBI was written
What are you really want to do ? This is an exemple:
CREATE FUNCTION myfunction () RETURNS trigger AS $$
BEGIN
NEW.update_date = 'now'::date;
RETURN NEW;
END;
$$ LANGUAGE plpgsql;
CREATE TRIGGER set_update_date AFTER INSERT ON matable FOR EACH ROW
EXECUTE PROCEDURE myfunction();
me... :-)
Thanks Lester !
Samuel.
Le lundi 05 octobre 2009 à 08:36 +0100, Lester Caine a écrit :
Samuel ROZE wrote:
Hi,
Thanks for your reply.
In fact, my request returns a result which i get with the fetch method.
But, it must returns other informations, which are not in the result
? I view that there's only a pdo_dbh_t param, I may just
store this message into a field of the PDO class ?
Thanks in advance.
Samuel.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
!
Samuel. (French)
Le lundi 05 octobre 2009 à 20:58 +0200, Samuel ROZE a écrit :
Hi !
I'm reading the source of PDO PostgreSQL driver and i see that there's
an empty function, _pdo_pgsql_notice, which is very interesting ! I
think that it is used when PostgreSQL throw Notices.
But, nothing is done
]=
string(34) SELECT * FROM public.test_info()
}
--
Is there someone who know how I can get that ? I read some thinks about
that and pg_last_notice may returns the NOTICE, but with PDO ?
Thanks !
Samuel (French).
--
PHP Database Mailing List (http
Hi,
Thanks for your reply.
In fact, my request returns a result which i get with the fetch method.
But, it must returns other informations, which are not in the result...
This informations are neturned before the result in console...
So, i don't know how I can get that.
Samuel.
Le lundi 05
Yemi Obembe wrote:
Just want to know the difference between preg_match and preg_match_all.
preg_match stops after the first match.
preg_match_all gets *all* the matches.
E.g. If you have a string - $str = foofoo;
preg_match('/foo/', $str, $match); - $match will have an array with one
foo.
Norland, Martin wrote:
The functions you want exist in php5, if that's an option:
http://us2.php.net/manual/en/ref.mysqli.php -
http://us2.php.net/manual/en/function.mysqli-fetch-assoc.php
No this is not an option.
mysqli_fetch_* needs a result resource id to work.
mysqli statement functions
Hans Lellelid wrote:
Hi,
I'm writing a db abstraction layer driver for MySQLi. I'm glad to
finally get a chance to play around with these new functions, but am
completely stumped by this question:
Is there no way to get back a standard resultset when using prepared
statement queries?
I can't
Julian Madle wrote:
I obviously have no control of which ISP and end-user may
choose, although our product will specify that Linux, PHP4, and MySQL4 (or
higher) are installed. The manual says that these are built-in on version
4.0 and above - I just need real-world confirmation from people with
[EMAIL PROTECTED] wrote:
If the minimum requirement of mysql is version 4, then you
will have no problems, as INNODB is the default type in mysql 4.x.x
--
InnoDB is included by default in mysql 4 but the default is still MyISM.
I looked over the manual, and I believe that you are correct.
The
Looking for clarification...
Say that I have a user table and group table -
-- user table --
id username
1 foo
-- group table --
id user_id group_name
1 1group_1
2 1group_2
Would this be the proper way to construct a select statement for this -
select u.username,
John Holmes wrote:
Gerard Samuel wrote:
Looking for clarification...
Say that I have a user table and group table -
-- user table --
id username
1 foo
-- group table --
id user_id group_name
1 1group_1
2 1group_2
Would this be the proper way to construct a select statement
My site/code/database is developed primarily for the english language.
I've had people from The Far East add content to my site using their
native language, and it is displaying properly in the site.
But Im a bit concerned about the number of characters these languages use.
For example, I've had
Robert Twitty wrote:
On Thu, 19 Aug 2004, Gerard Samuel wrote:
Robert Twitty wrote:
Hi
Is anyone using PHP to connect to an IBM DB2 database? The reason why I
am asking is becaouse I want to see if the odbtp extension can be used to
successfully prepare and execute DB2 stored procedures. So far
Robert Twitty wrote:
Hi
Is anyone using PHP to connect to an IBM DB2 database? The reason why I
am asking is becaouse I want to see if the odbtp extension can be used to
successfully prepare and execute DB2 stored procedures. So far, ODBTP
performs quite well with IBM DB2 in regards to regular
On Tuesday 03 August 2004 09:02 am, Robert Twitty wrote:
The odbtp extension has be used quite successfully with DB2. You can get
it at http://odbtp.sourceforge.net. I have not personnally used it with
DB2, but there are posts on odbtp's help forum pertaining to DB2.
-- bob
On Tue, 3 Aug
Is it possible?
Just checking...
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Just looking for opinions on sql injection while using prepared statements.
I've read at the oci8 extention that content should not be escaped
---
Do not use magic_quotes_gpc or addslashes() and oci_bind_by_name()
simultaneously as no quoting is needed and any magically applied quotes will
be
On Friday 25 June 2004 01:03 pm, Hans_L wrote:
Gerard Samuel wrote:
snip
So Im guessing that this is how prepared statements are done on other
databases.
After being trained to do it one way (always escaping bad content), Im
being shown to do it the other way, and Im looking for any
On Wednesday 02 June 2004 02:55 am, David Morel wrote:
What do you mean? SQLite installation is the simplest thing ever!
Change your ISP. Go for a real hosting service.
They sound like they *dont* know how to install it, and *dont* even want to
try.
--
PHP Database Mailing List
A bit off topic, but lately I've been running into situations, where I have
to know about using cursors with databases, like sql server, ibm db2
Can anyone point me to online resources that explains (to a practical newbie)
cursors
Thanks
--
PHP Database Mailing List (http://www.php.net/)
On Tuesday 17 February 2004 04:41 pm, Gerard Samuel wrote:
Currently using sqlite 2.8.11 (distributed by php snaps) with php4.3.5rc2
on windows XP.
Several months ago, I added support for sqlite in a database abstraction
class I created. It worked great then.
Im trying to see if things
On Saturday 17 January 2004 03:17 pm, mayo wrote:
so I would like to write to file on my local box.
I've looked but I don't see how to chmod.
using: windows xp and iis 5
-- gil
1. This is the Database list, stuff like this should go in the General List.
2. chmod only applies to *nix
Im going to CC this to the PostgreSQL list also.
On Friday 12 December 2003 06:44 am, Martin Marques wrote:
El Vie 12 Dic 2003 00:09, Gerard Samuel escribió:
What good is this function?
A quick example of the wall Im running into -
$sql = 'INSERT INTO .';
$result = pg_query($conn_id
On Friday 12 December 2003 10:24 am, Martin Marques wrote:
That is fine and all, but my original example was just an example of the
non functionality of pg_result_error(), not how to handle errors when a
query fails.
But for arguement sake, lets use your example in some dummy code[0].
What good is this function?
A quick example of the wall Im running into -
$sql = 'INSERT INTO .';
$result = pg_query($conn_id, $sql);
if ($result === false)
{
var_dump( pg_result_error( $result ) );
}
According to the manual, pg_result_error takes the result resource.
If that resource is
On Monday 24 November 2003 10:58 am, David Kendal wrote:
Hello! I'm new to to Postgre so excuse me, but is Postgre the same as
MySQL?
Yes and No.
Both are databases. Both can be interfaced to php.
But
Under the hoods of both, are very different.
For more information,
http://www.mysql.com/
On Saturday 22 November 2003 06:43 pm, Bronislav Klucka wrote:
It's realy just benchmark I've done. I'm pretty much aware of system
sqlite is useing to store the data, and I also find obvious that if it
would be runnig like web database module, users will ask the same table ata
the same time
On Thursday 20 November 2003 08:54 pm, Evan Panagiotopoulos wrote:
I am searching a table and have the following php code with my
comments:
$result = mysql_query($query);
print The result == $result;
// it returns The result == Resource id #2
if (!mysql_fetch_array($result)) {
...
} else
(): Sybase: Unable to allocate connection record
in /usr/local/apache2/htdocs/test.php on line 3
I search all the internet, don't find the reason and the solution.
Help, Help me.
Thanks a lot.
Samuel
--
PHP Database Mailing List (http://www.php.net
Maybe in early August, I got my code to work with DB2 8.1.3 via ODBC
after a bit of teeth pulling.
I played with it for about 2-3 weeks, and it seemed ok (slow but ok).
Earlier this past week, I was modifying the DB drivers for my script,
and now, DB2 refuses to cooperate.
I don't remember
Gerard Samuel wrote:
example script
|?php
||// contains db connection stuff|
|include('include.php');
// body is a text field
$sql = 'select id, user_id, name, time, body, ip from NULLID.guestbook
for read only';
$result = odbc_exec($db-_connection_id, $sql);
odbc_longreadlen($result, 0
;)
Gerard Samuel [EMAIL PROTECTED] a écrit dans le message de news:
[EMAIL PROTECTED]
For the most part, I got my code running with IBM DB2 8.1.3
But its slower than dirt. Maybe 1 out of 10 times, a page would exceed
the 30 second time limit.
I understand on a fresh database startup, it takes time
For the most part, I got my code running with IBM DB2 8.1.3
But its slower than dirt. Maybe 1 out of 10 times, a page would exceed
the 30 second time limit.
I understand on a fresh database startup, it takes time to get things
together to run.
But sometimes it would seem like its going fast,
Matt Schroebel wrote:
Gerard Samuel mailto:[EMAIL PROTECTED] wrote on Tuesday, August 19,
2003 2:32 PM:
understand on a fresh database startup, it takes time to get things
together to run. But sometimes it would seem like its going fast, then
othertimes, crawl
slower than snails.
I've found
Robert Twitty wrote:
Unless I am mistaken, but isn't there an ODBC driver available for MySQL
called MyODBC?
-- bob
I haven't a clue. Ill look, maybe it will help me create drivers for my
DB layer, as I already know MySQL.
Last night I successfully connected to IBM's DB2, but I didnt get far
Larry E.Ullman wrote:
Im looking at venturing into working with PHP's ODBC extention.
Does anyone have any recommendations as to a Database, that is easy to
understand/get into from a novice point of view, that installs on
windows 2k,
and is free?
MySQL is kind of free, installs on W2K and is
Most likely its not a PHP issue, but looking to see if anyone has run
into this.
I've inserted a serialized string, into a CLOB column.
Trying to retrieve the column returns no results.
If anyone has any DB2 experience, I'd be grateful if I can bounce a few
questions to you
offlist.
Thanks for
I started playing with DB2 earlier this week.
And come to find out that it creates table names/columns in UPPER case.
Does anyone have any experience using DB2 in a cross platform manner,
with other dbs such as MySQL?
Just looking for ideas, as I've run out of them...
Thanks
--
PHP Database
Gerard Samuel wrote:
Most likely its not a PHP issue, but looking to see if anyone has run
into this.
I've inserted a serialized string, into a CLOB column.
Trying to retrieve the column returns no results.
If anyone has any DB2 experience, I'd be grateful if I can bounce a
few questions
Ok, I figured out my problem. It wasn't the table names in UPPER case,
but the unique id that prepended to the table names that was missing.
Gerard Samuel wrote:
I started playing with DB2 earlier this week.
And come to find out that it creates table names/columns in UPPER case.
Does anyone have
[EMAIL PROTECTED] wrote:
whoops, meant to include
thishttp://www.mysql.com/downloads/api-myodbc-3.51.html
Unless I am mistaken, but isn't there an ODBC driver available for MySQL
called MyODBC?
-- bob
I haven't a clue. Ill look, maybe it will help me create drivers for my
DB
Im looking at venturing into working with PHP's ODBC extention.
Does anyone have any recommendations as to a Database, that is easy to
understand/get into from a novice point of view, that installs on
windows 2k,
and is free?
Thanks for your suggestions.
--
PHP Database Mailing List
With respect to the PHP manual, are there any documentation to using
this extention?
Thanks
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Im trying to figure out a way to emulate mysql's RAND() function to be
cross database compatible via php.
Has anyone done anything similar to this???
Thanks
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Doesn't really cut it when you do not know a min and max value, or want
to extract a random range of numbers.
Becoming Digital wrote:
Im trying to figure out a way to emulate mysql's RAND() function to be
cross database compatible via php.
Has anyone done anything similar to this???
How
Im probably not making myself clear.
Ultimately, my goal is to emulate mysql's -
SELECT * FROM TABLE ORDER BY RAND() LIMIT (X)
for other databases that do not support RAND(). So using variations of
php's rand(), wouldn't make sense,
as it only picks one value out of a range of values, that are
Yes its more than possible to do as you suggested, but as you implied,
not very friendly,
when it comes to large result sets...
Roedel, Mark wrote:
Might it be simpler, since you're assuming the presence of PHP anyway,
to just read your entire result set into an array and then shuffle() it
and
Becoming Digital wrote:
Ultimately, my goal is to emulate mysql's -
SELECT * FROM TABLE ORDER BY RAND() LIMIT (X)
for other databases that do not support RAND().
Which are those?
Currently mySQL, PostgreSQL, and MSSQL.
To me the idea above would work, but it hinges on if that rand
[EMAIL PROTECTED] wrote:
This should be as simple as a PHP script that opens a connection to the
destination server (with rights to do all actions you mentioned)..
Opens a text file with all the SQL commands you want to issue, and starts
firing them off at the server 1 by 1...
Once you create the
Im trying to make an install script that would run under MSSQL.
I could make it either create a database or populate a database.
I can't seem to do both.
Has anyone been able to create and populate a MSSQL database via php in
one shot??
Thanks
--
PHP Database Mailing List (http://www.php.net/)
Please forgive me for being somewhat off topic.
This information is going towards a db class written in php.
Does MSSQL have an SQL command counterpart to mysql's Optimize or
postgresql's Vacuum??
Thanks for any insight you may provide...
--
PHP Database Mailing List (http://www.php.net/)
To
characters, then
a varchar column can be used.
But serialized data can get pretty big, so anticipate for it, by using
text columns.
--
Gerard Samuel
http://www.trini0.org:81/
http://test1.trini0.org:81/
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net
would be greatly appreciated.
Thanks
--
Gerard Samuel
http://www.trini0.org:81/
http://dev.trini0.org:81/
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
] http://www.purplecow.com/
---
--
Gerard Samuel
http://www.trini0.org:81/
http://dev.trini0.org:81/
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Is defaulting a column to NULL considered as a waste of space??
I have a table that has 2 columns (so far) that defualt to NULL, and
potentially,
there can be good amount of rows with NULL. Just wondering...
--
Gerard Samuel
http://www.trini0.org:81/
http://dev.trini0.org:81/
--
PHP Database
to do so.
Thanks
--
Gerard Samuel
http://www.trini0.org:81/
http://dev.trini0.org:81/
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
one can apply Boolean algebra and rationalise the apparent duplication:
WHERE s.wid = sc.wid
AND ( s.word = 'mysql' OR s.word = 'apache' );
As to which is 'right' and which 'wrong', let me ask: which one do you find
most readable?
Regards,
=dn
--
Gerard Samuel
http://www.trini0.org:81/
http
I just found out today that I could find out mysql or postgresql version
# using an sql select statement.
'select version() as version'
It doesn't work for MSSQL. Does anyone know of a way to retrieve
MSSQL's version via php or sql statement.
Thanks.
--
Gerard Samuel
http://www.trini0.org
it does the trick.
-Joni-
--
// Joni Järvinen
// [EMAIL PROTECTED]
// http://www.reactorbox.org/~wandu
Gerard Samuel [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Please forgive me, but Im more versed in FreeBSD than winXP.
WinXP is on my laptop
, along with checking mysql_error().
Miles
At 04:18 PM 8/18/2002 -0400, Gerard Samuel wrote:
Im trying to solve a problem with windows xp.
I have 2 identical scripts with the same db schema. One on FreeBSD
running php 4.2.2/mysql 3.23.49 the other
on windows xp php 4.2.2/mysql 3.23.52
???
Thx.
--
Gerard Samuel
http://www.trini0.org:81/
http://dev.trini0.org:81/
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Me personally, so I can echo out the variable to see if the query is
making sense. Look at it as a debugging...
Brian Graham wrote:
Are there any benefits to assigning a query to a variable?
--
Gerard Samuel
http://www.trini0.org:81/
http://dev.trini0.org:81/
--
PHP Database
--
Gerard Samuel
http://www.trini0.org:81/
http://dev.trini0.org:81/
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
,
--
Samuel Torton
NCSLab.com
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
) ?
-- 2/ run a command line such as htpasswd ... (without -c argument) ? in
this case, can you tell me how to run a unix command line from a PHP script ?
Thanks a lot in advance.
Regards,
--
Samuel Torton
NCSLab.com
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail
] ;
break;
}
}
--
redards,
samuel
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
69 matches
Mail list logo