[PHP-DB] Re: PostgreSQL

2004-09-29 Thread Stefan Reimers
M Saleh Eg wrote:
Any Idea about where I'd get an installer version of PostgreSQL for windows?
Wow, I recently had a project working on PostgreSQL.
For local development we installed cygwin on WIN and tried to keep that 
working.
How long does that installer exist?
Nevertheless, thx for the link, I reported it to my successors on the 
project.

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


[PHP-DB] Capturing a sql query

2004-09-29 Thread Stuart Felenstein
I'm trying to capture a sql query and save it to the
database.  Not as a stored procedure , more a URL
parameter string , to be called up at will.

I have this code that I believe will take the URL,
just not sure how to go about grabbing it.  I think
maybe a hidden form with POST.  

I'm open to any ideas or help. :)

$ReturnPage = isset($_SERVER[REQUEST_URI]) ?
$_SERVER[REQUEST_URI] : ;
if(!strlen($ReturnPage)) {
$ReturnPage = isset($_SERVER[SCRIPT_NAME]) ?
$_SERVER[SCRIPT_NAME] : ;
$QueryString = CCGetQueryString(QueryString, );
if($QueryString !== )
$ReturnPage .= ? . $QueryString;

Thank you,
Stuart

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



[PHP-DB] I have a query

2004-09-29 Thread Mulley, Nikhil
I have a query regarding mysql and PHP ...
here it is 
I know there is a field data exisiting in one of the tables in the present database;
 
I want to know whether there is any sql or PHP function with which I can find out in 
which table the field data is present for example .
 
 
I have database called asset
in which 5 table are present namely asset1,asset2,asset3,asset4,asset5...
 
all the tables have the same schema structure and common field names ,equal no of 
columns(but not the equal number of rows)
 
I want to know ,in which table among the above is having a particular field data for 
example ...the column name is asset_loc ( common for all the tables,but no constraints 
,no relation with other tables)
 
I want to know if the asset_loc from any table has the data 'heaven'
 
it should be something like this
select * from asset1,asset2,asset3,asset4,asset5 where asset_loc='heaven';
 
 
 
Thanks, waiting for a quick response from a great list.
 
SELECT * FROM Linux_kids where Dis_Hard_Fans='Nikhil' ;-)
 
 


Re: [PHP-DB] Capturing a sql query

2004-09-29 Thread Stuart Felenstein
Let me explain what I'm trying to emulate.  
If you have seen any of the major job boards, they
allow you to save search agents.  Those agents at
least on Monster, Dice, HotJobs I think , spare you
the hassle of going to the search page and reentering
the criteria. 
The agents can act in various ways:
1-If you are on the site , you can execute from there.
2-You can also have it emailed and that comes in two
flavors.
a- the query is run for you and the results are sent
in an email
b-an email goes out with a link to a page, you hit
view (on Monster) and your agent returns results.

My only guess is that the query is what's being
grabbed and saved. You raise a good point about
security , but users don't actually get to see the
query.  All they are getting is the results , from the
one they decided to save.

Stuart
--- Joseph Crawford [EMAIL PROTECTED] wrote:

 i am sorry but i would never post a querystring
 along with a form i
 mean doing that and processing it will open your
 site to
 vulnerabilities.
 
 yes you could do it as a post variable and a hidden
 field but that
 doesnt stop people from saving the html document to
 thier computer
 altering the query and then submitting the form, i
 guess you could add
 a check to make sure that the refering page is
 yourdomain.com but if i
 am correct this could open up a world of trouble.
 
 If however i am wrong someone please respond and
 correct me :)
 
 
 -- 
 Joseph Crawford Jr.
 Codebowl Solutions
 [EMAIL PROTECTED]
 802-558-5247
 
 For a GMail account
 contact me OFF-LIST
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 

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



Re: [PHP-DB] Capturing a sql query

2004-09-29 Thread Joseph Crawford
Stuart,

in this case what i would do is store the keywords, when they are on
the site they can click thier saved searches and it will basically do
an auto search with the saved keywords.  For the email way i think
they probably save the keywords as well but are using a cron job to
fetch the results and form the email.

