Hello everybody,
What do you think is the best method to abstract php code from a specific database?.
Make PHP code 100% database independent?..
Waitin' for your comments.
Muhammed Mamedov
Thanks Ricardo for your comments.
What do you think guys: ADODB or PEAR::DB ?
- Original Message -
From: Ricardo Lopes [EMAIL PROTECTED]
To: Muhammed Mamedov [EMAIL PROTECTED]
Sent: Wednesday, January 21, 2004 11:21 AM
Subject: Re: [PHP-DB] Database Abstraction Layer?
You have ADODB
It is not directly PHP but it is Db with PHP/Linux
Linux 2.4.19-4GB
Apache: httpd-2.0.48
php-4.3.4
freetds-0.61.2
I have php pages to connect to MsSQL-2000 server
$conn = mssql_connect($server, $user, $pass)
or die ;
or (PEAR:Db)
$dsn = mssql://$user:[EMAIL PROTECTED]/$dbname;
if
Thanks Chris... that worked great.
No worries.
Guess I need to spend a _lot_ more time reading the manual.
It also helps alot just lurking on the list (this and/or PHP general).
I've been coding with PHP for almost 6 years and there're still new
things I learn all the time.
Chris
--
PHP
There are a couple of products out there that I am about to start testing,
starting first with:
- SQL Relay
http://sqlrelay.sourceforge.net/
This product uses its on C interfaces to interact with DBs and different
programming languages. It addresses a bunch of items in the PHP DB calls.
Oh ya, one more thing, I am going to integrate SQL Relay with the PHP
abstraction layer:
http://sourceforge.net/projects/sqlalphp
to give the functions a more PHP feel to them. Plus, I will be able to
retain DB specific calls if I want with this layer. I have used this layer
with a great deal
I have a site that makes heavy use of a local SQL Server database. Every
6-12 hours the site continuously reports not being able to connect to
the database. That is the only info in the warning that's given. The
only solution I've found is to restart the Apache and MSSQL services.
The [MSSQL]
Hmm..
Thank you for you sql picks:)
But what do you guys think aabout Pear :: DB? Is it as effective as these
Paul's picks?
Thank you.
Muhammed Mamedov
- Original Message -
From: Paul Miller [EMAIL PROTECTED]
To: phpdb [EMAIL PROTECTED]
Sent: Wednesday, January 21, 2004 5:44 PM
Subject:
I have a script called 'login.php' which worked fine until now.
Last dayz i've made a few changes at this script which ones just dealt with
if-expressions.
I've set some vars to values returned by functions and checked (if) these
values afterwards.
Now the execution of this script results in a
Can you give a bit more detail as to what is happening prior to the return
statement?
Brett
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
PEAR is great from what I hear. The issue you are going to run into with DB
independence is not the function calls which could be handled with something
as simple as sqlalphp. It is the SQL calls themselves. The two options I
have found is a SQL library with unembeded SQL or the Propel
Hi.
We run PHP as a DSO through Apache with IBM DB2 support enabled. We want
to be able to run the same PHP DSO module on a second machine that will
not have support for DB2. How can I configure PHP via the configuration
file such that DB2 support is enabled on one host, and not on another?
Le mercredi 21 janvier 2004, 13:55:26 ou environ Alain Barthélemy [EMAIL PROTECTED]
a écrit:
Still another question in my (desperate?) trials to connect to a MsSQL-2000
Server from a Linux host.
I don't work usually with MsSQL but no choice at work. Still problems to have a
connections. I went
Hello,
On 01/21/2004 06:31 AM, Muhammed Mamedov wrote:
What do you think is the best method to abstract php code from a specific database?.
Make PHP code 100% database independent?..
If you really want true portability, you may want to try Metabase or
PEAR::MDB which is a conversion of Metabase
mssql_pconnect() may add to problem of too many connections. The reason
is because the persistent connection is associated with the Apache child
process and not the script. This is significant because you are not
guaranteed to be served by the same child everytime the script is invoked.
Thus,
Maybe you are running out of connections.
-- bob
On Wed, 21 Jan 2004, Stuart wrote:
I have a site that makes heavy use of a local SQL Server database. Every
6-12 hours the site continuously reports not being able to connect to
the database. That is the only info in the warning that's given.
I'm a cold fusion refugee and am having incredible problems with something
that I think is relatively easy -- so I must be missing something basic.
I would like to pull info from a query string and use it inside a database
call.
I can pull the query string into a general variable:
?php echo
I may be misunderstanding you, but your first statement about pulling from a
query string is throwing me.
?php echo $section; ? will only display the value of $section on the screen.
You will need to build a form to get a value into $section.
form action=soemthing.php
input type=text
I have a table displaying data. The column headers are links that allow the
users to order the content in ASC or DESC.
basic version is:
a href=somefile.php?order=ASCTitle/a
a closer to reality version is (or would be if it worked)
a href=somefile.php?order=
if ($order == ASC){
What error is it giving you? What's not happening? Saying 'It doesn't work'
doesn't help much especially when you don't give all the code.
-Micah
On Wed January 21 2004 11:10 am, mayo wrote:
I have a table displaying data. The column headers are links that allow the
users to order the
Looking at that. You are combining html and php without distinguishing
between the two. I am assuming you are in php mode because html wouldn't
give you errors. try this:
echo a href='somefile.php?order=;
if ($order == ASC){
echo DESC;
}else{
echo ASC;
}
echo ';
- Original Message -
my bad: I typed in the script and forgot the echo.
-- gil
-Original Message-
From: Rick Dahl [mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 21, 2004 2:28 PM
To: mayo; [EMAIL PROTECTED]
Subject: Re: [PHP-DB] using query_strings in sql
Looking at that. You are
Hi gang
this is probably ridicously simple, but I'm new at this SQL stuff, so am a
bit stumped.
It's pretty simple: how do I get only the last record from a single table?
Trying to convert my file-based website into DB-based, but can't quite
figure out how to do this simple task.
Table name is
Reverse the order and limit the result to 1.
For example, change:
SELECT date, item from some_table
To:
Select date, item from some_table ORDER BY date DESC LIMIT 1
to get the latest dated item.
-Micah
On Wed January 21 2004 11:49 am, -{ Rene Brehmer }- wrote:
Hi gang
this is probably
good point Micah !! :-)
I don't get an error msg. Nothing happens.
included is the file
Below are the three issues I have with query_strings and sql. The formatting
is of the .php page is awful. I'm not certain it's legible.
1. Main issue -- be able to use a query_string variable in a sql
Here goes:
1) That should work fine. Be sure and enclose the SQL in double quotes or the
variable will not get translated into its value.
2) That's fine too, nothing wrong there.
3) this is wrong, but it looks like you just ommited the SQL statement. Be
sure and use the or die statement as
Le mercredi 21 janvier 2004, 13:07:24 ou environ Robert Twitty [EMAIL PROTECTED] a
écrit:
mssql_pconnect() may add to problem of too many connections. The reason
is because the persistent connection is associated with the Apache child
process and not the script. This is significant because
Le Wednesday 21 January 2004, 12:54:18 ou environ Robert Twitty [EMAIL PROTECTED] a
écrit:
Hi again Bob,
It was about 13h00 (13 pm) when you sent this mail and about 8 pm here. Thus
give me time to go back to work tomorrow morning and to study the question. If
interested I contact again.
Good
oops. I guess I was too loose with my words ---
something does happen, just not what I want! :-)
The page displays. The sql works, the or die doesn't return anything.
I'm able to change the sql by changing the default values.
WHAT DOESN'T HAPPEN is that the query_string values DO NOT trump
snip
WHAT DOESN'T HAPPEN is that the query_string values DO NOT trump the
default
variables.
so query_string = ?class=Xsection=Yorder=ASC
I can't input these variables : $class,$section,$order into the SQL
statement
SELECT *
FROM classes
WHERE section=$section
ORDER BY $class $order
/snip
I am
You may have register Globals turned off in php.ini.
Try adding:
extract($_GET)
in the code before the function gets called. That's not a very secure method,
but it will prove whether or not that's the problem.
-Micah
On Wed January 21 2004 12:43 pm, mayo wrote:
oops. I guess I was too
brother that was it
at least as far as putting a query_string variable into a sql statement.
thx
I'll have to see how it works regarding if-else clauses
-gil
-Original Message-
From: Matt Matijevich [mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 21, 2004 3:53 PM
it works
thx Micah (and Matt)
I have no knowledge (YET) of how to prevent sql injection attacks with php.
For this project I'm not too concerned as it is in a password protected area
and only 2 or 3 people have access to it.
I hope this works with the rest of the issues...
:-)
-- gil
snip
I have no knowledge (YET) of how to prevent sql injection attacks with
php.
/snip
Just yesterday I read a short tutorial on http://www.dotgeek.org on how
to prevent sql injection.
The site is down right now for maintenance otherwise I would have a
direct link to the article for you.
try
thx a bunch :) ... figured it would be something simple ... :p
Rene
Fate would have it, that on Wed, 21 Jan 2004 11:55:23 -0800, Micah Stevens
wrote:
Reverse the order and limit the result to 1.
For example, change:
SELECT date, item from some_table
To:
Select date, item from some_table
ok im making this page and every single time i try to execute it, it tells me it was
not successful. the database name, user,pw,and local host are all correct. i have no
idea what do do, and i have 2 more tables besides this one i wanted to create but this
was kind of my template for it and i
mysql_db_query ($dbname,$query,$link) or die(myself_error());
will help you more than your if/then statement.. change that, and check out
the error message.
On Wed January 21 2004 2:33 pm, js wrote:
ok im making this page and every single time i try to execute it, it tells
me it was not
Hi,
I have an question on how to create a completely database / xml driven site
i.e. the page names, links, the site map etc are held in the database. I
think I have solved most problems but what I would really like to do is
limit the number of pages I need. Can I manipulate the server such that
ok i did the mysql_error DIE thing, and now it tells me this:
You have an error in your SQL syntax near 'UNSIGNED, name VARCHAR(255) NOT NULL, login
VARCHAR(10) NOT NULL, password' at line 2
i have no idea what it means. i dont think any of those are taken or reserved by PHP
or mySQL. any
Hello,
On 01/21/2004 08:52 PM, Shaun wrote:
I have an question on how to create a completely database / xml driven site
i.e. the page names, links, the site map etc are held in the database. I
think I have solved most problems but what I would really like to do is
limit the number of pages I
js wrote:
You have an error in your SQL syntax near 'UNSIGNED,
name VARCHAR(255) NOT NULL, login VARCHAR(10) NOT NULL,
password' at line 2
Print (echo) out your entire query. You have a syntax error before the
point the error message mentions.
--
---John Holmes...
Amazon Wishlist:
I'm having a problem with retrieving field data from SQL SERVER 2000 and am
not sure where the problem lies. I have a variable length field (from 100 -
1 characters). When I retrieve the field using a select statement, then
into a PHP variable such as $text=$r['body_text'], then the field
John,
I'm getting much more than 255 characters. The field is not varchar but a
text field. I've looked into FREETDS as the most likely source of the
problem but haven't found anything yet.
Michael
Michael Lewis wrote:
I'm having a problem with retrieving field data from SQL SERVER 2000 and
You may need to set mssql.textlimit to a value greater than the default of
4096 characters.
-- bob
On Wed, 21 Jan 2004, Michael Lewis wrote:
John,
I'm getting much more than 255 characters. The field is not varchar but a
text field. I've looked into FREETDS as the most likely source of the
44 matches
Mail list logo