Re: [PHP-DB] question about '

2003-07-11 Thread Chris Payne
Hi there,

The problem is the data is already in the DB, it was mass-added with the '
already there, what I need is a way to retrieve the ' that is already in the
DB.

Thanks

Chris

> yes, by adding stripslashes it will somewhat escape those quotes ('),
> but when displaying the results there will not be any need to do so.
> unless it is your wish to actually store the backslash into the db.
>
>
> Jerry wrote:
>
> >I think you should use addslashes to store the text in the database and
> >then stripslashes when displaying the text.  I think that should work,
> >but I'm new to PHP so I might be wrong.
> >
> >Jerry
> >
> >-Original Message-
> >From: Chris Payne [mailto:[EMAIL PROTECTED]
> >Sent: Saturday, July 12, 2003 2:11 PM
> >To: php
> >Subject: [PHP-DB] question about '
> >
> >
> >Hi there everyone,
> >
> >I am having alittle problem.  I am calling some text that has a ' in it
> >in the DB, but when it is being displayed on the screen the ' becomes a
> >? any ideas?  I'm displaying just with a  and everything
> >works great except that.  I just read about addslashes and stripslashes
> >etc . but not sure if that's relevant to this being that the data in
> >the DB has a single ' already there.
> >
> >Anyway help would be appreciated :-)
> >
> >Regards
> >
> >Chris
> >
> >
> >
> >
>
>


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



Re: [PHP-DB] question about '

2003-07-11 Thread Shahmat Dahlan
yes, by adding stripslashes it will somewhat escape those quotes ('), 
but when displaying the results there will not be any need to do so. 
unless it is your wish to actually store the backslash into the db.

Jerry wrote:

I think you should use addslashes to store the text in the database and
then stripslashes when displaying the text.  I think that should work,
but I'm new to PHP so I might be wrong.
Jerry

-Original Message-
From: Chris Payne [mailto:[EMAIL PROTECTED] 
Sent: Saturday, July 12, 2003 2:11 PM
To: php
Subject: [PHP-DB] question about '

Hi there everyone,

I am having alittle problem.  I am calling some text that has a ' in it
in the DB, but when it is being displayed on the screen the ' becomes a
? any ideas?  I'm displaying just with a  and everything
works great except that.  I just read about addslashes and stripslashes
etc . but not sure if that's relevant to this being that the data in
the DB has a single ' already there.
Anyway help would be appreciated :-)

Regards

Chris

 



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


RE: [PHP-DB] question about '

2003-07-11 Thread Jerry
I think you should use addslashes to store the text in the database and
then stripslashes when displaying the text.  I think that should work,
but I'm new to PHP so I might be wrong.

Jerry

-Original Message-
From: Chris Payne [mailto:[EMAIL PROTECTED] 
Sent: Saturday, July 12, 2003 2:11 PM
To: php
Subject: [PHP-DB] question about '


Hi there everyone,

I am having alittle problem.  I am calling some text that has a ' in it
in the DB, but when it is being displayed on the screen the ' becomes a
? any ideas?  I'm displaying just with a  and everything
works great except that.  I just read about addslashes and stripslashes
etc . but not sure if that's relevant to this being that the data in
the DB has a single ' already there.

Anyway help would be appreciated :-)

Regards

Chris


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



[PHP-DB] question about '

2003-07-11 Thread Chris Payne
Hi there everyone,

I am having alittle problem.  I am calling some text that has a ' in it in the DB, but 
when it is being displayed on the screen the ' becomes a ? any ideas?  I'm displaying 
just with a  and everything works great except that.  I just read about 
addslashes and stripslashes etc . but not sure if that's relevant to this being 
that the data in the DB has a single ' already there.

Anyway help would be appreciated :-)

Regards

Chris

[PHP-DB] Why old session poping up in new Browser window

2003-07-11 Thread Sourabh G
Hi,

Session problem.

I am getting a weird session problem in my site.

Background of the Problem:
--
My site use sessions for user authentication. Site has a Admin Panel where
admin can search users and then through a link

(which has login and password appended) login as user.

On login as user, session var changes to the new user vars, like user id
etc. So, if some one try to access any thing on

admin panel, they get error which is quite evident why is that happened. The
login user is not a admin any more, its a normal

user with no privilege.

I came to a conclusion that if I spawn new browser window it takes old
session. After trying for hours, I was able to solve

this. I started a new session when I login as user by setting session name
and storing the other vars. This way I can start

the session as needed.

After solving this problem I thought I am done. But some thing really weird
popped up. The links on the page, like "My

Account", "Change Password" goes to admin when I click them. This looks like
on clicking the link, Old admin session becoming

active and showing the page as a admin. I have no idea why is that
happening. I have searched goggle but no result.

Is it a browser issue, or php issue, or I am doing something wrong.


* I have compiled PHP with trans-sid option.
** I store session in my sql database. I can see the user session active.

Ideal Solution:-)
--