Let me take a look at one of these sites to see what exactly you want
and can give a better explanation.


-- 
Joseph Crawford Jr.
Codebowl Solutions
[EMAIL PROTECTED]
802-558-5247

For a GMail account
contact me OFF-LIST

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



RE: [PHP-DB] I have a query

2004-09-29 Thread Bastien Koert
if the tables have the same structure, use the union operator to query each 
table separately and return it all in one result set

select * from asset1 where asset_loc='heaven'
union
select * from asset2 where asset_loc='heaven'
union
select * from asset3 where asset_loc='heaven'
union
select * from asset4 where asset_loc='heaven'
union
select * from asset5 where asset_loc='heaven'
bastien


From: Mulley, Nikhil [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: [PHP-DB] I have a query
Date: Wed, 29 Sep 2004 23:19:31 +0530
I have a query regarding mysql and PHP ...
here it is 
I know there is a field data exisiting in one of the tables in the present 
database;

I want to know whether there is any sql or PHP function with which I can 
find out in which table the field data is present for example .

I have database called asset
in which 5 table are present namely asset1,asset2,asset3,asset4,asset5...
all the tables have the same schema structure and common field names ,equal 
no of columns(but not the equal number of rows)

I want to know ,in which table among the above is having a particular field 
data for example ...the column name is asset_loc ( common for all the 
tables,but no constraints ,no relation with other tables)

I want to know if the asset_loc from any table has the data 'heaven'
it should be something like this
select * from asset1,asset2,asset3,asset4,asset5 where asset_loc='heaven';

Thanks, waiting for a quick response from a great list.
SELECT * FROM Linux_kids where Dis_Hard_Fans='Nikhil' ;-)

_
Take advantage of powerful junk e-mail filters built on patented Microsoft® 
SmartScreen Technology. 
http://join.msn.com/?pgmarket=en-capage=byoa/premxAPID=1994DI=1034SU=http://hotmail.com/encaHL=Market_MSNIS_Taglines 
 Start enjoying all the benefits of MSN® Premium right now and get the 
first two months FREE*.

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


[PHP-DB] Re: Convert plain text to HTML tagged text

2004-09-29 Thread Felipe Alcacibar
if the returnns are \n you only need nl2br(this \n test \n)... or
preg_replace(/((\r|\n)|(\r\n|\n\r))/, br /, this \r\n test \r\n)...
good luck...


[EMAIL PROTECTED] escribió en el mensaje
news:[EMAIL PROTECTED]
cast.net...
 To the list:

 I've googled and searched the manual, but I'm still looking for a simple
solution to a simple problem.

 I have a MySQL database of text stories in longtext MySQL fields. These
stories have simple returns (\r) in them and no other formatting. I need to
use these stories both for web and print production, so I need to be able to
get the text out of MySQL via PHP and have those returns change to P tags.
But I also need to keep those extra P tags out of the database file so the
text can be exported and poured into a layout program.

 HTMLspecialchars and HTMLentities don't seem like the right solution, but
maybe I'm missing something. Do I have to use regular expressions in PHP as
the text is pulled from the database?

 Thanks in advance for your help.

 --veditio

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



RE: [PHP-DB] I have a query

2004-09-29 Thread Hutchins, Richard
Just an addendum to Bastien's post:

You'll need MySql 4.0+ if you want to use UNION.


 -Original Message-
 From: Bastien Koert [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, September 29, 2004 2:15 PM
 To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Subject: RE: [PHP-DB] I have a query
 
 
 
 if the tables have the same structure, use the union operator 
 to query each 
 table separately and return it all in one result set
 
 select * from asset1 where asset_loc='heaven'
 union
 select * from asset2 where asset_loc='heaven'
 union
 select * from asset3 where asset_loc='heaven'
 union
 select * from asset4 where asset_loc='heaven'
 union
 select * from asset5 where asset_loc='heaven'
 
 bastien
 
 
 
 
 From: Mulley, Nikhil [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] I have a query
 Date: Wed, 29 Sep 2004 23:19:31 +0530
 
 I have a query regarding mysql and PHP ...
 here it is 
 I know there is a field data exisiting in one of the tables 
 in the present 
 database;
 
 I want to know whether there is any sql or PHP function with 
 which I can 
 find out in which table the field data is present for example .
 
 
 I have database called asset
 in which 5 table are present namely 
 asset1,asset2,asset3,asset4,asset5...
 
 all the tables have the same schema structure and common 
 field names ,equal 
 no of columns(but not the equal number of rows)
 
 I want to know ,in which table among the above is having a 
 particular field 
 data for example ...the column name is asset_loc ( common 
 for all the 
 tables,but no constraints ,no relation with other tables)
 
 I want to know if the asset_loc from any table has the data 'heaven'
 
 it should be something like this
 select * from asset1,asset2,asset3,asset4,asset5 where 
 asset_loc='heaven';
 
 
 
 Thanks, waiting for a quick response from a great list.
 
 SELECT * FROM Linux_kids where Dis_Hard_Fans='Nikhil' ;-)
 
 
 
 _
 Take advantage of powerful junk e-mail filters built on 
 patented Microsoft(r) 
 SmartScreen Technology. 
 http://join.msn.com/?pgmarket=en-capage=byoa/premxAPID=1994;
 DI=1034SU=http://hotmail.com/encaHL=Market_MSNIS_Taglines 
   Start enjoying all the benefits of MSN(r) Premium right now 
 and get the 
 first two months FREE*.
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 

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



Re: [PHP-DB] I have a query

2004-09-29 Thread Joseph Crawford
 I have database called asset
 in which 5 table are present namely asset1,asset2,asset3,asset4,asset5...
 
 all the tables have the same schema structure and common field names ,equal no of 
 columns(but not the equal number of rows)

why on earth would you do this?
rather i would create a database named site or something and a table
called asset_groups, here i would have
id (int 11 auto_increment primary_key)
title (varchar 50)

this is where i would store Asset1, Asset2 etc...

i would then have a table called assets and have that be sturectured like so
id (int 11 auto_increment primary_key)
asset (int 11) (ID of the asset_group)
whatever else you want for column names.

$result = mysql_query(SELECT id, title FROM asset_groups as ag INNER
JOIN assets a ON ag.id=a.asset WHERE a.asset_loc='heaven');
while($data=mysql_fetch_array($result)) {
// returned a row, display it or whatever
}
$result = null;
$data = null;

this would return a row containing everything you want and would allow
you to loop through the rows so you can display them or whatever


-- 
Joseph Crawford Jr.
Codebowl Solutions
[EMAIL PROTECTED]
802-558-5247

For a GMail account
contact me OFF-LIST

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



[PHP-DB] Names with apostrophe's

2004-09-29 Thread Craig Hoffman
Hello,
I could use some help here.  I have an entry in the MySQL, that use an  
apostrophe,  for example lets call it O'Reilly.  I have added  
addslashes to my insert statement so MySQL accepts it with out  
complaining.

The problem I am having is I use this information O'Reilly in a GET  
URL somewhere else in the site.
For example here's my link:
echo(tda  
href='user_book_results_detail.php?book=$row[book]$row[book]/a/ 
td);

When I mouse over and view the URL, PHP thinks the apostrophe (single  
quote) is the end and quits.   I know I need to include a back slash or  
escape this character  but I am not entirely sure how I do it?
Suggestions?

Sample URL:
http://user_book_results_detail.php?book=O
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] Names with apostrophe's

2004-09-29 Thread Matt M.
 echo(tda
 href='user_book_results_detail.php?book=$row[book]$row[book]/a/
 td);

http://us4.php.net/urlencode

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



RE: [PHP-DB] Names with apostrophe's

2004-09-29 Thread Gryffyn, Trevor
Try:

Echo tda
href=\user_book_results_detail.php?book=$row[book]\$row[book]\/a/t
d;

