RE: [PHP-DB] Any one can help me dump XML into MySQL??

2003-07-04 Thread Boaz Yahav
This may be a start

Extracting CDATA values from an XML feed / file.
http://www.weberdev.com/get_example.php3?count=3692

Sincerely

berber

Visit http://www.weberdev.com/ Today!!!
To see where PHP might take you tomorrow.

-Original Message-
From: Nabil [mailto:[EMAIL PROTECTED] 
Sent: Thursday, July 03, 2003 8:24 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Any one can help me dump XML into MySQL??


Dear All ;

I have an XML files like the following and i want to make an PHP code to
insert it into my MySQL how can i read the nodes ot tages???  by the way
i can export like this file from PhpMyAdmin but i cann't dump it back...
Thanks in advance Nabil

?xml version=1.0 encoding=windows-1252 ?
- scs-dist
- !--
 table dist   --
- dist
  id1/id
  fnameMark/fname
  lnameSmith/lname
  companycompany1/company
  phone123456/phone
  governcity1/govern
  addressfirst street/address
  area12/area
/dist

- /scs-dist



-- 
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] odbc going nuts

2003-07-04 Thread George Pitcher
Hi all,

Just finishing off a site using odbc and Access and it's thrown up a problem
that wasn't there yesterday.

I have a simple login with a username and password. If either are blank, the
user gets bumped to the login page. otherwise the user table is searched for
the username and password.

my code looks like:

$strSQL = select * from user where (Username='$username' and
Paswd='$paswd');

I have an error script that kicks in if the query fails, and prints the
query to screen. I've pasted the query straight into Access' SQL query
window and it worked fine.

I just can't see anything wrong with the code, or anything else.

Any suggestions (apart from dropping Access in favour of another db - client
choice)

Cheers

George in Oxford


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



[PHP-DB] Backing up entire database...

2003-07-04 Thread Tristan . Pretty
I wanna back up my MySQL database in preperation for this:

==
http://www.securityfocus.com/news/6219
http://www.counterpane.com/alert-t20030702-001.html
http://news.ists.dartmouth.edu/todaysnews.html#internal10656

SANS (http://isc.incidents.org/) says on site
http://isc.sans.org/diary.html
=

I use phpmyadmin, and have about 15 databases, with multiple tables in 
each...
I wanna be able to back up everything, as I can do individually when in 
the specific database view...
But just do the whole thing in one go...
I know by the tme I get an answer, I could've just done each one anyway, 
but I'm curious... ;-)

Is this possible?

*
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.
***



RE: [PHP-DB] Backing up entire database...

2003-07-04 Thread Ben Lake
http://www.mysql.com/doc/en/mysqldump.html

www.mysql.com - Documentation - search = answers

Ben

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] 
Sent: Friday, July 04, 2003 4:02 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Backing up entire database...


I wanna back up my MySQL database in preperation for this:

==
http://www.securityfocus.com/news/6219
http://www.counterpane.com/alert-t20030702-001.html
http://news.ists.dartmouth.edu/todaysnews.html#internal10656

SANS (http://isc.incidents.org/) says on site
http://isc.sans.org/diary.html =

I use phpmyadmin, and have about 15 databases, with multiple tables in 
each...
I wanna be able to back up everything, as I can do individually when in 
the specific database view...
But just do the whole thing in one go...
I know by the tme I get an answer, I could've just done each one anyway,

but I'm curious... ;-)

Is this possible?

*
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 Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] hmmm

2003-07-04 Thread Becoming Digital
We have found the only case when banning someone from the list for foul language
would be completely undesirable.

Edward Dudlik
Becoming Digital
www.becomingdigital.com


Did I help you?  Want to show your thanks?
www.amazon.com/o/registry/EGDXEBBWTYUU



- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, 01 July, 2003 05:38
Subject: [PHP-DB] hmmm




YOU FUCKING SHIT!!! UNSUBSCRIBE MY EMAIL PLEASE !!! GOD VERDOMME !!!

UNSUBSCRIBE IT NOW,MOTHER FUCKER