When I search the user and login as user. Both admin and user session remain
alive and I can work on both windows seamlessly.

Can Any one point me in the right direction.

Thanks




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



Re: [PHP-DB] AAAAGGGGHHH!!! Help!!

2003-07-11 Thread Peter Beckman
I think: change "id" to visitor_id

If it still doesn't work, make sure date_sub and created are of the same
type -- created must be in "-mm-dd hh:mm:ss" format (datetime type) in
order for that to work; the > might even fail (can't remember).

why not do

... where unix_timestamp(visitors.created)>unix_timestamp(date_sub(NOW(),
INTERVAL 1 HOUR)) and ...

Peter; it's friday, I can't remember things

On Fri, 11 Jul 2003, Mike Mannakee wrote:

> I am running a query in mysql :
>
> SELECT DISTINCT (id) AS visitor_id,
> MAX(date_time) AS last,
> MIN(date_time) AS first,
> UNIX_TIMESTAMP( MAX(date_time)) -
> UNIX_TIMESTAMP( MIN(date_time)) AS diff
> FROM visitors, pixeldata_
> WHERE
> visitors.created > DATE_SUB( CURRENT_DATE, INTERVAL 1 HOUR )
> AND
> id = pixeldata_.remote
> GROUP BY
> visitors.id
>
> The idea behind the WHERE clause is to only get results from the last hour.
> I have used this construct successfully in dozens of other queries.
> However, the results here are giving me every single visitor in the table.
> Regardless of when created.
>
> In other words that part of the WHERE clause is not working.  Does anybody
> see any problem in the sql that I'm not seeing??  This is driving me nuts.
>
> Mike
>
>
>
>
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

---
Peter Beckman  Internet Guy
[EMAIL PROTECTED] http://www.purplecow.com/
---

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



[PHP-DB] AAAAGGGGHHH!!! Help!!

2003-07-11 Thread Mike Mannakee
I am running a query in mysql :

SELECT DISTINCT (id) AS visitor_id,
MAX(date_time) AS last,
MIN(date_time) AS first,
UNIX_TIMESTAMP( MAX(date_time)) -
UNIX_TIMESTAMP( MIN(date_time)) AS diff
FROM visitors, pixeldata_
WHERE
visitors.created > DATE_SUB( CURRENT_DATE, INTERVAL 1 HOUR )
AND
id = pixeldata_.remote
GROUP BY
visitors.id

The idea behind the WHERE clause is to only get results from the last hour.
I have used this construct successfully in dozens of other queries.
However, the results here are giving me every single visitor in the table.
Regardless of when created.

In other words that part of the WHERE clause is not working.  Does anybody
see any problem in the sql that I'm not seeing??  This is driving me nuts.

Mike







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



Re: [PHP-DB] Who's logged in from the browser?

2003-07-11 Thread CPT John W. Holmes
>When a user logs in via PHP - browser, how can you tell who is logged
> in to MySQL from that path. I've learned about how to check direct
> logins into MySQL using mysqladmin status function, but wanting to
> learn how to perform the other. Any help would be greatly appreciated.

Huh?

Your PHP script logs into MySQL, right? Or do you use the credentials
provided by the user to also log into MySQL? Either way, you can SELECT
USER() in MySQL to see who's currently logged in.

---John Holmes...


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



[PHP-DB] Who's logged in from the browser?

2003-07-11 Thread Allens
Hello,
  When a user logs in via PHP - browser, how can you tell who is logged 
in to MySQL from that path. I've learned about how to check direct 
logins into MySQL using mysqladmin status function, but wanting to 
learn how to perform the other. Any help would be greatly appreciated. 
:)