I'm dubious on the $row[book] bit took, maybe you meant $row[book] or
$row[$book].

Anyway, you didn't have a closing quote on the HREF, you don't need the
( and ) on the echo, you used the ' instead of  for the HREF (which is
probably allowed but I don't like it myself).

As for apostrophes, you should be able to escape them with \'

If you use ' to start an echo or href, then another ' is going to close
it.  If you use  to open an echo or href, then the ' should go through
ok, or maybe require a \' but should still be ok.

When you insert apostrophes into a database, use '' to escape it (I
believe that works in MySQL as well as other DBs), don't use \' when
inserting into a DB.

Your question is a little cloudy, but maybe that helped clarify a few
things for you.

-TG

 -Original Message-
 From: Craig Hoffman [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, September 29, 2004 2:23 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] Names with apostrophe's 
 
 
 Hello,
 I could use some help here.  I have an entry in the MySQL, 
 that use an  
 apostrophe,  for example lets call it O'Reilly.  I have added  
 addslashes to my insert statement so MySQL accepts it with out  
 complaining.
 
 The problem I am having is I use this information O'Reilly 
 in a GET  
 URL somewhere else in the site.
 For example here's my link:
 echo(tda  
 href='user_book_results_detail.php?book=$row[book]$row[book]/a/ 
 td);
 
 When I mouse over and view the URL, PHP thinks the apostrophe 
 (single  
 quote) is the end and quits.   I know I need to include a 
 back slash or  
 escape this character  but I am not entirely sure how I do it?
 Suggestions?
 
 Sample URL:
 http://user_book_results_detail.php?book=O
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 

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



Re: [PHP-DB] Capturing a sql query

2004-09-29 Thread Joseph Crawford
they are doing exactly what i thought on monster.com
here is an example url to save an agent


http://my.monster.com/modifyagents.asp?bq=programming+PHP+MySQL/bcn=lid=fn=554sort=rvvw=bcy=USbrd=1%2C1862%2C1863from=jssavesearch=on

the bold part above are the keywords searched for

it will basically save these into a database record and use a cron job
to pull the latest matches and send the emails.  also it just uses
those keywords when you use that agent on thier site.


-- 
Joseph Crawford Jr.
Codebowl Solutions
[EMAIL PROTECTED]
802-558-5247

For a GMail account
contact me OFF-LIST

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



Re: [PHP-DB] Capturing a sql query

2004-09-29 Thread Stuart Felenstein
Joseph,

So the cron job is where the rest of the query
statement resides ? What I know about cron is that
it's a way to schedule processes.  But my point /
question is , how are the keywords finding their way
back into the statement.

Thank you,
Stuart
--- Joseph Crawford [EMAIL PROTECTED] wrote:

 they are doing exactly what i thought on monster.com
 here is an example url to save an agent
 
 

http://my.monster.com/modifyagents.asp?bq=programming+PHP+MySQL/bcn=lid=fn=554sort=rvvw=bcy=USbrd=1%2C1862%2C1863from=jssavesearch=on
 
 the bold part above are the keywords searched
 for
 
 it will basically save these into a database record
 and use a cron job
 to pull the latest matches and send the emails. 
 also it just uses
 those keywords when you use that agent on thier
 site.
 
 
 -- 
 Joseph Crawford Jr.
 Codebowl Solutions
 [EMAIL PROTECTED]
 802-558-5247
 
 For a GMail account
 contact me OFF-LIST
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 

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



Re: [PHP-DB] Re: switch, if, or something to choose queries and echo formatting--PLEASE help

2004-09-29 Thread Antoine
did that fix it?


On Sun, 26 Sep 2004 18:56:59 +0200, Antoine [EMAIL PROTECTED] wrote:
  a href=subsections.php?section=design?page=animationimage/a
 
 
 I have just been testing and looking on a few fora (I know very little
 about php and html still) but you have two ?'s in that url. I believe
 the second one needs to be a . I did a little test of your logic and
 it seems to work if the second is replaced with the , but not if left
 as ?.
 
 
 Cheers
 Antoine
 
 --
 G System, The Evolving GUniverse - http://www.g-system.at
 