BABI LOE BANGSAT LOE KONTOL LOE !!! SIKTIR GIT!!! YALLA!!!

HOER !!! GO AWAY FROM MY MAIL BOX WILL YA!!! FUCK SHIT U BASTARD MOTHER FUCKER
ASSHOLE !!!

PECUN LOE BABI LOE JANCUK !!!

--

--
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] hmmm

2003-07-04 Thread Leif K-Brooks
Becoming Digital wrote:

We have found the only case when banning someone from the list for foul language
would be completely undesirable.
 

Making it so he really can't unsubscribe, on the other hand, would be 
very desirable.  Are you listening, admins? :-)

--
The above message is encrypted with double rot13 encoding.  Any unauthorized attempt 
to decrypt it will be prosecuted to the full extent of the law.


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


SV: [PHP-DB] Re: A complex query problem

2003-07-04 Thread Henrik Hornemann
Hi,

You could try something like:

SELECT school_name, sID
FROM schools 
WHERE sID in (select sid from school_highlight_details
where hid = 2)
and sID in (select sid from school_highlight_details
where hid = 4)
GROUP BY sID


If you are using mysql this probably won't work. I think mysql doesn't like subselects.

hth Henrik Hornemann

 -Oprindelig meddelelse-
 Fra: Jason Givhan [mailto:[EMAIL PROTECTED]
 Sendt: 3. juli 2003 22:39
 Til: [EMAIL PROTECTED]
 Emne: [PHP-DB] Re: A complex query problem
 
 
 Im sorry, let me clarify the problem: I have some schools 
 with multiple 
 highlights.  I want to search for a school that has BOTH highlights 
 Sports AND Graduation.
 
 I can search for a school that has EITHER Sports OR 
 Graduation using 
 this query:
 
 SELECT schools.school_name, schools.sID
 FROM schools, school_highlight_details
 WHERE schools.sID = school_highlight_details.sid
 AND (school_highlight_details.hid = 2
 OR school_highlight_details.hid = 4 )
 GROUP BY schools.sID
 
 But now I want to search for a school that has BOTH 
 highlights Sports 
 AND Graduation.
 
 I have 3 tables:
 
 1. school (sID, school_name)
 2. highlights (hID,highlight)
 3. school_highlight_details (dID,sid,hid).
 
 
 
 Jason Givhan wrote:
  I have 3 tables:
  
  1. school (sID, school_name)
  2. highlights (hID,highlight)
  3. school_highlight_details (dID,sid,hid).
  
  I have set up a search to allow the user to submit a school name OR 
  highlights(highlights is set up in an array of checkboxes), 
 and then 
  displaying any school name that fullfill the requirements.
  
  What I need to do now is set up an array to search for a 
 school name AND 
   highlights.  If a person types in a name (or just one 
 letter from a 
  name, like 'm') AND they check off a couple of highlights 
 checkboxes(ex: 
  Sports and Graduation), a query should return the results 
 of any school 
  name starting with 'm' that has the highlights of 'Sports' and 
  'Graduation'.
  
  If you think you can help me, just email me at [EMAIL PROTECTED]
  If you need more information, let me know.
  
  Thank you,
  
  Jason Givhan
  
 
 
 -- 
 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] Re: fatal error with DB.php

2003-07-04 Thread Pete Morganic
edit the php.ini file and chenge the include paths to being where your 
isntallation is ;

Jswalter wrote:
I am trying to use DB.php, but I am getting htis error...

Fatal error: main(): Failed opening required 'DB.php'
(include_path='.;c:\php4\pear')
I can't find this path defined *anywhere*

I don't have PHP installed there.

How can I fix this include path issue.

[besides placing the PEARS directory at that path.
 which I did and that works fine, but I don't
 want it there]
Thanks

Walter




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


[PHP-DB] mail()

2003-07-04 Thread Phil Dowson
Hi,

Could someone let me know if it is possible to pass a resultset of a query
to a single variable so it can be included as the message part of the mail
function?

Thanks!

Phil Dowson



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



[PHP-DB] Re: odbc going nuts