:)
  Gale L. Allen Jr
  Macintosh Support Specialist
  Phone: 919/412-5039
  Homepage: http://homepage.mac.com/ateam3/Menu5.html
  iChat = [EMAIL PROTECTED]
  "Remember, Love wins over all"
(:

Re: [PHP-DB] File upload...

2003-07-11 Thread Hardik Doshi
Hi,

Go to the Hotscripts.com and search for the File
upload. You will get so many scripts.. You can use any
of those.

Hardik

--- [EMAIL PROTECTED] wrote:
> Just been asked for a 'quick' job...
> A mate needs a system that can upload a file, and
> place it in a specific 
> directory...
> Via FTP he says, but I know there's other ways
> 
> Has anyone directions to a tutorial, or script, that
> can get this out of 
> my inbox on this hot, stuffy Friday afternoon?
> 
> Cheers guys, happy weekend!
> 
>
*
> The information contained in this e-mail message is
> intended only for 
> the personal and confidential use of the
> recipient(s) named above.  
> If the reader of this message is not the intended
> recipient or an agent
> responsible for delivering it to the intended
> recipient, you are hereby 
> notified that you have received this document in
> error and that any
> review, dissemination, distribution, or copying of
> this message is 
> strictly prohibited. If you have received this
> communication in error, 
> please notify us immediately by e-mail, and delete
> the original message.
>
***
> 
> 


__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

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



[PHP-DB] File upload...

2003-07-11 Thread Tristan . Pretty
Just been asked for a 'quick' job...
A mate needs a system that can upload a file, and place it in a specific 
directory...
Via FTP he says, but I know there's other ways

Has anyone directions to a tutorial, or script, that can get this out of 
my inbox on this hot, stuffy Friday afternoon?

Cheers guys, happy weekend!

*
The information contained in this e-mail message is intended only for 
the personal and confidential use of the recipient(s) named above.  
If the reader of this message is not the intended recipient or an agent
responsible for delivering it to the intended recipient, you are hereby 
notified that you have received this document in error and that any
review, dissemination, distribution, or copying of this message is 
strictly prohibited. If you have received this communication in error, 
please notify us immediately by e-mail, and delete the original message.
***



[PHP-DB] Re: PEAR DB getAssoc()

2003-07-11 Thread Pete Morganic
$sql = ' select contact_id, contact_name from contacts';

$contacts = $db->getAssoc($sql);

also try getAll which will give u a different result
$contacts = $db->getAll($sql);
pete

Jacob Marble wrote:
Hey all-
Could someone give an example of how to use the DB_Common::getAssoc()
function?  I'm trying to get an table into an array, and var_dump() shows
that the array is not associative.  Here's the code:
$sql = "select * from sr_names";
$table = $db->getAssoc($sql);
echo var_dump($table);
And here's the output:

array(1) {
  [1]=>
  array(16) {
[0]=>
string(5) "Jacob"
[1]=>
string(6) "Marble"
[2]=>
NULL

As I understand it, an associative array should return something more
like:
array(1) {
  [1]=>
  array(16) {
['firstname']=>
string(5) "Jacob"
['lastname']=>
string(6) "Marble"
['email']=>
NULL

Or am I showing off my newness... ;-)  Any help greatly appreciated!!

Jake

LandEZ




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