-- 
G System, The Evolving GUniverse - http://www.g-system.at

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



Re: [PHP-DB] Names with apostrophe's

2004-09-29 Thread GH
You need to use the urlencode() function



On Wed, 29 Sep 2004 13:23:07 -0500, Craig Hoffman [EMAIL PROTECTED] wrote:
 Hello,
 I could use some help here.  I have an entry in the MySQL, that use an
 apostrophe,  for example lets call it O'Reilly.  I have added
 addslashes to my insert statement so MySQL accepts it with out
 complaining.
 
 The problem I am having is I use this information O'Reilly in a GET
 URL somewhere else in the site.
 For example here's my link:
 echo(tda
 href='user_book_results_detail.php?book=$row[book]$row[book]/a/
 td);
 
 When I mouse over and view the URL, PHP thinks the apostrophe (single
 quote) is the end and quits.   I know I need to include a back slash or
 escape this character  but I am not entirely sure how I do it?
 Suggestions?
 
 Sample URL:
 http://user_book_results_detail.php?book=O
 
 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


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



[PHP-DB] getenv() alternative

2004-09-29 Thread Philip Thompson
Hi all.
I am needing to obtain the IP address of a user who logs into the 
system. I tried to use `getenv(REMOTE_ADDR)`, however, this function 
does not work in ISAPI mode, which is what I am running.

Is there an alternative to obtaining the IP address? I have looked 
around, but I cannot seem to find anything.

Thanks in advance,
~Philip
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Re: getenv() alternative

2004-09-29 Thread Philip Thompson
Oh, before I get a slew of emails about this one, I think I figured it 
out: $_SERVER['REMOTE_ADDR']

I knew it couldn't have been that difficult... brain fart! Sorry for 
wasting your time.

~Philip
On Sep 29, 2004, at 5:02 PM, Philip Thompson wrote:
Hi all.
I am needing to obtain the IP address of a user who logs into the 
system. I tried to use `getenv(REMOTE_ADDR)`, however, this function 
does not work in ISAPI mode, which is what I am running.

Is there an alternative to obtaining the IP address? I have looked 
around, but I cannot seem to find anything.

Thanks in advance,
~Philip
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] rand()

2004-09-29 Thread Jennifer Goodie
-- Original message from blackwater dev : -- 
 select * from clients order by RAND() 
 
 THe query runs fine on my local server but when I run it on my hosts 
 server, it works ok if there is only one record in the db but then 
 there is more than one...I get this error: 
 
 #1 - Can't create/write to file '/var/tmp/#sqlbe_1d99_0.MYI' (Errcode: 2) 
 
 What's going on? 

perror 2 returns Error code   2:  No such file or directory

Does /var/tmp exist on the server?

If you run explain on your query in both cases (with one record and with more than one 
record) you will see that when there is more than one record it is probably using 
temporary tables and file sort, but is not when there's only one record.

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



[PHP-DB] ip address

2004-09-29 Thread balwantsingh
i tried the $_SERVER['REMOTE_ADDR'] it is giving ip address of server which
is hosting the webpage not the user's ip address.   pls. suggest how can IP
address of an user can be obtained.

with best wishes
balwant

-Original Message-
From: Philip Thompson [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 30, 2004 3:45 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Re: getenv() alternative


Oh, before I get a slew of emails about this one, I think I figured it
out: $_SERVER['REMOTE_ADDR']

I knew it couldn't have been that difficult... brain fart! Sorry for
wasting your time.

~Philip

On Sep 29, 2004, at 5:02 PM, Philip Thompson wrote:

 Hi all.

 I am needing to obtain the IP address of a user who logs into the
 system. I tried to use `getenv(REMOTE_ADDR)`, however, this function
 does not work in ISAPI mode, which is what I am running.

 Is there an alternative to obtaining the IP address? I have looked
 around, but I cannot seem to find anything.

 Thanks in advance,
 ~Philip


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

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