2003-07-04 Thread Pete Morganic
Are registed globals off, otherwise u name to change $username to 
$_POST['username']

 Any suggestions (apart from dropping Access in favour of another db - 
client choice)

Oh dear.. Access is a real pain in the butt and we now NEVER deal with a 
client that selects Access. Never had any complaints since.

suggestions - mysql - postgresql - Firebird ...

Pete

George Pitcher wrote:
Hi all,

Just finishing off a site using odbc and Access and it's thrown up a problem
that wasn't there yesterday.
I have a simple login with a username and password. If either are blank, the
user gets bumped to the login page. otherwise the user table is searched for
the username and password.
my code looks like:

$strSQL = select * from user where (Username='$username' and
Paswd='$paswd');
I have an error script that kicks in if the query fails, and prints the
query to screen. I've pasted the query straight into Access' SQL query
window and it worked fine.
I just can't see anything wrong with the code, or anything else.

Any suggestions (apart from dropping Access in favour of another db - client
choice)
Cheers

George in Oxford



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


[PHP-DB] Re: A complex query problem

2003-07-04 Thread Nadim Attari
From MS-SQL Server Manual:
A subquery is a SELECT query that returns a single value and is nested
inside a SELECT, INSERT, UPDATE, or DELETE statement, or inside another
subquery. A subquery can be used anywhere an expression is allowed.

Unfortunately you do not have Sub-queries in mySQL ...
Try this script...

