[PHP] Re: [PHP-DB] Making Join

2003-02-28 Thread Paul Burney
on 2/28/03 3:15 PM, Daniel Harik at [EMAIL PROTECTED] appended the following
bits to my mbox:

 Thank You for your reply, but the problem is that users may have many
 photos, and i need to get only one, i use folllowing sql:
 SELECT users.username, photos.file FROM users left join photos on
 users.id=photos.userid
 
 And i get:
 
 username file
 dan  9a2de085e456e78ed66f079572638ff3.jpg
 dan  852d28e6fa730f6d29d69aacd1059ae7.jpg
 dan  672df2f16e89e3dc92ff74e3a0fa4b4f.jpg
 dan  8bae6f20ed6e12ba1c86d04b8ebc9e1f.jpg
 dan  7de9d2db2b2096cfc3f072f8c15a9e50.jpg
 404  f474a8ee5965f0a792e5b626fb30c2cd.jpg
 404  3acd391cf7abafa032c5e3b21eb7b322.jpg
 404  4e5df8cfa4bce5dd30c1166b8a86fa23.jpg
 Bedman  NULL
 
 but i want only 3 users from this join, not 3x3=9

So you just want the users who have pictures, but not all the pictures for
each?  Something like:

SELECT count(*) AS num_photos, username FROM photos LEFT JOIN users ON
photos.userid=users.id GROUP BY userid

You could add the file field in there as well, but it would only be
returning one of the files (the first or last one for that user, but I don't
know of a way for you to be specific).

Hope that helps.

Sincerely,

Paul Burney
http://paulburney.com/

Q: Tired of creating admin interfaces to your MySQL web applications?

A: Use MySTRI instead. Version 3.1 now available.
http://mystri.sourceforge.net/



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



Re: [PHP] echo problem NEW

2002-01-09 Thread Paul Burney

on 1/9/02 8:17 AM, Henning Sprang at [EMAIL PROTECTED] appended the
following bits to my mbox:

 just another one - but i am too out of practice with html standarts to
 know if this is compliant ( a browser showing a result doesn't
 neccessary mean it's standarts compliant!)

FYI:

By default, SGML requires that all attribute values be delimited using
either double quotation marks (ASCII decimal 34) or single quotation marks
(ASCII decimal 39). Single quote marks can be included within the attribute
value when the value is delimited by double quote marks, and vice versa.
Authors may also use numeric character references to represent double quotes
(#34;) and single quotes (#39;). For double quotes authors can also use
the character entity reference quot;.

From:

http://www.w3.org/TR/html4/intro/sgmltut.html#h-3.2.2

HTH.

Paul Burney

?php
while ($self != asleep) {
$sheep_count++;
}
?



-- 
PHP General 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]




Re: [PHP] backtracing of includes

2001-12-28 Thread Paul Burney

on 12/28/01 8:53 AM, Henning Sprang at [EMAIL PROTECTED] wrote:

 That's what I wrote - I know I can use things like that, but I am
 curious if there are other ways to find out which file is included by
 what and which function is defined in which file - i didn't find answers
 about that in the manual.

I'm not sure if there is anything built in that you can use, but you
probably should start with the:

__FILE__ and __LINE__

constants.  The __FILE__ constant is the name of the script file being
executed.  If it's in an include file, it will be the name of the include
file, not the parent file.  The __LINE__ is the current line within the file
(include).

HTH.

Paul Burney

?php
while ($self != asleep) {
$sheep_count++;
}
?



-- 
PHP General 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]




Re: [PHP] User Authentication

2001-12-17 Thread Paul Burney

on 12/16/01 12:58 PM, Daniel Grace at [EMAIL PROTECTED] wrote:

 Anyways, though the 401 part works and actually brings up the typical Enter
 Username/Password box, $PHP_AUTH_USER and $PHP_AUTH_PW are not being set.
 There are no .htaccess files in the directory (or any parent dirs for that
 matter), and no AuthType directives all in my httpd.conf file. I have been
 unsuccessful in determining what is wrong, and am flat out of ideas.

My guess would be that register_globals is off.  If I recall correctly,
$PHP_AUTH_USER and $PHP_AUTH_PW need register_globals on to work like you
want them to.

Check phpinfo() to see if another variable, maybe one in the new arrays,
will give them to you.  If not, you can look for the Authorize Header and
then manually parse out the User and PW information.

Paul

?php
/* Happy Holidays */
mysql_select_db('North_Pole');
mysql_query('SELECT reindeer FROM stable WHERE nose_color=red');
?



-- 
PHP General 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]




Re: [PHP] Frames creating problems...

2001-12-10 Thread Paul Burney

on 12/10/01 10:03 AM, dhaval desai at [EMAIL PROTECTED] wrote:

 Well I have a website with frames. The problem here is
 that I have a serach box in the top frame and I want
 the results to be displayed in the other frame.

This isn't the appropriate forum for the question since it isn't php
related.  

That said, you should use the target attribute of the form tag.  Set it to
the name of the frame you wish the content to be in.

HTH.

Paul

?php
while ($self != asleep) {
$sheep_count++;
}
?



-- 
PHP General 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]




[PHP] Re: [PHP-DB] PhpMyAdmin phpPgAdmin Security Issues

2001-07-03 Thread Paul Burney

on 7/3/01 5:47 AM, andreas (@work) ([EMAIL PROTECTED]) wrote:

 ive got 3 servers (dedicated) with mysql 3.22.32 and above and phpMyAdmin
 2.1.0 but i cant reproduce the vulnerability

 i use advanced uthentication

 http://ip/phpMyAdmin/sql.php?server=000cfgServers[000][host]=hellobtnDrop=N
 ogoto=/etc/passwd

If that URL is copied correctly, it might be because there's no  between
the server=000 and the cfgServers[000][host].

If not, maybe your particular configuration isn't vulnerable.

If you use a Apache Auth for access to the folder and normal auth in
phpmyadmin, you are not vulnerable to outsiders but *you* can still view a
server's sensitive files which can be really dangerous in a shared server
environment.

Sincerely,

Paul Burney

+-+-+
| Paul Burney | P: 310.825.8365 |
| Webmaster  Programmer | E: [EMAIL PROTECTED]   |
| UCLA - GSEIS - ETU   | W: http://www.gseis.ucla.edu/ |
+-+-+


-- 
PHP General 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]