[PHP-DB] compare between range

2007-11-12 Thread lameck kassana
hey i have database called timetable in mysql the fields are

 starttimeendtime
 19  21
 15  16

suppose i want to insert want to insert new starttime 17 to endtime 21 from
php script .How will  try to compare my range with my database range .


   thanks for advance.

laskkkassana


[PHP-DB] pdo_firebird: RETURNING patch (Bug #43246)

2007-11-12 Thread Hans-Peter Oeri
Hi!

I have bug #43246 open and just posted a patch comment there. As I
don't know how to (or cannot) upload patches in the bug system.

The problem is:
Queries ending in RETURNING ... get qualified as stored procedure
calls. Contrary to the docs, the PDOStatement-execute call is returning
the stored procedure's return value...

Just eliminating this undocumented behaviour clears the problem!

As I don't assume authority in php internals, the attached patch
(against CVS PHP_5_3) only out-ifdefs the corrupt parts.

Greets
HPO
diff -u php5-orig/ext/pdo_firebird/firebird_statement.c 
php5/ext/pdo_firebird/firebird_statement.c
--- php5-orig/ext/pdo_firebird/firebird_statement.c 2007-11-12 
16:59:34.0 +0100
+++ php5/ext/pdo_firebird/firebird_statement.c  2007-11-12 16:58:46.0 
+0100
@@ -99,11 +99,15 @@

/* assume all params have been bound */

+#if 0
if ((S-statement_type == isc_info_sql_stmt_exec_procedure 
isc_dsql_execute2(H-isc_status, H-tr, 
S-stmt, PDO_FB_SQLDA_VERSION,
S-in_sqlda, S-out_sqlda))
|| isc_dsql_execute(H-isc_status, H-tr, 
S-stmt, PDO_FB_SQLDA_VERSION,

S-in_sqlda)) {
+#else
+   if (isc_dsql_execute(H-isc_status, H-tr, S-stmt, 
PDO_FB_SQLDA_VERSION, S-in_sqlda)) {
+#endif
break;
}

@@ -138,9 +142,11 @@

/* an EXECUTE PROCEDURE statement can be fetched from once, 
without calling the API, because
 * the result was returned in the execute call */
+#if 0
if (S-statement_type == isc_info_sql_stmt_exec_procedure) {
S-exhausted = 1;
} else {
+#endif
if (isc_dsql_fetch(H-isc_status, S-stmt, 
PDO_FB_SQLDA_VERSION, S-out_sqlda)) {
if (H-isc_status[0]  H-isc_status[1]) {
RECORD_ERROR(stmt);
@@ -148,7 +154,9 @@
S-exhausted = 1;
return 0;
}
+#if 0
}
+#endif
return 1;
}
return 0;

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

[PHP-DB] pdo_firebird: PDOStatement-closeCursor

2007-11-12 Thread Hans-Peter Oeri
Hi!

I fell out of bed as I noticed that PDOStatement-closeCursor is not
implemented for pdo_firebird.

Again, I'm not a php guru, but patched my version with the attached diff.

HPO
--- php5-orig/ext/pdo_firebird/firebird_statement.c 2007-11-12 
21:54:13.0 +0100
+++ php5/ext/pdo_firebird/firebird_statement.c  2007-11-12 21:51:03.0 
+0100
@@ -621,6 +620,22 @@
 }
 /* }}} */

+static int firebird_stmt_cursor_closer(pdo_stmt_t *stmt TSRMLS_DC) /* {{{ */
+{
+   pdo_firebird_stmt *S = (pdo_firebird_stmt*)stmt-driver_data;
+   int result = 1;
+
+   /* close the statement */
+   if (isc_dsql_free_statement(S-H-isc_status, S-stmt, DSQL_close)) {
+   RECORD_ERROR(stmt);
+   result = 0;
+   }
+
+   return result;
+}
+/* }}} */
+
+
 struct pdo_stmt_methods firebird_stmt_methods = { /* {{{ */
firebird_stmt_dtor,
firebird_stmt_execute,
@@ -629,7 +644,10 @@
firebird_stmt_get_col,
firebird_stmt_param_hook,
firebird_stmt_set_attribute,
-   firebird_stmt_get_attribute
+   firebird_stmt_get_attribute,
+   NULL,
+   NULL,
+   firebird_stmt_cursor_closer
 };
 /* }}} */

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

Re: [PHP-DB] pdo_firebird: PDOStatement-closeCursor

2007-11-12 Thread Chris

Hans-Peter Oeri wrote:

Hi!

I fell out of bed as I noticed that PDOStatement-closeCursor is not
implemented for pdo_firebird.

Again, I'm not a php guru, but patched my version with the attached diff.


I highly doubt anyone on the php-db list is going to run a cvs checkout 
version with random patches.


If you want to get these included in the main code, you need to join the 
internals list and explain to them what/why/how/whatever else they want 
to know.


--
Postgresql  php tutorials
http://www.designmagick.com/

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



[PHP-DB] Front Base on PHP

2007-11-12 Thread Martin
I've been trying to build PHP with the Front Base interface
on a 64 bit system. Can this be done or am I going to have
to go back to a 32 bit install?

--
http://blameitonlove.com/

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



[PHP-DB] mysql_real_escape_string()

2007-11-12 Thread Ron Piggott
Last week the server my web site hosting company uses went down (along
with a bunch of other servers)  My files have been moved to another
server the company uses.  I am in the midst of configuring my site for
the new server.

Before the server went down I wasn't getting error messages.  I know my
PHP code is ok.  The new server is configured slightly differently.  The
server is set up with the following:

Operating system Linux
Kernel version 2.4.21-47.0.1.ELsmp
Apache version 1.3.33 (Unix)
PHP version 4.3.10
MySQL version 4.1.22-standard

I am tweaking my site to make it work.  

My actual question is this line of code:

$other = mysql_real_escape_string($other);

is giving me this error message:

Warning: mysql_real_escape_string(): Access denied for user
'nobody'@'localhost' (using password: NO) in /path/to/file/file.php on
line 148

Warning: mysql_real_escape_string(): A link to the server could not be
established in /path/to/file/file.php on line 148

I understand the error message and the request an open connection to the
database.  

Where the previous server didn't require this I am wondering if there is
a line I may add to my .htaccess to by-pass this requirement.  My
concern is that if I don't find all the instances I will have errors on
my site ... this is extensive to correct.  

Suggestions?

Ron

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



Re: [PHP-DB] mysql_real_escape_string()

2007-11-12 Thread Chris



My actual question is this line of code:

$other = mysql_real_escape_string($other);

is giving me this error message:

Warning: mysql_real_escape_string(): Access denied for user
'nobody'@'localhost' (using password: NO) in /path/to/file/file.php on
line 148

Warning: mysql_real_escape_string(): A link to the server could not be
established in /path/to/file/file.php on line 148


You need to connect to the database before you can use 
mysql_real_escape_string so it can work out database encoding etc.



Where the previous server didn't require this I am wondering if there is
a line I may add to my .htaccess to by-pass this requirement.  My
concern is that if I don't find all the instances I will have errors on
my site ... this is extensive to correct.  


You could try using auto_prepend_file (see 
http://www.php.net/manual/en/ini.core.php).


--
Postgresql  php tutorials
http://www.designmagick.com/

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