?php
$link = mysql_connect('localhost', 'root', '') or die('Could not
connect');
mysql_select_db('test') or die('Could not select database');

// Declare vars..
$sports = $graduation = $both_activities = array();

// Get all the schools where there is Sports
$sql = select distinct sid from school_highlight_details where hid =
'2';
$result = mysql_query($sql) or die(Query failed);
while (list($school_id) = mysql_fetch_row ($result)) $sports[] =
$school_id;
mysql_free_result($result);

// Get all the schools where there is Graduation
$sql = select distinct sid from school_highlight_details where hid =
'4';
$result = mysql_query($sql) or die(Query failed);
while (list($school_id) = mysql_fetch_row ($result)) $graduation[] =
$school_id;
mysql_free_result($result);

// Find common in both..
 $both_activities = array_intersect($sports, $graduation);
 $condition = '(';
 foreach($both_activities as $anything = $school_id) $condition .=
$school_id, ;
 $condition = substr($condition, 0, -2) . ')';

 $sql = Select sID, school_name FROM school where sID in $condition;
 $result = mysql_query($sql) or die(Query failed);
while (list($sID, $school_name) = mysql_fetch_row ($result)) echo $sID.
$school_namebr;
mysql_free_result($result);

mysql_close($link);
?

If you are using mySQL 4, read on UNION ...

(SELECT a FROM table_name WHERE a=10 AND B=1 ORDER BY a LIMIT 10)
UNION
(SELECT a FROM table_name WHERE a=11 AND B=2 ORDER BY a LIMIT 10)
ORDER BY a;



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



RE: [PHP-DB] Re: odbc going nuts

2003-07-04 Thread George Pitcher
Pete,

Thanks for the tip. I do use $_REQUEST[] and then convert to variables.

I moved my code to another machine and it was OK, so I've narrowed it down
to a MS upgrade! Obviously tinkered with something.

George

 -Original Message-
 From: Pete Morganic [mailto:[EMAIL PROTECTED]
 Sent: 04 July 2003 1:56 pm
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] Re: odbc going nuts


 Are registed globals off, otherwise u name to change $username to
 $_POST['username']

   Any suggestions (apart from dropping Access in favour of another db -
 client choice)

 Oh dear.. Access is a real pain in the butt and we now NEVER deal with a
 client that selects Access. Never had any complaints since.

 suggestions - mysql - postgresql - Firebird ...

 Pete

 George Pitcher wrote:
  Hi all,
 
  Just finishing off a site using odbc and Access and it's thrown
 up a problem
  that wasn't there yesterday.
 
  I have a simple login with a username and password. If either
 are blank, the
  user gets bumped to the login page. otherwise the user table is
 searched for
  the username and password.
 
  my code looks like:
 
  $strSQL = select * from user where (Username='$username' and
  Paswd='$paswd');
 
  I have an error script that kicks in if the query fails, and prints the
  query to screen. I've pasted the query straight into Access' SQL query
  window and it worked fine.
 
  I just can't see anything wrong with the code, or anything else.
 
  Any suggestions (apart from dropping Access in favour of
 another db - client
  choice)
 
  Cheers
 
  George in Oxford
 


 --
 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: odbc going nuts

2003-07-04 Thread Pete Morganic
I'd recmmend you use the $_POST vars as this is more secure

pete

George Pitcher wrote:
Pete,

Thanks for the tip. I do use $_REQUEST[] and then convert to variables.

I moved my code to another machine and it was OK, so I've narrowed it down
to a MS upgrade! Obviously tinkered with something.
George


-Original Message-
From: Pete Morganic [mailto:[EMAIL PROTECTED]
Sent: 04 July 2003 1:56 pm
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Re: odbc going nuts
Are registed globals off, otherwise u name to change $username to
$_POST['username']
 Any suggestions (apart from dropping Access in favour of another db -
client choice)
Oh dear.. Access is a real pain in the butt and we now NEVER deal with a
client that selects Access. Never had any complaints since.
suggestions - mysql - postgresql - Firebird ...

Pete

George Pitcher wrote:

Hi all,

Just finishing off a site using odbc and Access and it's thrown
up a problem

that wasn't there yesterday.

I have a simple login with a username and password. If either
are blank, the

user gets bumped to the login page. otherwise the user table is
searched for

the username and password.

my code looks like:

$strSQL = select * from user where (Username='$username' and
Paswd='$paswd');
I have an error script that kicks in if the query fails, and prints the
query to screen. I've pasted the query straight into Access' SQL query
window and it worked fine.
I just can't see anything wrong with the code, or anything else.

Any suggestions (apart from dropping Access in favour of
another db - client

choice)

Cheers

George in Oxford



--
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] No MySQL Support in PHP5 - Uh oh!

2003-07-04 Thread Adam Lundrigan
that doesn't seem to workit tells me that the libmysql.dll file is not a
PHP module.  Where can I track down the PHP module for MySQL?  Its not in my
/extensions directory

-Adam

Lester Caine [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
  Exactly how would one go about installing the MySQL extension, as a
  workaround to the removal of the builtin MySQL library?

 Just select it in the php.ini list of extensions? That is
 how I get Firebird(Interbase) instead.

 Leaving sections of the code to user choice is much better
 than building in code that lots of people do not want anyway.

 --
 Lester Caine
 -
 L.S.Caine Electronic Services






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



[PHP-DB] Re: fatal error with DB.php

2003-07-04 Thread jsWalter
Pete Morganic [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]

 edit the php.ini file and change the include paths to being where your
 isntallation is ;

Thanks Pete for the idea, but I should give you what I had in my INI...

That was the first thing I did...

include_path = .;G:\etc\php\extensions.;G:\etc\php\pear
extension_dir = G:\etc\php\extensions


I thought if I placed the path to the PEAR files in the 'include_dir' value
all would work.

Nope.

Can you tell me where else I need to make a change?



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



Re: [PHP-DB] No MySQL Support in PHP5 - Uh oh!

2003-07-04 Thread Marco Tabini
Try in the current snapshot at http://snaps.php.net (also, more info on
my blog).

Cheers,


Marco Tabini
http://blogs.phparch.com

On Fri, 2003-07-04 at 13:01, Adam Lundrigan wrote:
 that doesn't seem to workit tells me that the libmysql.dll file is not a
 PHP module.  Where can I track down the PHP module for MySQL?  Its not in my
 /extensions directory
 
 -Adam
 
 Lester Caine [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
   Exactly how would one go about installing the MySQL extension, as a
   workaround to the removal of the builtin MySQL library?
 
  Just select it in the php.ini list of extensions? That is
  how I get Firebird(Interbase) instead.
 
  Leaving sections of the code to user choice is much better
  than building in code that lots of people do not want anyway.
 
  --
  Lester Caine
  -
  L.S.Caine Electronic Services
 
 
 
-- 

Marco Tabini
President

Marco Tabini  Associates, Inc.
28 Bombay Avenue
Toronto, ON M3H 1B7
Canada

Phone: (416) 630-6202
Fax: (416) 630-5057
Web: http://www.tabini.ca


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



Re: [PHP-DB] Re: A complex query problem

2003-07-04 Thread Micah Stevens
MySQL version 4.x has Subquery support.


On Fri July 4 2003 5:54 am, Nadim Attari wrote:
 From MS-SQL Server Manual:
 A subquery is a SELECT query that returns a single value and is nested
 inside a SELECT, INSERT, UPDATE, or DELETE statement, or inside another
 subquery. A subquery can be used anywhere an expression is allowed.

 Unfortunately you do not have Sub-queries in mySQL ...
 Try this script...

 ?php
 $link = mysql_connect('localhost', 'root', '') or die('Could not
 connect');
 mysql_select_db('test') or die('Could not select database');

 // Declare vars..
 $sports = $graduation = $both_activities = array();

 // Get all the schools where there is Sports
 $sql = select distinct sid from school_highlight_details where hid =
 '2';
 $result = mysql_query($sql) or die(Query failed);
 while (list($school_id) = mysql_fetch_row ($result)) $sports[] =
 $school_id;
 mysql_free_result($result);

 // Get all the schools where there is Graduation
 $sql = select distinct sid from school_highlight_details where hid =
 '4';
 $result = mysql_query($sql) or die(Query failed);
 while (list($school_id) = mysql_fetch_row ($result)) $graduation[] =
 $school_id;
 mysql_free_result($result);

 // Find common in both..
  $both_activities = array_intersect($sports, $graduation);
  $condition = '(';
  foreach($both_activities as $anything = $school_id) $condition .=
 $school_id, ;
  $condition = substr($condition, 0, -2) . ')';

  $sql = Select sID, school_name FROM school where sID in $condition;
  $result = mysql_query($sql) or die(Query failed);
 while (list($sID, $school_name) = mysql_fetch_row ($result)) echo
 $sID. $school_namebr;
 mysql_free_result($result);

 mysql_close($link);
 ?

 If you are using mySQL 4, read on UNION ...

 (SELECT a FROM table_name WHERE a=10 AND B=1 ORDER BY a LIMIT 10)
 UNION
 (SELECT a FROM table_name WHERE a=11 AND B=2 ORDER BY a LIMIT 10)
 ORDER BY a;


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



Re: [PHP-DB] No MySQL Support in PHP5 - Uh oh!

2003-07-04 Thread Adam Lundrigan
Thanks.  I'll try that

-Adam

Marco Tabini [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Try in the current snapshot at http://snaps.php.net (also, more info on
 my blog).

 Cheers,


 Marco Tabini
 http://blogs.phparch.com

 On Fri, 2003-07-04 at 13:01, Adam Lundrigan wrote:
  that doesn't seem to workit tells me that the libmysql.dll file is
not a
  PHP module.  Where can I track down the PHP module for MySQL?  Its not
in my
  /extensions directory
 
  -Adam
 
  Lester Caine [EMAIL PROTECTED] wrote in message
  news:[EMAIL PROTECTED]
Exactly how would one go about installing the MySQL extension, as a
workaround to the removal of the builtin MySQL library?
  
   Just select it in the php.ini list of extensions? That is
   how I get Firebird(Interbase) instead.
  
   Leaving sections of the code to user choice is much better
   than building in code that lots of people do not want anyway.
  
   --
   Lester Caine
   -
   L.S.Caine Electronic Services
  
  
  
 --

 Marco Tabini
 President

 Marco Tabini  Associates, Inc.
 28 Bombay Avenue
 Toronto, ON M3H 1B7
 Canada

 Phone: (416) 630-6202
 Fax: (416) 630-5057
 Web: http://www.tabini.ca




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