Re: [PHP-DB] MySQL Backup, final script !!!

2003-06-26 Thread Nabil
thnks, i will give it a shot


Armand Turpel [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 I use an db abstraction class. You have to replace this by yours. Of
 course you got a Fatal error: Call to a member function on a
 non-object because such an object dosen't exist in your script. First
 you have to connect to a database using mysql_connect() and using
 mysql_query and mysql_fetch_row.

 Armand

 Nabil wrote:

 thanks a lot for your response but i got
 
 Fatal error: Call to a member function on a non-object in
 c:\inetpub\wwwroot\dump.php on line 3
 not that mysql is 3.23.53
 
 my script is :
 /
 ?php
 $sql = 'SHOW TABLES FROM chat';
 $db-query($sql);
 while ($row  = $db - fetchRow ('DB_GETMODE_NUM') )
 {
 $sql = ' BACKUP TABLE '.$row[0].' TO /db_backup ';
 $db-query($sql);
 }
 ?
 /
 
 




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



Re: [PHP-DB] MySQL editor

2003-06-19 Thread Achilles Maroulis
MySQL CONTROL CENTER from mysql.org (very nice)
SQLYOG from sqlyog.com
PHPMYADMIN  from phpmyadmin.net (web interface)

- Original Message -
From: Angelo Zanetti [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, June 19, 2003 11:40 AM
Subject: [PHP-DB] MySQL editor


Hi all.

I need to get a program (interface) for MySQL, I was using MySQL Front but
they've discontinued its use.

Any suggestions.

thanx in advance

-Angelo


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



Re: [PHP-DB] MySQL editor

2003-06-19 Thread Ignatius Reilly
Try also DBTools (forWindows). Very nice. Been using for 2 years, and happy
about it.
http://www.dbtools.com.br/EN/

Ignatius
_
- Original Message -
From: Achilles Maroulis [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, June 19, 2003 10:46 AM
Subject: Re: [PHP-DB] MySQL editor


 MySQL CONTROL CENTER from mysql.org (very nice)
 SQLYOG from sqlyog.com
 PHPMYADMIN  from phpmyadmin.net (web interface)

 - Original Message -
 From: Angelo Zanetti [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Thursday, June 19, 2003 11:40 AM
 Subject: [PHP-DB] MySQL editor


 Hi all.

 I need to get a program (interface) for MySQL, I was using MySQL Front but
 they've discontinued its use.

 Any suggestions.

 thanx in advance

 -Angelo


 --
 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] MySQL editor

2003-06-19 Thread CPT John W. Holmes
Next time ask on the MySQL list!

Navicat
Mascon
PHPMyAdmin (for web interface)
SQLYog
MyCC (from www.mysql.com)

The first two are very professional programs that offer a lot of features
including Reports and Query wizards. Similar to using Access on Windows
(interface wise), but without the crashing and slow speed (database wise)!!

What's wrong with continuing to use MySQL Front? I do. It's still my
favorite.

---John Holmes...

- Original Message - 
From: Angelo Zanetti [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, June 19, 2003 4:40 AM
Subject: [PHP-DB] MySQL editor


Hi all.

I need to get a program (interface) for MySQL, I was using MySQL Front but
they've discontinued its use.

Any suggestions.

thanx in advance

-Angelo



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



Re: [PHP-DB] MySQL editor

2003-06-19 Thread Michael Scappa
Not free, but mysqlmanager (www.ems-hitech.com) is by far the best I've
used. A free alternative (although not quite as featured) is probably
Mysqlcc

-Mike

- Original Message - 
From: Angelo Zanetti [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, June 19, 2003 4:40 AM
Subject: [PHP-DB] MySQL editor


Hi all.

I need to get a program (interface) for MySQL, I was using MySQL Front but
they've discontinued its use.

Any suggestions.

thanx in advance

-Angelo



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



Re: [PHP-DB] MySQL editor

2003-06-19 Thread Pierre-Alain Joye
Hello,

Not really the same purpose, but so powerfull :)

http://www.fabforce.net/dbdesigner4/

pierre

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



RE: [PHP-DB] mysql Editor

2003-06-19 Thread Ryan Marrs
DBTools - www.dbtools.com.br

___
Ryan Marrs
Web Developer
Sandler  Travis Trade Advisory Services, Inc.
248.474.7200 x 183
248.474.8500 (fax)
www.strtrade.com


-Original Message-
From: Michael Lewis [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 19, 2003 10:48 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] mysql Editor


A free alternative that works very well is sqlyog. Google it as I don't have
the url handy (it may be www.webyog.com or .org). I also use MySQL Front as
it still works fine. But I'm switching over to sqlyog because I want to
ensure that I am compatible with future releases of MySQL.

Michael Lewis



-- 
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] MySQL editor

2003-06-19 Thread Becoming Digital
 mysqlmanager (www.ems-hitech.com) is by far the best I've used. 

They've changed the name to Navicat now.  It really is fantastic software.

Edward Dudlik
Becoming Digital
www.becomingdigital.com


- Original Message - 
From: Michael Scappa [EMAIL PROTECTED]
To: Angelo Zanetti [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Thursday, 19 June, 2003 10:33
Subject: Re: [PHP-DB] MySQL editor


Not free, but mysqlmanager (www.ems-hitech.com) is by far the best I've
used. A free alternative (although not quite as featured) is probably
Mysqlcc

-Mike

- Original Message - 
From: Angelo Zanetti [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, June 19, 2003 4:40 AM
Subject: [PHP-DB] MySQL editor


Hi all.

I need to get a program (interface) for MySQL, I was using MySQL Front but
they've discontinued its use.

Any suggestions.

thanx in advance

-Angelo



-- 
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] MySQL editor

2003-06-19 Thread Becoming Digital
Sorry, I mistyped.  Navicat was previously known as MySQL Studio.  Both are very
nice packages.

Edward Dudlik
Becoming Digital
www.becomingdigital.com


- Original Message -
From: Becoming Digital [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, 19 June, 2003 11:02
Subject: Re: [PHP-DB] MySQL editor


 mysqlmanager (www.ems-hitech.com) is by far the best I've used.

They've changed the name to Navicat now.  It really is fantastic software.

Edward Dudlik
Becoming Digital
www.becomingdigital.com


- Original Message -
From: Michael Scappa [EMAIL PROTECTED]
To: Angelo Zanetti [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Thursday, 19 June, 2003 10:33
Subject: Re: [PHP-DB] MySQL editor


Not free, but mysqlmanager (www.ems-hitech.com) is by far the best I've
used. A free alternative (although not quite as featured) is probably
Mysqlcc

-Mike

- Original Message -
From: Angelo Zanetti [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, June 19, 2003 4:40 AM
Subject: [PHP-DB] MySQL editor


Hi all.

I need to get a program (interface) for MySQL, I was using MySQL Front but
they've discontinued its use.

Any suggestions.

thanx in advance

-Angelo



--
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] MySQL editor

2003-06-19 Thread Michael van der Poel
SQL4x Manager is great, too, but it only runs on the mac platform

http://www.macosguru.de/products/sql4xmanager

on 19/6/03 5:34 PM, Becoming Digital at [EMAIL PROTECTED] wrote:

 Sorry, I mistyped.  Navicat was previously known as MySQL Studio.  Both are
 very
 nice packages.
 
 Edward Dudlik
 Becoming Digital
 www.becomingdigital.com
 
 
 - Original Message -
 From: Becoming Digital [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Thursday, 19 June, 2003 11:02
 Subject: Re: [PHP-DB] MySQL editor
 
 
 mysqlmanager (www.ems-hitech.com) is by far the best I've used.
 
 They've changed the name to Navicat now.  It really is fantastic software.
 
 Edward Dudlik
 Becoming Digital
 www.becomingdigital.com
 
 
 - Original Message -
 From: Michael Scappa [EMAIL PROTECTED]
 To: Angelo Zanetti [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Sent: Thursday, 19 June, 2003 10:33
 Subject: Re: [PHP-DB] MySQL editor
 
 
 Not free, but mysqlmanager (www.ems-hitech.com) is by far the best I've
 used. A free alternative (although not quite as featured) is probably
 Mysqlcc
 
 -Mike
 
 - Original Message -
 From: Angelo Zanetti [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Thursday, June 19, 2003 4:40 AM
 Subject: [PHP-DB] MySQL editor
 
 
 Hi all.
 
 I need to get a program (interface) for MySQL, I was using MySQL Front but
 they've discontinued its use.
 
 Any suggestions.
 
 thanx in advance
 
 -Angelo
 
 
 
 --
 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] MySQL editor

2003-06-19 Thread Creative Solutions New Media
With the exception of phpmyadmin is there anything else out there that will
allow you to work on your mysql stuff remotely?

Tim Winters
Manager, Creative Development
Sampling Technologies Incorporated (STI)
[EMAIL PROTECTED]
[EMAIL PROTECTED]
W: 902 450 5500
C:  902 430 8498

-Original Message-
From: Achilles Maroulis [mailto:[EMAIL PROTECTED]
Sent: June 19, 2003 5:46 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] MySQL editor

MySQL CONTROL CENTER from mysql.org (very nice)
SQLYOG from sqlyog.com
PHPMYADMIN  from phpmyadmin.net (web interface)

- Original Message -
From: Angelo Zanetti [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, June 19, 2003 11:40 AM
Subject: [PHP-DB] MySQL editor


Hi all.

I need to get a program (interface) for MySQL, I was using MySQL Front but
they've discontinued its use.

Any suggestions.

thanx in advance

-Angelo


--
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] MySQL editor

2003-06-19 Thread David Shugarts
Thus, the website to find Navicat is http://www.mysqlstudio.com.

--Dave Shugarts

 
 Sorry, I mistyped.  Navicat was previously known as MySQL Studio.  Both are
 very
 nice packages.
 
 Edward Dudlik
 Becoming Digital
 www.becomingdigital.com
 
 
 - Original Message -
 From: Becoming Digital [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Thursday, 19 June, 2003 11:02
 Subject: Re: [PHP-DB] MySQL editor
 
 
 mysqlmanager (www.ems-hitech.com) is by far the best I've used.
 
 They've changed the name to Navicat now.  It really is fantastic software.
 
 Edward Dudlik
 Becoming Digital
 www.becomingdigital.com
 
 
 - Original Message -
 From: Michael Scappa [EMAIL PROTECTED]
 To: Angelo Zanetti [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Sent: Thursday, 19 June, 2003 10:33
 Subject: Re: [PHP-DB] MySQL editor
 
 
 Not free, but mysqlmanager (www.ems-hitech.com) is by far the best I've
 used. A free alternative (although not quite as featured) is probably
 Mysqlcc
 
 -Mike
 
 - Original Message -
 From: Angelo Zanetti [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Thursday, June 19, 2003 4:40 AM
 Subject: [PHP-DB] MySQL editor
 
 
 Hi all.
 
 I need to get a program (interface) for MySQL, I was using MySQL Front but
 they've discontinued its use.
 
 Any suggestions.
 
 thanx in advance
 
 -Angelo
 
 
 
 --
 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] MySQL editor

2003-06-19 Thread Jason Wong
On Friday 20 June 2003 01:11, Creative Solutions New Media wrote:
 With the exception of phpmyadmin is there anything else out there that will
 allow you to work on your mysql stuff remotely?

They should all allow you to access a remote installation of mysql. Now can we 
please move this topic to the mysql list where it belongs?

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-db
--
/*
Everything should be built top-down, except this time.
*/


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



Re: [PHP-DB] MySQL editor

2003-06-19 Thread CPT John W. Holmes
 With the exception of phpmyadmin is there anything else out there that
will
 allow you to work on your mysql stuff remotely?

Any of the programs will. The real questions whether you have permission to
connect remotely, though... :)

---John Holmes...


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



Re: [PHP-DB] MySQL Connection

2003-06-17 Thread Ramil G. Sagum
On Wed, 2003-06-18 at 08:16, [EMAIL PROTECTED] wrote:
 Hello,
 
 Would be grateful if someone couldkindly point me in the right direction.
 
 Whenever I try to connect to mysql server, I get these messsage back
 
 1.
 mysql GRANT ALL PRIVILEGES ON *.* TO moses@% IDENTIFIED BY cludiana;
 ERROR 1045: Access denied for user: '@127.0.0.1' (Using password: NO)
 mysql
 
 2.
 mysql GRANT ALL PRIVILEGES ON *.* TO moses@% IDENTIFIED BY cludiana;
 ERROR 1045: Access denied for user: '@127.0.0.1' (Using password: NO)
 mysql
 
something must be wrong with your connection string, would you post the
mysql_connect statement here.




 what could be wrong. Help please .
 
 Regards
 
 Moses
 
 


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



Re: [PHP-DB] MySQL Transaction

2003-06-17 Thread John W. Holmes
Becoming Digital wrote:

A question was raised on the MySQL list about implementing transactions with
PHP.  I had planned on them for an upcoming project but I'd yet to figure out
how I'd coordinate things.
The original author's solution (slightly altered) was to make an array with all
the queries and loop through them, setting a boolean flag and exiting the loop
if a query fails.  Testing for the value of the flag would execute a commit or
rollback according to its value.
Sounds like a good solution to me. Sounds like something that could 
easily be passed to a function with a flag to use a transaction or not 
on the group of queries. Sounds good.

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

PHP|Architect: A magazine for PHP Professionals  www.phparch.com





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


Re: [PHP-DB] MySQL Connection

2003-06-17 Thread John W. Holmes
[EMAIL PROTECTED] wrote:

Would be grateful if someone couldkindly point me in the right direction.

Whenever I try to connect to mysql server, I get these messsage back

1.
mysql GRANT ALL PRIVILEGES ON *.* TO moses@% IDENTIFIED BY cludiana;
ERROR 1045: Access denied for user: '@127.0.0.1' (Using password: NO)
mysql
2.
mysql GRANT ALL PRIVILEGES ON *.* TO moses@% IDENTIFIED BY cludiana;
ERROR 1045: Access denied for user: '@127.0.0.1' (Using password: NO)
mysql
what could be wrong. Help please .
1. This has nothing to do with PHP.

2. The user you connected to PHP with does not have permission to GRANT 
privileges.

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

PHP|Architect: A magazine for PHP Professionals  www.phparch.com





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


Re: [PHP-DB] MySQL CONNECTION PROblem

2003-06-11 Thread nabil
but when i used mysql_error()  i got : sorry database not found
and i have privileges in mysql/ user table .. as shown below... the point is
if i changed 192.168.0.111 to localhost .. i managed to get the data ...

as my dbconnect.php file includes

?
mysql_connect(192.168.0.111 , root , password) or die(SORRY CANNOT
CONNECT) ;
mysql_select_db(kt) or die(sorry database not found. mysql_error());
?

and the user table of mysql database :
#
# Dumping data for table `user`
#

INSERT INTO user VALUES ('localhost', 'root', '', 'Y', 'Y', 'Y', 'Y', 'Y',
'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y');
INSERT INTO user VALUES ('%', 'root', '', 'N', 'N', 'N', 'N', 'N', 'N', 'N',
'N', 'N', 'N', 'Y', 'N', 'N', 'N');
INSERT INTO user VALUES ('localhost', '', '', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y',
'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y');
INSERT INTO user VALUES ('%', '', '', 'N', 'N', 'N', 'N', 'N', 'N', 'N',
'N', 'N', 'N', 'N', 'N', 'N', 'N');

George Patterson [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 On Tue, 10 Jun 2003 16:47:26 +0300
 nabil [EMAIL PROTECTED] wrote:

  but when i used mysql_error()  i got : sorry database not found
 
  as my dbconnect.php file includes
 
  ?
  mysql_connect(192.168.0.111 , root , password) or die(SORRY
  CANNOT CONNECT) ;
  mysql_select_db(kt) or
  die(sorry database not found);
  ?

 Nabil,

 Try changing the last line statement to
 mysql_select_db(kt) or die(sorry database not found. mysql_error());

 This will show what the error really is.

 Example, You have created the database haven't you??
 Try using the mysql client to connect from the web server to the mysql
 server.

 George Patterson



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



Re: [PHP-DB] MySQL, PHP, and XML

2003-06-11 Thread Jeff Shapiro

A quick google search produced this:

Creating XML from MySQL (it also talks about importing XML)
http://www.zdnet.com.au/builder/architect/database/story/0,234918,20266023,00.htm



On Wed, 11 Jun 2003 21:53:56 -0500, [EMAIL PROTECTED] wrote:
 Is there an automatic way to insert an XML file into a MySQL DB through say,
 Load Data InFILE?  
 
 Or does one have to Pick apart the XML with PHP and insert data into the
 fields one by one, record by record?
 
 /T
 
 
 
 
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php

---
Listserv only address.
Jeff Shapiro

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



Re: [PHP-DB] MySQL CONNECTION PROblem

2003-06-10 Thread nabil
but when i used mysql_error()  i got : sorry database not found

as my dbconnect.php file includes

?
mysql_connect(192.168.0.111 , root , password) or die(SORRY CANNOT
CONNECT) ;
mysql_select_db(kt) or
die(sorry database not found);
?

and the user table of mysql database :
#
# Dumping data for table `user`
#

INSERT INTO user VALUES ('localhost', 'root', '', 'Y', 'Y', 'Y', 'Y', 'Y',
'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y');
INSERT INTO user VALUES ('%', 'root', '', 'N', 'N', 'N', 'N', 'N', 'N', 'N',
'N', 'N', 'N', 'Y', 'N', 'N', 'N');
INSERT INTO user VALUES ('localhost', '', '', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y',
'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y');
INSERT INTO user VALUES ('%', '', '', 'N', 'N', 'N', 'N', 'N', 'N', 'N',
'N', 'N', 'N', 'N', 'N', 'N', 'N');

so it has the '%' value so it can be accessed by any host.!!!1

any comment ???


John W. Holmes [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
  i have the dbconnect.php as :
  //
  ?php
  mysql_connect(192.168.0.111 , root , pass) or
  die (Couldn't connect to database);
  mysql_select_db(DatabaseName) or
  die(sorry database not found);
  ?
  ///
  when i  put localhost instead of the IP address of my machine (localy)
 i
  got
  the following error...
 
  Warning: mysql_num_rows(): supplied argument is not a valid MySQL
 result
  resource in c:\inetpub\wwwroot\kt\superv_list.php on line 5
  No Data Found..
 
  what is my problem, this was a test to connect to my database on the
 same
  machine . but i replaced the localhost with my machine IP address..
 do i
  have to put a domain name instead of an IP if i want to connect to a
  remote
  server on the internert?

 Your query failed. Use mysql_error() to find out why.

 ---John W. Holmes...

 Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E

 PHP Architect - A monthly magazine for PHP Professionals. Get your copy
 today. http://www.phparch.com/





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



Re: [PHP-DB] MySQL CONNECTION PROblem

2003-06-10 Thread George Patterson
On Tue, 10 Jun 2003 16:47:26 +0300
nabil [EMAIL PROTECTED] wrote:

 but when i used mysql_error()  i got : sorry database not found
 
 as my dbconnect.php file includes
 
 ?
 mysql_connect(192.168.0.111 , root , password) or die(SORRY
 CANNOT CONNECT) ;
 mysql_select_db(kt) or
 die(sorry database not found);
 ?

Nabil, 

Try changing the last line statement to  
mysql_select_db(kt) or die(sorry database not found. mysql_error());

This will show what the error really is. 

Example, You have created the database haven't you?? 
Try using the mysql client to connect from the web server to the mysql
server.

George Patterson

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



RE: [PHP-DB] MySQL CONNECTION PROblem

2003-06-09 Thread John W. Holmes
 i have the dbconnect.php as :
 //
 ?php
 mysql_connect(192.168.0.111 , root , pass) or
 die (Couldn't connect to database);
 mysql_select_db(DatabaseName) or
 die(sorry database not found);
 ?
 ///
 when i  put localhost instead of the IP address of my machine (localy)
i
 got
 the following error...
 
 Warning: mysql_num_rows(): supplied argument is not a valid MySQL
result
 resource in c:\inetpub\wwwroot\kt\superv_list.php on line 5
 No Data Found..
 
 what is my problem, this was a test to connect to my database on the
same
 machine . but i replaced the localhost with my machine IP address..
do i
 have to put a domain name instead of an IP if i want to connect to a
 remote
 server on the internert?

Your query failed. Use mysql_error() to find out why. 

---John W. Holmes...

Amazon Wishlist: http://www.amazon.com/o/registry/3BEXC84AB3A5E

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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



Re: [PHP-DB] mysql, php, mp3 - a variable problem

2003-06-07 Thread Allowee
Hi,

Where do you get $info2 from?
I only see $info in this function.

.: Allowee

 function scan_dir($dir)
 {
 $info = New mphp3(2);

 $handle = @opendir($dir);
 while ($file = @readdir ($handle))
 {
 if (eregi(^\.{1,2}$,$file))
 {
 continue;
 }

 if(is_dir($dir.$file))
 {
 scan_dir($dir.$file./);
 }
 else
 {
 $info-load(/.$dir.$file);

 $query =insert into mp3 (
   file,
   path,
   artist,
   title,
   album)
 values (
  '$info2-filename',
  '$dir',
  '$info2-v2_artist',
  '$info2-v2_title',
  '$info2-v2_album');;

 mysql_query($query);
 }
 }
 @closedir($handle);
 }
 scan_dir(mp3/);
 ?

 but all it does is to put the path ($dir) into the database. everything
 else is ignored. an error does not occur. since the simple demo works
 fine i think its a problem with the validity of variables.
 i'm new to php, so could anybody give me a hint on what mightbe wrong
 with my code please?

 thanx a lot


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



Re: [PHP-DB] mysql, php, mp3 - a variable problem

2003-06-07 Thread Ole Hornauer
hi allowee,

sorry, this was not meant to be. $info2 is supposed to be $info. my 
fault. but that is not the actual problem.

 Hi,
 
 Where do you get $info2 from?
 I only see $info in this function.
 
 .: Allowee
 
  function scan_dir($dir)
  {
  $info = New mphp3(2);
 
  $handle = @opendir($dir);
  while ($file = @readdir ($handle))
  {
  if (eregi(^\.{1,2}$,$file))
  {
  continue;
  }
 
  if(is_dir($dir.$file))
  {
  scan_dir($dir.$file./);
  }
  else
  {
  $info-load(/.$dir.$file);
 
  $query =insert into mp3 (
file,
path,
artist,
title,
album)
  values (
   '$info2-filename',
   '$dir',
   '$info2-v2_artist',
   '$info2-v2_title',
   '$info2-v2_album');;
 
  mysql_query($query);
  }
  }
  @closedir($handle);
  }
  scan_dir(mp3/);
  ?
 
  but all it does is to put the path ($dir) into the database. everything
  else is ignored. an error does not occur. since the simple demo works

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



Re: [PHP-DB] mysql, php, mp3 - a variable problem

2003-06-07 Thread Allowee
hmmm,
maybe this code..

$info-load(/.$dir.$file);

if $dir = mp3s and $file = test.mp3
then it will load '/mp3s/test.mp3'

you got that directory?
I've seen the class and you are hiding the fopen error message, which could be 
the problem.

.: Allowee

On Saturday 07 June 2003 11:11, Ole Hornauer wrote:
 hi allowee,

 sorry, this was not meant to be. $info2 is supposed to be $info. my
 fault. but that is not the actual problem.

  Hi,
 
  Where do you get $info2 from?
  I only see $info in this function.
 
  .: Allowee
 
   function scan_dir($dir)
   {
   $info = New mphp3(2);
  
   $handle = @opendir($dir);
   while ($file = @readdir ($handle))
   {
   if (eregi(^\.{1,2}$,$file))
   {
   continue;
   }
  
   if(is_dir($dir.$file))
   {
   scan_dir($dir.$file./);
   }
   else
   {
   $info-load(/.$dir.$file);
  
   $query =insert into mp3 (
 file,
 path,
 artist,
 title,
 album)
   values (
'$info2-filename',
'$dir',
'$info2-v2_artist',
'$info2-v2_title',
'$info2-v2_album');;
  
   mysql_query($query);
   }
   }
   @closedir($handle);
   }
   scan_dir(mp3/);
   ?
  
   but all it does is to put the path ($dir) into the database. everything
   else is ignored. an error does not occur. since the simple demo works


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



Re: [PHP-DB] mysql, php, mp3 - a variable problem

2003-06-07 Thread Ruprecht Helms
Hi,

 Where do you get $info2 from?
 I only see $info in this function.

I guess that the $info-values are formfieldvalues.
$info-[db-field] is normaly used within a whileloop for
outputing a select-statement.

In the case of formfieldvalues you can use $formfieldname.

 .: Allowee

  function scan_dir($dir)
...
  $query =insert into mp3 (
file,
path,
artist,
title,
album)
  values (
   '$info2-filename',
   '$dir',
   '$info2-v2_artist',
   '$info2-v2_title',
   '$info2-v2_album');;
 
  mysql_query($query);
...

Regards,
Ruprecht

--
Ruprecht Helms IT-Service und Softwareentwicklung

Tel./Fax  +49[0]7621 16 99 16
email:  [EMAIL PROTECTED]
Homep.http://www.rheyn.de

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



Re: [PHP-DB] mysql, php, mp3 - a variable problem

2003-06-07 Thread Allowee
On Saturday 07 June 2003 11:20, Allowee wrote:
 hmmm,
 maybe this code..

 $info-load(/.$dir.$file);

 if $dir = mp3s and $file = test.mp3
 then it will load '/mp3s/test.mp3'

 you got that directory?
 I've seen the class and you are hiding the fopen error message, which could
 be the problem.

 .: Allowee


hmmm.
that won't work..

you can try
$info-load(./.$dir./.$file);

or simple..
$info-load($dir./.$file);

.: Allowee

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



Re: [PHP-DB] mysql, php, mp3 - a variable problem

2003-06-07 Thread Ole Hornauer
well, you are right. the dir '/mp3' does not exist. 'mp3' is a subdir 
from my htdocs dir. so i think the right path should be 
'mp3/someartist/somesong', right?
i fixed that, but the original problem is still the same :(

 hmmm,
 maybe this code..
 
 $info-load(/.$dir.$file);
 
 if $dir = mp3s and $file = test.mp3
 then it will load '/mp3s/test.mp3'
 
 you got that directory?
 I've seen the class and you are hiding the fopen error message, which could be 
 the problem.
 
 .: Allowee
 
 On Saturday 07 June 2003 11:11, Ole Hornauer wrote:
  hi allowee,
 
  sorry, this was not meant to be. $info2 is supposed to be $info. my
  fault. but that is not the actual problem.
 
   Hi,
  
   Where do you get $info2 from?
   I only see $info in this function.
  
   .: Allowee
  
function scan_dir($dir)
{
$info = New mphp3(2);
   
$handle = @opendir($dir);
while ($file = @readdir ($handle))
{
if (eregi(^\.{1,2}$,$file))
{
continue;
}
   
if(is_dir($dir.$file))
{
scan_dir($dir.$file./);
}
else
{
$info-load(/.$dir.$file);
   
$query =insert into mp3 (
  file,
  path,

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



Re: [PHP-DB] mysql, php, mp3 - a variable problem

2003-06-07 Thread Ole Hornauer
moin,

sorry, my php-knowledge is not the best.
what do you mean with formfieldvalues?
i think $info-value is used to get the id3-tag info from the class, 
right? this worked for me in a more simple way without the recursive 
scan:

?
  include(mphp3.php);
  $info = New mphp3(2);

  mysql_connect(192.168.100.12,user,password);
  mysql_select_db(music);

  $info-load(test.mp3);

  $abfrage =insert into mp3 (
  file,
  artist,
  title,
  album)
   values (
 '$info-filename',
 '$info-v2_artist',
 '$info-v2_title',
 '$info-v2_album');;
  mysql_query($abfrage);
?

 Hi,
 
  Where do you get $info2 from?
  I only see $info in this function.
 
 I guess that the $info-values are formfieldvalues.
 $info-[db-field] is normaly used within a whileloop for
 outputing a select-statement.
 
 In the case of formfieldvalues you can use $formfieldname.
 
  .: Allowee
 
   function scan_dir($dir)
 ...
   $query =insert into mp3 (
 file,
 path,
 artist,
 title,
 album)
   values (
'$info2-filename',
'$dir',
'$info2-v2_artist',
'$info2-v2_title',
'$info2-v2_album');;
  
   mysql_query($query);
 ...
 
 Regards,
 Ruprecht
 
 --
 Ruprecht Helms IT-Service und Softwareentwicklung
 
 Tel./Fax  +49[0]7621 16 99 16
 email:  [EMAIL PROTECTED]
 Homep.http://www.rheyn.de
 

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



RE: [PHP-DB] MySql Help needed

2003-03-30 Thread Peter Lovatt
Hi

Try running a grant query

 GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,ALTER
   ON database_name.*
   TO [EMAIL PROTECTED]
   IDENTIFIED BY 'mypassword';


which will probably fix it

Peter

-Original Message-
From: Sparky Kopetzky [mailto:[EMAIL PROTECTED]
Sent: 30 March 2003 04:12
To: [EMAIL PROTECTED]
Subject: [PHP-DB] MySql Help needed


Greetings!

I am building an application in PHP and am creating a global $connect_id for
MySql. I have MySql on a separate machine and am using the connect like
this:

$server = development.myservermachine.net;
$username = myname;
$password = mypassword;
$connect_id = mysql_connect($server, $username, $password);

All I get is 'Access denied for user '[EMAIL PROTECTED]' (Using password:YES)

Now, I know I'm in the DNS server for my system, and the username and
password are correct as I checked the User table.

Any thoughts, ideas, etc. toward fixing this problem??

I'd appreciate any help provided.

Robin Kopetzky
Black Mesa Computer/Internet Services





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



Re: [PHP-DB] MySql, PHP, and Dates

2003-03-30 Thread Jason Wong
On Sunday 30 March 2003 11:11, Bruce Feist wrote:

 I wonder why the PHP/MySql interface doesn't simply return dates as
 dates instead of strings.  *frowns*

How do you mean? PHP doesn't have a date type.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-db
--
/*
Blutarsky's Axiom:
Nothing is impossible for the man who will not listen to reason.
*/


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



Re: [PHP-DB] MySql, PHP, and Dates

2003-03-30 Thread Bruce Feist
Jason Wong wrote:
On Sunday 30 March 2003 11:11, Bruce Feist wrote:

I wonder why the PHP/MySql interface doesn't simply return dates as
dates instead of strings.  *frowns*
How do you mean? PHP doesn't have a date type.

Ummm That's a good reason!  As I said, I'm a newbie to PHP, and 
somewhere along the line I got the idea that there was an actual date 
data type.  I don't know where I got that idea; the book I've been using 
certainly doesn't say that it does, although I thought I did.

It's times like this that I wish that I had smaller feet or a larger 
mouth, to make it easier to remove the one from the other!

Thanks.

Bruce Feist

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


Re: [PHP-DB] MySql, PHP, and Dates

2003-03-29 Thread Bruce Feist
I originally wrote:

when I retrieve a date from MySQL into PHP, it shows up as a string instead of a date data type
 What's the best way of controlling date format?

John W. Holmes replied:

If you want a Unix timestamp, which is compatible with the date()
function in PHP, then use the UNIX_TIMESTAMP() function in your SQL.
This seems to be the ideal solution.  Thanks, John, and also those of 
you who responded via private e-mail.

I wonder why the PHP/MySql interface doesn't simply return dates as 
dates instead of strings.  *frowns*

Bruce Feist

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


RE: [PHP-DB] MySql, PHP, and Dates

2003-03-28 Thread John W. Holmes
 I'm experienced with SQL, but new to MySql and PHP, which I'm using
 together to create a dynamic web site.  Right now, I'm having minor
 difficulties with date formatting.  It seems that when I retrieve a
date
 from MySQL into PHP, it shows up as a string instead of a date data
 type, with format -MM-DD HH:MM:SS.  Is there any way that I can
get
 it returned as a PHP date instead?  Also, exactly what is it that
 controls the output format of the date as a string?  Is PHP somehow
 requesting that MySql return the date as a string, or is it getting a
 date from MySql and then converting it to a string on the PHP side?
 
 What's the best way of controlling date format?  Obviously, I could
use
 string operators to extract the year, month, and day and do whatever I
 want to with them, but that's sensitive to how PHP and/or MySql are
 configured, I assume; it would be better for me to request the date in
a
 specific form (ideally one taken from operating system preferences).

A couple different ways you can handle this. To format the timestamp
from -MM-DD HH:MM:SS to something else, you can use the
DATE_FORMAT() function within your SQL. It works almost exactly like the
date() function in PHP. 

If you want to get the output from MySQL as an integer, you can use
SELECT column+0 which will return the timestamp in a MMDDHHMMSS
format. 

If you want a Unix timestamp, which is compatible with the date()
function in PHP, then use the UNIX_TIMESTAMP() function in your SQL.

You could also use the strtotime() function in PHP to take the MySQL
timestamp and convert it to a Unix timestamp. 

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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



RE: [PHP-DB] MySQL or Postgres

2003-03-24 Thread Snijders, Mark
hi,

Ih ate people being so lazy..

open google and type the words: mysql postgres

and you get enough results, here i looked one up for you:

http://www.mmlabx.ua.es/mysql-postgres.html
http://www.mmlabx.ua.es/mysql-postgres.html 



___ 

Mark Snijders, Developer 
Atos Origin 
Groenewoudeseweg 1, Room VN-515 
5621 BA  Eindhoven, The Netherlands 
*   : [EMAIL PROTECTED] 
*:+31 (0)40 - 2785992 (tel) 
* : +31 (0)40 - 2788729 (fax) 

The information in this mail is intended only for use of the individual or
entity to which it is addressed and may contain information that is
privileged, confidential and exempt from disclosure under applicable law.
Access to this mail by anyone else than the addressee is unauthorized. If
you are not the intended recipient, any disclosure, copying, distribution or
any action taken omitted to be taken in reliance of it, is prohibited and
may be unlawful.



-Original Message-
From: Ben Edwards [ mailto:[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED] ]
Sent: maandag 24 maart 2003 12:03
To: [EMAIL PROTECTED]
Subject: [PHP-DB] MySQL or Postgres


Could someone please point me in the correct direction for a decent
comparison of the two in respect of:-

   Reliability
   Scalability
   Speed
   Functionality

These are actually in order or importance to me (I know both are fairly
fast).

I am also interested in how easy it would be to migrate from MySQL to
Postgress.

Proples general experiences/comments also welcome.

Beb


* Ben Edwards  +44 (0)117 968 2602 *
* Critical Site Builderhttp://www.criticaldistribution.com
http://www.criticaldistribution.com  *
* online collaborative web authoring content management system *
* Get alt news/views films online   http://www.cultureshop.org
http://www.cultureshop.org  *
* i-Contact Progressive Video  http://www.videonetwork.org
http://www.videonetwork.org  *
* Smashing the Corporate image   http://www.subvertise.org
http://www.subvertise.org  *
* Bristol Indymedia   http://bristol.indymedia.org
http://bristol.indymedia.org  *
* Bristol's radical news http://www.bristle.org.uk
http://www.bristle.org.uk  *
* PGP : F0CA 42B8 D56F 28AD 169B  49F3 3056 C6DB 8538 EEF8 *




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

RE: [PHP-DB] MySQL or Postgres

2003-03-24 Thread Snijders, Mark
sorry the url I gave was of a weird language..

this one is better:

http://www.phpbuilder.com/columns/tim2705.php3



-Original Message-
From: Ben Edwards [mailto:[EMAIL PROTECTED]
Sent: maandag 24 maart 2003 12:03
To: [EMAIL PROTECTED]
Subject: [PHP-DB] MySQL or Postgres


Could someone please point me in the correct direction for a decent 
comparison of the two in respect of:-

   Reliability
   Scalability
   Speed
   Functionality

These are actually in order or importance to me (I know both are fairly
fast).

I am also interested in how easy it would be to migrate from MySQL to 
Postgress.

Proples general experiences/comments also welcome.

Beb


* Ben Edwards  +44 (0)117 968 2602 *
* Critical Site Builderhttp://www.criticaldistribution.com *
* online collaborative web authoring content management system *
* Get alt news/views films online   http://www.cultureshop.org *
* i-Contact Progressive Video  http://www.videonetwork.org *
* Smashing the Corporate image   http://www.subvertise.org *
* Bristol Indymedia   http://bristol.indymedia.org *
* Bristol's radical news http://www.bristle.org.uk *
* PGP : F0CA 42B8 D56F 28AD 169B  49F3 3056 C6DB 8538 EEF8 *



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



RE: [PHP-DB] MySQL or Postgres

2003-03-24 Thread Ben Edwards
Where MySQL loses points in the daemon robustness department, it makes up 
for it by apparently never corrupting its data files. The last thing you 
want is your precious data files fouled randomly, and MySQL does well here. 
In over a year of running MySQL, I haven't ever seen a single case of 
database or index corruption. In the same timeframe, I have done 2 or 3 
recoveries of a couple different Postgres databases. (irregardless, backups 
are always your best friend, as shown by the database fiasco here on 
PHPBuilder) 

This clinched it.  Although I was keen to use postages due to its better 
functionality, the issue with it corrupting data files means I will be 
going for MySQL.

At 12:04 24/03/2003 +0100, Snijders, Mark wrote:

sorry the url I gave was of a weird language..

this one is better:

http://www.phpbuilder.com/columns/tim2705.php3



-Original Message-
From: Ben Edwards [mailto:[EMAIL PROTECTED]
Sent: maandag 24 maart 2003 12:03
To: [EMAIL PROTECTED]
Subject: [PHP-DB] MySQL or Postgres
Could someone please point me in the correct direction for a decent
comparison of the two in respect of:-
   Reliability
   Scalability
   Speed
   Functionality
These are actually in order or importance to me (I know both are fairly
fast).
I am also interested in how easy it would be to migrate from MySQL to
Postgress.
Proples general experiences/comments also welcome.

Beb


* Ben Edwards  +44 (0)117 968 2602 *
* Critical Site Builderhttp://www.criticaldistribution.com *
* online collaborative web authoring content management system *
* Get alt news/views films online   http://www.cultureshop.org *
* i-Contact Progressive Video  http://www.videonetwork.org *
* Smashing the Corporate image   http://www.subvertise.org *
* Bristol Indymedia   http://bristol.indymedia.org *
* Bristol's radical news http://www.bristle.org.uk *
* PGP : F0CA 42B8 D56F 28AD 169B  49F3 3056 C6DB 8538 EEF8 *

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


---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.449 / Virus Database: 251 - Release Date: 27/01/2003

* Ben Edwards  +44 (0)117 968 2602 *
* Critical Site Builderhttp://www.criticaldistribution.com *
* online collaborative web authoring content management system *
* Get alt news/views films online   http://www.cultureshop.org *
* i-Contact Progressive Video  http://www.videonetwork.org *
* Smashing the Corporate image   http://www.subvertise.org *
* Bristol Indymedia   http://bristol.indymedia.org *
* Bristol's radical news http://www.bristle.org.uk *
* PGP : F0CA 42B8 D56F 28AD 169B  49F3 3056 C6DB 8538 EEF8 *


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.449 / Virus Database: 251 - Release Date: 27/01/2003

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

RE: [PHP-DB] mysql timestamps

2003-03-24 Thread John W. Holmes
Sorry, the function is UNIX_TIMESTAMP(date). That will create a unix
timestamp from your date column. Use FROM_UNIXTIME() to create a MySQL
timestamp from a unix one. 

I'd recommend, though, that you just look up DATE_FORMAT() in the MySQL
manual and just use that.

http://www.mysql.com/documentation/mysql/bychapter/manual_Reference.html
#Date_and_time_functions

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/

 -Original Message-
 From: Paul Sharpe [mailto:[EMAIL PROTECTED]
 Sent: Monday, March 24, 2003 7:34 AM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP-DB] mysql timestamps
 
 I hope you don't mind me bothering you like this but you seem to know
what
 you're talking about, you replied to my post on php.db in case you are
 wondering who the heck I am.
 
 I tried the SELECT TO_UNIXTIME(your_column) FROM table command in
mysql,
 but i got an error returned
 ERROR 1064: You have an error in your SQL syntax near '(date) FROM
news'
 at
 line 1
 
 I've tried putting a space between the TO_UNIXTIME and (date) --the
name
 of
 my column  but still no avail
 
 If you don't want me bothering you let me know
 
 Any help would be genuinely appreciated
 
 thanks
 Paul Sharpe
 - Original Message -
 From: John W. Holmes [EMAIL PROTECTED]
 To: 'Paul Sharpe' [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Sent: Monday, March 24, 2003 3:08 AM
 Subject: RE: [PHP-DB] mysql timestamps
 
 
   how do i change the format of a MySQL timestamp (i.e hh:mm:ss
  DD/MM/
   instead of MMDDhhmmss) retrieved from a mysql database with
php?
 
  Use
 
  SELECT TO_UNIXTIME(your_column) FROM table ...
 
  And then use date() in PHP to format the result to your liking.
 
  Or, you can use DATE_FORMAT() in your query to format the result to
your
  liking.
 
  ---John W. Holmes...
 
  PHP Architect - A monthly magazine for PHP Professionals. Get your
copy
  today. http://www.phparch.com/
 
 
 
  --
  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] MySQL or Postgres

2003-03-24 Thread May, Patrick
Ben,

 Subject: [PHP-DB] MySQL or Postgres
 
 
 Could someone please point me in the correct direction for a decent 
 comparison of the two in respect of:-
 
Reliability
Scalability
Speed
Functionality
 
 These are actually in order or importance to me (I know both 
 are fairly fast).
 
 I am also interested in how easy it would be to migrate from MySQL to 
 Postgress.
 
 Proples general experiences/comments also welcome.

There are other open-source databases besides MySQL and Postgres.  My
experience has pointed me towards firebird / interbase:

http://firebird.sourceforge.net/

~ Patrick


Re: [PHP-DB] MySQL or Postgres

2003-03-24 Thread Lester Caine
There are other open-source databases besides MySQL and Postgres.  My
experience has pointed me towards firebird / interbase:
http://firebird.sourceforge.net/
Same here - 24/7 operation and Windows or Linux servers

--
Lester Caine
-
L.S.Caine Electronic Services
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP-DB] mysql database ****.sql thru a php script

2003-03-23 Thread John W. Holmes
 I have a large sql file that I would like to load into mysql database
from
 a
 remote client.  Is there a way through a php script to do this?
 
 I have tried $query =  contents of database.sql ; (where the
contents
 of
 the sql file was pasted into the query)
 
 then $results = mysql_db_query(database, $query);
 
 but it fails.  Any ideas or experience?

You can only run one query at a time. If it is a really large file,
you'll probably want to make an exec() call to have mysql load the file
itself.

$result = `mysql -uroot -ppassword database_name  filename.sql`

Those are backticks, not single quotes. $result should be empty if
everything went well. Adapt to your needs. 

Or, here's part of a little script I wrote that'll read and execute
*.sql files (from MySQLDump). The str_replace() adds in a table prefix.
This works with my script using ADOdb, so adapt to your needs. 

$sql_file = 'survey2.inc';
$file = file($sql_file);
foreach($file as $line)
{
if($line{0} != '#'  strlen($line)  0)
{
$query .= trim($line);
if(substr($query,-1) == ;)
{
$query =
str_replace('%PREFIX%',$survey-CONF['db_tbl_prefix'],$query);
$query = substr($query,0,-1);

$rs = $survey-db-Execute($query);
if($rs === FALSE)
{ 
$error = TRUE;
echo 'brbr' . $survey-db-ErrorMsg();
}
$query = '';
}
}
}

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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



RE: [PHP-DB] mysql timestamps

2003-03-23 Thread John W. Holmes
 how do i change the format of a MySQL timestamp (i.e hh:mm:ss
DD/MM/
 instead of MMDDhhmmss) retrieved from a mysql database with php?

Use

SELECT TO_UNIXTIME(your_column) FROM table ...

And then use date() in PHP to format the result to your liking.

Or, you can use DATE_FORMAT() in your query to format the result to your
liking.

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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



Re: [PHP-DB] MySQL Query help please!

2003-03-12 Thread Mark
I just set up a test db using your info, and the query you have
worked ok. It provided a zero. Here's what I have (slightly modified
from yours, but not appreciably).

select ports.port, sum(stats.amount) as Total from ports left join
stats on ports.port=stats.to_port group by ports.port order by Total
desc

Data:
Ports
-
UK
France
Germany
Italy

Stats
-
France  1000
Italy   3000
UK  2000
France  1000
UK  5000

Result:
UK  7000
Italy   3000
France  2000
Germany 0

--- Griffiths, Daniel [EMAIL PROTECTED] wrote:
 Hi all,
 
 I have 2 tables that I need to extract data from, say PORTS and
 STATS.
 
 PORTS contains a list of Sea Ports in PORT i.e. : -
 
 PORTS.PORT
 
 UK
 FRANCE
 GERMANY
 NETHERLANDS
 SPAIN
 ITALY
   
 STATS contains a few thousand records that with among other things
 has the elements TO_PORT and AMOUNT.
 
 the entries in TO_PORT match the ports in PORT.
 
 Now one of the things I want to do is produce a summary of the
 totals of AMOUNT against the ports in PORTS, including (and this is
 the important bit that I'm stuck on) the ports in PORTS that do not
 have a match in STATS.TO_PORT. so that I get a result such as : -
 
 UK300
 FRANCE100
 GERMANY   400
 NETHERLANDS   0
 SPAIN 0
 ITALY 300
 
 and NOT :-
 
 UK300
 FRANCE100
 GERMANY   400
 ITALY 300
 
 Which is all I can get at the moment.
 
 the query I am using is : -
 
 SELECT PORTS.PORT, SUM(STATS.AMOUNT) FROM PORTS LEFT JOIN STATS ON
 PORTS.PORT = STATS.TO_PORT GROUP BY PORTS.PORT
 
 Basicaly what I want to do is pull out a list of all entries in
 PORTS.PORT and put a total figure against it from STATS.AMOUNT
 where the STATS.TO_PORT matches PORTS.PORT and just a zero if
 theres no entry in STATS.
 
 Anyone got any ideas?
 
 Thanks
 
 Dan
 
 
 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


=
Mark Weinstock
[EMAIL PROTECTED]
***
You can't demand something as a right unless you are willing to fight to death to 
defend everyone else's right to the same thing.
***

__
Do you Yahoo!?
Yahoo! Web Hosting - establish your business online
http://webhosting.yahoo.com

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



RE: [PHP-DB] MySQL Query help please!

2003-03-12 Thread Griffiths, Daniel
urm, so it does..,

thank you for your polite reply, I had included a month element in my query but left 
it out cos i didnt think it made a dufference, of course i was using a where month = 1 
clause after the ON bit which was limiting the link to those records, duh!

cheers

Dan

-Original Message-
From: Mark [mailto:[EMAIL PROTECTED]
Sent: 12 March 2003 15:36
To: Griffiths, Daniel
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] MySQL Query help please!


I just set up a test db using your info, and the query you have
worked ok. It provided a zero. Here's what I have (slightly modified
from yours, but not appreciably).

select ports.port, sum(stats.amount) as Total from ports left join
stats on ports.port=stats.to_port group by ports.port order by Total
desc

Data:
Ports
-
UK
France
Germany
Italy

Stats
-
France  1000
Italy   3000
UK  2000
France  1000
UK  5000

Result:
UK  7000
Italy   3000
France  2000
Germany 0

--- Griffiths, Daniel [EMAIL PROTECTED] wrote:
 Hi all,
 
 I have 2 tables that I need to extract data from, say PORTS and
 STATS.
 
 PORTS contains a list of Sea Ports in PORT i.e. : -
 
 PORTS.PORT
 
 UK
 FRANCE
 GERMANY
 NETHERLANDS
 SPAIN
 ITALY
   
 STATS contains a few thousand records that with among other things
 has the elements TO_PORT and AMOUNT.
 
 the entries in TO_PORT match the ports in PORT.
 
 Now one of the things I want to do is produce a summary of the
 totals of AMOUNT against the ports in PORTS, including (and this is
 the important bit that I'm stuck on) the ports in PORTS that do not
 have a match in STATS.TO_PORT. so that I get a result such as : -
 
 UK300
 FRANCE100
 GERMANY   400
 NETHERLANDS   0
 SPAIN 0
 ITALY 300
 
 and NOT :-
 
 UK300
 FRANCE100
 GERMANY   400
 ITALY 300
 
 Which is all I can get at the moment.
 
 the query I am using is : -
 
 SELECT PORTS.PORT, SUM(STATS.AMOUNT) FROM PORTS LEFT JOIN STATS ON
 PORTS.PORT = STATS.TO_PORT GROUP BY PORTS.PORT
 
 Basicaly what I want to do is pull out a list of all entries in
 PORTS.PORT and put a total figure against it from STATS.AMOUNT
 where the STATS.TO_PORT matches PORTS.PORT and just a zero if
 theres no entry in STATS.
 
 Anyone got any ideas?
 
 Thanks
 
 Dan
 
 
 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


=
Mark Weinstock
[EMAIL PROTECTED]
***
You can't demand something as a right unless you are willing to fight to death to 
defend everyone else's right to the same thing.
***

__
Do you Yahoo!?
Yahoo! Web Hosting - establish your business online
http://webhosting.yahoo.com

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



RE: [PHP-DB] mysql delete loop (SOLVED)

2003-03-07 Thread Jason End
I found that my what I had could actually do the
trick. Basically I didn't know that you could make a
delete statement like this:
DELETE FROM apliexpert WHERE ( id = 2 OR id = 7 OR
id = 1) AND softid = 3

So my code goes:
 code 
for ($index = 0; $index  $total_records; $index++) {
if (isset($userID[$index])) {
 $sql2 .=  OR id = \ . $id[$index] . \;
}
}

$sql2 = substr($sql2,3);
$query = DELETE FROM apliexpert WHERE ( . $sql2 . )
AND softid = \$softID\;
 end 

J
--- Snijders, Mark [EMAIL PROTECTED]
wrote:
 before doing a action, try to print it into the loop
 
 so try first:  echo $sql2br;
 
 and you'll see that there is a mistake somewhere i
 guess...
 
 did you check hhow often he goes trhough the loop?
 
 
 
 -Original Message-
 From: Jason End [mailto:[EMAIL PROTECTED]
 Sent: vrijdag 7 maart 2003 11:53
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] mysql delete loop
 
 
 
 displayexpt.php?softID=$softID displays a checkbox
 list of experts for a given piece of software. The
 admin needs to select each user he wants to delete.
 This is then posted to
 deleteexpt.php?softID=$softID,
 which must delete users from the apliexpert table
 with
 a statement like this:
 DELETE FROM apliexpert WHERE id=$id AND
 softID=$softID;
 
 Given more than one expert may need to be deleted I
 think I need some kind of loop that makes a passes a
 different delete statement for each $id. To handle
 the
 multiple $ids I have the following for loop:
 # code 
 for ($index = 0; $index  $total_records; $index++)
 {
 if (isset($id[$index])) {
  $sql2 .= Clave = \ . $id[$index] . \;
 }
 # end 
 
 I've tried changing $sql2 to:
 DELETE FROM apliexpert WHERE id = \ . $id[$index]
 .
 \;
 
 but the loop doesn't work; it deletes the first
 record
 and then stops.
 
 thanks :))
 
 J
 
 __
 Do you Yahoo!?
 Yahoo! Mail Plus - Powerful. Affordable. Sign up
 now.
 http://mailplus.yahoo.com
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 


__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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



RE: [PHP-DB] mysql statement: two tables, two comparisons

2003-03-06 Thread Beverly Steiner
J,

Try this (it assumes that the softid you want to search for is in the
variable $softid):

$sql = SELECT Expert.*
FROM Expert
LEFT JOIN Apliexpert ON Expert.id = Apliexpert.exptid
WHERE Apliexpert.softid = '$softid'
ORDER BY Expert.Name;

--
Beverly Steiner
[EMAIL PROTECTED]



-Original Message-
From: Jason End [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 06, 2003 8:52 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] mysql statement: two tables, two comparisons


I'm looking for a mysql select statement that does the
following:

- Check if the value of each expert.id on the table
experts matches a value expt.id in the table
apliexpert.
- For those values where this is true check whether
the softID value for that row matches the variable
$softId.
- return the names that are left after those 2 filters

So for tables:

Expert
idName
1Peter
2Paul
3Mary
4Frank

Apliexpert
exptid  softid
1   3
2   5
2   8
3   9
3   8

1. If the softID is 2, the select should return:
peter, paul, mary and frank (frank will always be
returned no matter what, because he isn't in
apliexpert)
2. If the softID is 3, the select should return: paul,
mary and frank
3. If the softID is 8, the select should return: peter
and frank
4. If the softID is 9, the select should return:
peter, paul and frank

J

__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

--
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] Mysql compress text field?

2003-03-04 Thread 1LT John W. Holmes
 I have a new project where i need show pages of report on demmand.
That
 reports are created in the batch process, and the whole file size is about
5
 Gb. (thats includes all the reports in a month, I need save about 12
month).

 I think in two alternatives :

 1. I save the links in a mysql database, but the files are compressed
 (in zip format) in several directories, one directorie by day, so when the
 user request one report, I query the database, go to the path, decompress
 the file and return to the user.

Use this method.

 2. I save the reports on the mysql database, so when the user request
 one report, I query the database and return the report. But if MySql don't
 compress the text field, that way is not practicable (HDD is limited).

You'd have to zip the files, then read the data to insert into the table.
Then, to retrieve, you'd have to select the data out, write it to a file and
unzip it before you sent it to the user. (According to your remarks) Sounds
like a lot of wasted time to me.

---John Holmes...


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



Re: [PHP-DB] mysql to cvs file to excel

2003-02-23 Thread Ruth Zhai
This is what I use to generate a comma delimited csv file:

   $sql = SELECT * FROM table INTO OUTFILE 'file.csv'
 . FIELDS TERMINATED BY \',\'
 . ENCLOSED BY \'\\';

Hope this helps.

Ruth


 
- Original Message - 
From: Snijders, Mark [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, February 21, 2003 8:59 PM
Subject: [PHP-DB] mysql to cvs file to excel


 hello,
 
 does anybody know if it's possible (without php)
 
 to export data from mysql to a cvs file, so i can import it in excel???
 
 so is it possible, and if yes.. how?
 
 thanks kinds regards,
 
 Mark Snijders
 
 
 
 
 
 -- 
 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] mysql to cvs file to excel

2003-02-21 Thread Bruno Pereira
I had the some problem and someone told me this

What is your problem exactly?

Have you investigated the MySQL manual under:
LOAD DATA INFILE
SELECT ... INTO OUTFILE ?

And it realy helped.

Cumprimentos

Bruno Pereira
[EMAIL PROTECTED]

-Original Message-
From: Snijders, Mark [mailto:[EMAIL PROTECTED]]
Sent: sexta-feira, 21 de Fevereiro de 2003 9:59
To: [EMAIL PROTECTED]
Subject: [PHP-DB] mysql to cvs file to excel


hello,

does anybody know if it's possible (without php)

to export data from mysql to a cvs file, so i can import it in excel???

so is it possible, and if yes.. how?

thanks kinds regards,

Mark Snijders





-- 
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] mysql +php

2003-02-17 Thread Ryan Jameson (USA)
while ($row= mysql_fetch_array($result)) //retrieve a row and store in 
echo A HREF= .$row['UrlColumnName'].; 

That's how I'd do it.
 Ryan

-Original Message-
From: G [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 17, 2003 8:16 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] mysql +php 


Hi I was wonder if any knows how 2 display sound clips held in a mysql 
database using a php page ? I have stored the url’s of the clips in 
mysql database and I belive I need some like to (below) to display them 
but its not quite working.


while ($row= mysql_fetch_row($result)) //retrieve a row and store in 
array $row
{
for($i=0; $imysql_num_fields($result);$i++) //
echo (A HREF= $row[$i]); //

any ideas


-- 
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] mysql +php

2003-02-17 Thread Ryan Jameson (USA)
BTW... you'll need something in the anchor:

while ($row= mysql_fetch_array($result)) //retrieve a row and store in 
echo A HREF= .$row['UrlColumnName'].Something/a; 


-Original Message-
From: Ryan Jameson (USA) 
Sent: Monday, February 17, 2003 12:16 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] mysql +php 


while ($row= mysql_fetch_array($result)) //retrieve a row and store in 
echo A HREF= .$row['UrlColumnName'].; 

That's how I'd do it.
 Ryan

-Original Message-
From: G [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 17, 2003 8:16 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] mysql +php 


Hi I was wonder if any knows how 2 display sound clips held in a mysql 
database using a php page ? I have stored the url’s of the clips in 
mysql database and I belive I need some like to (below) to display them 
but its not quite working.


while ($row= mysql_fetch_row($result)) //retrieve a row and store in 
array $row
{
for($i=0; $imysql_num_fields($result);$i++) //
echo (A HREF= $row[$i]); //

any ideas


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




Re: [PHP-DB] mysql +php

2003-02-17 Thread G
Thanks got it working


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




Re: [PHP-DB] MySQL problem -- new to PHP

2003-02-14 Thread Evan Morris
Thanks for all the help everyone sent me on this. However, nothing seems to
make any difference whatsoever (except putting the 'localhost' part in
quotes). I am still getting permission denied errors based on the user
credentials.

I have entered a user into the user table with host='localhost', user='php'
and a password.
I have entered these credentials into the db table also, and given the
various privileges for this user to the specific database.
I have run both mysqladmin reload and mysqladmin flush-privileges.
I have even rebooted the machine.
I have also tried typing GRANT SELECT,INSERT,DELETE,UPDATE TO php@localhost
IDENTIFED BY ***, but this just throws up an error at the MySQL prompt.

My PHP page can still not connect to the database. It just says:

MySQL Connection Failed: Access denied for user: 'php@localhost' (Using
password: YES)

I know the problem is a permissions thing, because if I connect to the test
database as 'nobody', there is no problem.

Again, any and all help will be appreciated. This is ridiculously
frustrating, especially since I have no problem connecting to the database
from a perl script. I am tempted to stop trying to learn PHP and build my
entire web site using perl cgi instead.

Thanks

Evan Morris
[EMAIL PROTECTED]
Tel: +27 11 792 2777
Fax: +27 11 792 2711
Cell: +27 82 926 3630



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




Re: [PHP-DB] MySQL problem -- new to PHP

2003-02-14 Thread Mike Peters
On Fri, 14 Feb 2003 11:30:03 +0200
[EMAIL PROTECTED] (Evan Morris) wrote:

 Thanks for all the help everyone sent me on this. However, nothing
 seems to make any difference whatsoever (except putting the
 'localhost' part in quotes). I am still getting permission denied
 errors based on the user credentials.
 
 I have entered a user into the user table with host='localhost',
 user='php' and a password.
 I have entered these credentials into the db table also, and given the
 various privileges for this user to the specific database.
 I have run both mysqladmin reload and mysqladmin flush-privileges.
 I have even rebooted the machine.
 I have also tried typing GRANT SELECT,INSERT,DELETE,UPDATE TO
 php@localhost IDENTIFED BY ***, but this just throws up an error
 at the MySQL prompt.
 

Try:
GRANT ALL PRIVILEGES ON *.* TO php@localhost IDENTIFIED BY 'pass' WITH
GRANT OPTION;
To give user php admin access for testing (you may want to revoke this
later). Remember to:
FLUSH PRIVILEGES;
to put the new privileges into affect.

 My PHP page can still not connect to the database. It just says:
 
 MySQL Connection Failed: Access denied for user: 'php@localhost'
 (Using password: YES)
 
 I know the problem is a permissions thing, because if I connect to the
 test database as 'nobody', there is no problem.
 

Can you connect as php from the prompt?

 Again, any and all help will be appreciated. This is ridiculously
 frustrating, especially since I have no problem connecting to the
 database from a perl script. I am tempted to stop trying to learn PHP
 and build my entire web site using perl cgi instead.
 
 You might want to create a new user for testing using the GRANT command
above, don't enter anything into the host or db tables as I suspect this
is where things are fouled.

-- 
Mike

Registered Linux User #247123

It was all very well going about pure logic and how the universe was
ruled by logic and the harmony of numbers, but the plain fact was that
the disc was manifestly traversing space on the back of a giant turtle
and the gods had a habit of going round to atheists' houses and smashing
their windows.
(Colour of Magic)

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




RE: [PHP-DB] MySQL problem -- new to PHP

2003-02-13 Thread Clarkson, Nick

Looks like is to do with MySQL permissions. Check your host's (the one you
are trying to connect from) permissions to the server.

To change permissions, from the MySQL prompt type;

GRANT ALL ON * TO username@host IDENTIFIED BY password;

Substitute in username, host and password for your ones.

Easier to use PHPMyAdmin or SQLYog (www.sqlyog.com) if you're new to it. I'm
pretty new, so learning all the time.

A couple of links to get you started;
http://www.mysql.com/doc/en/GRANT.html
http://www.mysql.com/doc/en/GRANT.html

Good luck,

Nick



-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: 13 February 2003 13:20
To: [EMAIL PROTECTED]
Subject: [PHP-DB] MySQL problem -- new to PHP


Hi all

I am new to PHP (just basically started yesterday). I am currently having a
problem connecting to a MySQL database.

My sample code is:

--
?php
mysql_connect(localhost,username,password) or die (Unable to connect to
MySQL server.);
$db = mysql_select_db(DB_NAME) or die (Unable to select requested
database.);
?
---

This throws the following error:

---
Warning: MySQL Connection Failed: Host 'my.host.name' is not allowed to
connect to this MySQL server
---

Now, the mySQL server and the web server reside on the same machine. This
warning is therefore saying that this machine does not have permission to
connect to itself. Hmm. I have put entries in the host table and the user
table, using both hostname and ip address, but no luck. I keep getting the
same error.

What am I doing wrong?

Any and all help appreciated.

Thanks

Evan Morris
[EMAIL PROTECTED]
+27 11 792 2777 (tel)
+27 11 792 2711 (fax)



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


This private and confidential e-mail has been sent to you by Egg.
The Egg group of companies includes Egg Banking plc
(registered no. 2999842), Egg Financial Products Ltd (registered
no. 3319027) and Egg Investments Ltd (registered no. 3403963) which
carries out investment business on behalf of Egg and is regulated
by the Financial Services Authority.  
Registered in England and Wales. Registered offices: 1 Waterhouse Square,
138-142 Holborn, London EC1N 2NA.
If you are not the intended recipient of this e-mail and have
received it in error, please notify the sender by replying with
'received in error' as the subject and then delete it from your
mailbox.


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




RE: [PHP-DB] MySQL problem -- new to PHP

2003-02-13 Thread Clarkson, Nick

PHPMyAdmin is just a web-based tool for administering MySQL and it's pretty
intuitive, assuming you've used similar tools before. You can download it
and read more here http://www.phpwizard.net/projects/phpMyAdmin/

I would recommend SQLYog as an alternative;
http://www.webyog.com/sqlyog/index.html as it's VERY intuitive and pretty
simple to use.

But then you can't beat going straight into the MySQL prompt and learning
from there

Here are some good links for tutorials and examples;

www.php.net and www.mysql.com for searching on specific functions - unless
you have the memory of a few Cray computers ;o)

http://www.evilwalrus.com
http://www.zend.com/zend/tut/
http://www.devshed.com/Server_Side/MySQL/
http://www.devshed.com/Server_Side/PHP/

There are tons out there, but they are good starting points.

Good luck,

Nick




-Original Message-
From: Mark Loewenberg [mailto:[EMAIL PROTECTED]]
Sent: 13 February 2003 14:01
To: Clarkson, Nick
Subject: Re: [PHP-DB] MySQL problem -- new to PHP


Well you opened up my question!  Do you know where to learn PHPMyAdmin?

Thanks in advance,

Mark

Clarkson, Nick wrote:

Looks like is to do with MySQL permissions. Check your host's (the one you
are trying to connect from) permissions to the server.

To change permissions, from the MySQL prompt type;

GRANT ALL ON * TO username@host IDENTIFIED BY password;

Substitute in username, host and password for your ones.

Easier to use PHPMyAdmin or SQLYog (www.sqlyog.com) if you're new to it.
I'm
pretty new, so learning all the time.

A couple of links to get you started;
http://www.mysql.com/doc/en/GRANT.html
http://www.mysql.com/doc/en/GRANT.html

Good luck,

Nick



-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: 13 February 2003 13:20
To: [EMAIL PROTECTED]
Subject: [PHP-DB] MySQL problem -- new to PHP


Hi all

I am new to PHP (just basically started yesterday). I am currently having a
problem connecting to a MySQL database.

My sample code is:

--
?php
mysql_connect(localhost,username,password) or die (Unable to connect
to
MySQL server.);
$db = mysql_select_db(DB_NAME) or die (Unable to select requested
database.);
?
---

This throws the following error:

---
Warning: MySQL Connection Failed: Host 'my.host.name' is not allowed to
connect to this MySQL server
---

Now, the mySQL server and the web server reside on the same machine. This
warning is therefore saying that this machine does not have permission to
connect to itself. Hmm. I have put entries in the host table and the user
table, using both hostname and ip address, but no luck. I keep getting the
same error.

What am I doing wrong?

Any and all help appreciated.

Thanks

Evan Morris
[EMAIL PROTECTED]
+27 11 792 2777 (tel)
+27 11 792 2711 (fax)



  


-- 

Mark Loewenberg
770 428 1071
[EMAIL PROTECTED]
http://www.ITSbiz.net

Affordable Website Design
Website Hosting @ $9.95/month

ITSbiz also provides:
IT Solutions
Phone Systems
Phone  Data Wiring Services




This private and confidential e-mail has been sent to you by Egg.
The Egg group of companies includes Egg Banking plc
(registered no. 2999842), Egg Financial Products Ltd (registered
no. 3319027) and Egg Investments Ltd (registered no. 3403963) which
carries out investment business on behalf of Egg and is regulated
by the Financial Services Authority.  
Registered in England and Wales. Registered offices: 1 Waterhouse Square,
138-142 Holborn, London EC1N 2NA.
If you are not the intended recipient of this e-mail and have
received it in error, please notify the sender by replying with
'received in error' as the subject and then delete it from your
mailbox.


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




RE: [PHP-DB] MySQL problem -- new to PHP

2003-02-13 Thread Gary . Every
If you cut and pasted your code, try to put localhost into quotes as well.


Gary Every
Sr. UNIX Administrator
Ingram Entertainment
(615) 287-4876
Pay It Forward
mailto:[EMAIL PROTECTED]
http://accessingram.com


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 13, 2003 7:20 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] MySQL problem -- new to PHP


Hi all

I am new to PHP (just basically started yesterday). I am currently having a
problem connecting to a MySQL database.

My sample code is:

--
?php
mysql_connect(localhost,username,password) or die (Unable to connect to
MySQL server.);
$db = mysql_select_db(DB_NAME) or die (Unable to select requested
database.);
?
---

This throws the following error:

---
Warning: MySQL Connection Failed: Host 'my.host.name' is not allowed to
connect to this MySQL server
---

Now, the mySQL server and the web server reside on the same machine. This
warning is therefore saying that this machine does not have permission to
connect to itself. Hmm. I have put entries in the host table and the user
table, using both hostname and ip address, but no luck. I keep getting the
same error.

What am I doing wrong?

Any and all help appreciated.

Thanks

Evan Morris
[EMAIL PROTECTED]
+27 11 792 2777 (tel)
+27 11 792 2711 (fax)



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



Re: [PHP-DB] MySQL problem -- new to PHP

2003-02-13 Thread Mignon Hunter
When changing/adding permissions to the mysql db for specific users,
dont forget to do 'flush privileges'...

my 2 cents


On Thu, 2003-02-13 at 07:19, Evan Morris wrote:
 Hi all
 
 I am new to PHP (just basically started yesterday). I am currently having a
 problem connecting to a MySQL database.
 
 My sample code is:
 
 --
 ?php
 mysql_connect(localhost,username,password) or die (Unable to connect to
 MySQL server.);
 $db = mysql_select_db(DB_NAME) or die (Unable to select requested
 database.);
 ?
 ---
 
 This throws the following error:
 
 ---
 Warning: MySQL Connection Failed: Host 'my.host.name' is not allowed to
 connect to this MySQL server
 ---
 
 Now, the mySQL server and the web server reside on the same machine. This
 warning is therefore saying that this machine does not have permission to
 connect to itself. Hmm. I have put entries in the host table and the user
 table, using both hostname and ip address, but no luck. I keep getting the
 same error.
 
 What am I doing wrong?
 
 Any and all help appreciated.
 
 Thanks
 
 Evan Morris
 [EMAIL PROTECTED]
 +27 11 792 2777 (tel)
 +27 11 792 2711 (fax)
-- 
Mignon Hunter
Web Developer
Toshiba International
713.466.0277 x 3461


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




RE: [PHP-DB] MySQL : InnoDB tables

2003-02-03 Thread John W. Holmes
 I have a question about MySQL, i use MySQL 3.23.55 together with PHP
 4.3.0 on my windows XP system. Does the version of MySQL supports
InnoDB
 tables? And how do i do it i have noticed that in PhpMyAdmin i
 cannot choose this table format..., but i gues that has more to do
with
 the PhpMyAdmin then with my database i gues.

MySQL 3.23 supports InnoDb, but not by default. Read through the manual
on how to set up InnoDb support with 3.23.

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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




Re: [PHP-DB] MySQL result resource

2003-02-01 Thread Edwin Boersma
Agree fully

Try this:
$query = select * from category where id=$scrow-category;
$result = mysql_query($query) or die( mysql_error() );

If your query fails, and u still can't find the reason from the 
information that mysql_error() give you, put a echo $query inbetween 
to see which string your passing to mysql_query().

Edwin


John W. Holmes wrote:
It means your query failed... it always means your query failed for some
reason (unless you typo a variable name...). Learn to use mysql_error()
in conjunction with mysql_query(). Also, like I said before,
mysql_db_query() is depreciated, you should be using mysql_query().

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



-Original Message-
From: Addison Ellis [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 29, 2003 10:02 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] MySQL result resource

hello,
	i have a new issue... :-)
	i am getting:
Warning: Supplied argument is not a valid MySQL result resource in
/users/infoserv/web/register/ca/admin/catads.php on line 54

from:
?
while($row = mysql_fetch_object($obj))
{
  $scobj = mysql_db_query($dbname,select * from subcategory
where id=$row-subcategory);
  $scrow = mysql_fetch_object($scobj);
  $cobj = mysql_db_query($dbname,select * from category where
id=$scrow-category);//54
  $crow = mysql_fetch_object($cobj);
?


any ideas, of course, are most appreciated. thank you and best,


addison


--
Addison Ellis
small independent publishing co.
114 B 29th Avenue North
Nashville, TN 37203
(615) 321-1791
[EMAIL PROTECTED]
[EMAIL PROTECTED]
subsidiaries of small independent publishing co.
[EMAIL PROTECTED]
[EMAIL PROTECTED]







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




RE: [PHP-DB] MySQL result resource

2003-01-29 Thread John W. Holmes
It means your query failed... it always means your query failed for some
reason (unless you typo a variable name...). Learn to use mysql_error()
in conjunction with mysql_query(). Also, like I said before,
mysql_db_query() is depreciated, you should be using mysql_query().

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/

 -Original Message-
 From: Addison Ellis [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, January 29, 2003 10:02 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] MySQL result resource
 
 hello,
   i have a new issue... :-)
   i am getting:
 Warning: Supplied argument is not a valid MySQL result resource in
 /users/infoserv/web/register/ca/admin/catads.php on line 54
 
 from:
 ?
  while($row = mysql_fetch_object($obj))
  {
$scobj = mysql_db_query($dbname,select * from subcategory
 where id=$row-subcategory);
$scrow = mysql_fetch_object($scobj);
$cobj = mysql_db_query($dbname,select * from category where
 id=$scrow-category);//54
$crow = mysql_fetch_object($cobj);
 ?
 
 
 any ideas, of course, are most appreciated. thank you and best,
addison
 --
 Addison Ellis
 small independent publishing co.
 114 B 29th Avenue North
 Nashville, TN 37203
 (615) 321-1791
 [EMAIL PROTECTED]
 [EMAIL PROTECTED]
 subsidiaries of small independent publishing co.
 [EMAIL PROTECTED]
 [EMAIL PROTECTED]



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




RE: [PHP-DB] MySQL Error

2003-01-28 Thread Rich Gray
Hi Jordan

Made any recent changes to your network configuration? Can you access other
IP ports OK e.g. http port 80? Do you have any firewall protection on your
PC? Can you access MySQL from the command line OK?

Rich
-Original Message-
From: JordanW [mailto:[EMAIL PROTECTED]]
Sent: 28 January 2003 04:37
To: [EMAIL PROTECTED]
Subject: [PHP-DB] MySQL Error


I'm getting this error message when I try the following code:

$link = mysql_connect(localhost)
or die(Could not connect);
print (Connected successfully);
mysql_close($link);

The scripts outputs:

Warning: Can't create TCP/IP socket (10106) in
C:\Projects\WebServer\admin.php on line 3

Warning: MySQL Connection Failed: Can't create TCP/IP socket (10106) in
C:\Projects\WebServer\admin.php on line 3
Could not connect

Any ideas?

Thanks


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




Re: [PHP-DB] MySQL Error

2003-01-28 Thread John Krewson

Just a shot in the dark, but be sure the socket and port settings are 
correct for your setup (whatever that might be since you did not include 
that info in your post) and that mysql is actually running.

Be sure to scour 
http://www.mysql.com/documentation/mysql/bychapter/index.html
especially the section regarding running MySQL on windows.

Sounds like a MySQL setup problem unrelated to PHP.




JordanW wrote:

I'm getting this error message when I try the following code:

$link = mysql_connect(localhost)
or die(Could not connect);
print (Connected successfully);
mysql_close($link);

The scripts outputs:

Warning: Can't create TCP/IP socket (10106) in
C:\Projects\WebServer\admin.php on line 3

Warning: MySQL Connection Failed: Can't create TCP/IP socket (10106) in
C:\Projects\WebServer\admin.php on line 3
Could not connect

Any ideas?

Thanks





--
John Krewson
Programmer - SWORPS


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




Re: [PHP-DB] MySQL Query Question

2003-01-23 Thread Frank Peavy
Jeremy,
This question probably should be posted to the MySql mailing list but here 
goes.
Take a look at this link:

http://www.mysql.com/doc/en/Where_optimisations.html

Your example was not very explicit so I am not sure, but I believe you are 
in need of a
WHERE clause. For example;

Select a, b, c where a 7 and c  0

This should get you going in the right direction.


At 03:29 PM 1/23/03 -0600, Jeremy wrote:
Hello,
I need some help from you MySQL gurus out there. This is pure SQL by the
way..no front-end.


Lets say you have a table that has 2columns.columnA,
ColumnB and columnC
I have something like this

 if (columnA'7', (columnB/columnC)  + 52, columnB/ColumnC) as Number

however i need to test if columnc is 0 also cause if i need divide by zero i
get a null value

I cant figure out how to do this any help would be greatly appreciated


--
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] MySQL Query Question

2003-01-23 Thread Ignatius Reilly
It is safe to test if the divisor is zero:

replace
columnB/columnC

by
IF( columnC = 0, 0, columnB/columnC )

(the 0 could be anything else; this depends on your business logic)


Ignatius

- Original Message -
From: Jeremy [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, January 23, 2003 10:29 PM
Subject: [PHP-DB] MySQL Query Question


 Hello,
 I need some help from you MySQL gurus out there. This is pure SQL by the
 way..no front-end.


 Lets say you have a table that has 2columns.columnA,
 ColumnB and columnC
 I have something like this

  if (columnA'7', (columnB/columnC)  + 52, columnB/ColumnC) as Number

 however i need to test if columnc is 0 also cause if i need divide by zero
i
 get a null value

 I cant figure out how to do this any help would be greatly appreciated


 --
 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] MySQL Query Question

2003-01-23 Thread John W. Holmes
 I need some help from you MySQL gurus out there. This is pure SQL by
the
 way..no front-end.
 
 
 Lets say you have a table that has 2columns.columnA,
 ColumnB and columnC
 I have something like this

Oh CRAP! You lost me... you said two columns but listed 3! ;)
 
  if (columnA'7', (columnB/columnC)  + 52, columnB/ColumnC) as
Number

I think someone already suggested these, but either include a WHERE c !=
0 in your WHERE clause (if you don't want those rows), or use a nested
IF() to return a specific value when C is zero: 

IF(ColumnC=0,'Undef',IF(ColumnA7,ColumnB/ColumnC+52,ColumnB/ColumnC))

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/




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




RE: [PHP-DB] MySql DB, help, sql error and i don't know why

2003-01-21 Thread Hutchins, Richard
I'm pretty sure that the error is because you're not able to set a length
for the TEXT column type. I checked the MySQL manual and it does not show a
prototype with that optional parameter. Besides, if you want a TEXT of
(255), why not just use a VARCHAR (255)? They're essentially the same thing
and you can GROUP BY or ORDER BY on the VARCHAR without any conversion.

 -Original Message-
 From: David Rice [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, January 21, 2003 10:11 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] MySql DB, help, sql error and i don't know why
 
 
 
 SQL-query :
 
 CREATE TABLE `staff` (
 
 `StaffId` INT( 4 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
 `Name` VARCHAR( 30 ) NOT NULL ,
 `Surname` VARCHAR( 30 ) NOT NULL ,
 `Address` TEXT( 225 ) NOT NULL ,
 `JobId` SMALLINT( 2 ) NOT NULL ,
 `PermissionId` SMALLINT( 2 ) NOT NULL ,
 `HomePhone` INT( 11 ) NOT NULL ,
 `MobilePhone` INT( 11 ) NOT NULL ,
 `TipsPoints` INT( 1 ) NOT NULL ,
 `DOB` DATE NOT NULL ,
 `Password` VARCHAR( 20 ) NOT NULL ,
 `ResterauntId` INT( 1 ) NOT NULL ,
 `DateStarted` DATE NOT NULL ,
 `StaffStatusId` TINYINT( 1 ) NOT NULL
 )
 
 MySQL said:
 
 
 You have an error in your SQL syntax near '(225) NOT NULL, `JobId` 
 SMALLINT(2) NOT NULL, `PermissionId` SMALLINT(2) NOT NUL' at line 1
 
 
 
 
 
 
 _
 MSN 8: advanced junk mail protection and 2 months FREE*. 
 http://join.msn.com/?page=features/junkmail
 
 
 -- 
 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] [mysql - php] Newline to BR problem

2003-01-09 Thread Aaron Wolski
You want to look at nl2br() function.

It takes newlines from a text like:

Hello

My name is

Aaron

Which when outputted normally would look like:

Hello my name is aaron

Using echo nl2br($dbquery); would produce:

Hellobrbr
My name isbrbr
Aaronbrbr

In your HTML code which then would output in a browse like the above.

Aaron

-Original Message-
From: Ro Stonemountain [mailto:[EMAIL PROTECTED]] 
Sent: January 9, 2003 10:53 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] [mysql - php] Newline to BR problem

I'm trying to place a text from a textfield into a database and
displaying
it on another page. All works fine and well but my problem is:

If i place newline characters (press enter) in the forms textfield they
don't show up on my display page. This is logical because newlines are
not
br codes. So i must replace the newline thingies with br code.
Should
this be done BEFORE i put the text in the database or AFTER i put the
text
in the database and what functions can i use

Maybe it's a newbie question but it's on my mind for a few days now and
i
haven't found an answer yet, thanx!



-- 
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] mysql wildcard

2003-01-08 Thread Jim Hunter
If you want all records, remove the where clause.

select * from mytable


Jim
 
---Original Message---
 
From: Edward Peloke
Date: Wednesday, January 08, 2003 02:03:04 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] mysql wildcard
 
I have an query:

select * from offtime where type='$type'

then I just pass the type variable to the page. Is there a wildcard in
mysql like there is in sqlserver that I can use to grab all the records?
such as select * from offtime where type='%' would grab all.

Thanks,
Eddie


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

. 


Re: [PHP-DB] mysql wildcard

2003-01-08 Thread Brad Bonkoski
Well, if that is your only condition, why not use:
'select * from offtime' as your query?

I believe the % as a wildcard is standard SQL, so I would *think* it should
work in mysql, have you tried it?

-Brad

Edward Peloke wrote:

 I have an query:

 select * from offtime where type='$type'

 then I just pass the type variable to the page.  Is there a wildcard in
 mysql like there is in sqlserver that I can use to grab all the records?
 such as select * from offtime where type='%' would grab all.

 Thanks,
 Eddie

 --
 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] mysql wildcard

2003-01-08 Thread Marco Tabini
You probably want something like:

select * from offtime where type like '{$type}%'

As a side note, are you making sure that $type does not contain any
malicious code?

Cheers,


Marco
-- 

php|architect - The Monthly Magazine for PHP Professionals
Come check us out on the web at http://www.phparch.com!

---BeginMessage---
I have an query:

select * from offtime where type='$type'

then I just pass the type variable to the page.  Is there a wildcard in
mysql like there is in sqlserver that I can use to grab all the records?
such as select * from offtime where type='%' would grab all.

Thanks,
Eddie


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



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


Re: [PHP-DB] mysql wildcard

2003-01-08 Thread janet
In a message dated 1/8/03 2:48:15 PM Pacific Standard
Time, [EMAIL PROTECTED] writes:

I have an query:

select * from offtime where type='$type'

then I just pass the type variable to the page.  Is
there a wildcard in mysql like there is in sqlserver
that I can use to grab all the records? such as select
* from offtime where type='%' would grab all. 

Yes, MySQL has a wild card. It is % for a string of
characters or _ for a single character. You can say
things like where type like 'tp%'. However, if all you
want to do is get all the records from a table, you can
do that with:

SELECT * FROM offtime

Wild cards are used more for things like:

SELECT * FROM offtime WHERE type LIKE 'tp%'

You can also do pattern matching with regular
expressions using REGEXP

Janet
--
Janet Valade
author, PHP and MySQL for Dummies

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




Re: [PHP-DB] mysql time format

2003-01-07 Thread Paul Burney
on 1/6/03 8:24 PM, David Chamberlin at [EMAIL PROTECTED] appended the
following bits to my mbox:

 Is there any way to set the time format so that any time values in my
 SELECT call are in a speicified format (e.g., HH:MM instead of HH:MM:SS).
 
 Basically I've got a table of a variety of different types, some of
 which are times.  I want to issue a select that retrieves all of the
 data for a row, and have any time values be returned in HH:MM (for example).
 
 I can (very painfully) go through all the results, figure out which ones
 are time values, and then do SELECT TIME_FORMAT() on each one of those,
 but that seems like a horrendous solution to a simple problem.

As John said, there's not a way (I know of) to just tell MySQL to display
times in a different format without the TIME_FORMAT calls.

Why not add the TIME_FORMAT calls to the original query rather than
performing all the extra queries?  Is your first select something like the
following?

SELECT * FROM table

Even if you don't want to specify all the columns, you could add the
additional ones like this:

SELECT *,TIME_FORMAT(time_column_1,'%whatever') AS time_column_1 FROM table

If you are using a mysql_fetch_assoc function, giving the alias the same
name as the original column makes only the alias show up in your array.

If you don't know what all the time columns are, you could do a SHOW
COLUMNS FROM table query first, then use PHP to parse the results to tell
you which fields are time types, then use that result to build a query like
that above. (You could also use one of the php mysql_field_* functions.)

HTH.

Sincerely,

Paul Burney
http://paulburney.com/

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



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




Re: [PHP-DB] mysql time format

2003-01-07 Thread David Chamberlin


Paul Burney wrote:


Why not add the TIME_FORMAT calls to the original query rather than
performing all the extra queries?  Is your first select something like the
following?


That's what I'd like to do, but not sure how to do that in this context.


SELECT *,TIME_FORMAT(time_column_1,'%whatever') AS time_column_1 FROM table


Aha!  That's what I was looking for!


If you don't know what all the time columns are, you could do a SHOW
COLUMNS FROM table query first, then use PHP to parse the results to tell
you which fields are time types,


Right, that's basically what I've already done.  When my class 
instantiates, it parses the columns and builds an array with the names 
of the columns that are time types.  Currently I'm using that array to 
cycle through the results and issue TIME_FORMAT calls on all of the 
results, but what I wanted was to have the TIME_FORMAT in the original 
call.  But I didn't know how to do that without listing all of the 
columns and also getting the result in the same name as the original. 
Your code snippet explains just what I wanted.  Thank you!

-Dave


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



RE: [PHP-DB] mysql time format

2003-01-06 Thread John W. Holmes
 This is a bit of a newbie question, but I couldn't find what I wanted
in
 the documentation.
 
 Is there any way to set the time format so that any time values in my
 SELECT call are in a speicified format (e.g., HH:MM instead of
HH:MM:SS).
 
 Basically I've got a table of a variety of different types, some of
 which are times.  I want to issue a select that retrieves all of the
 data for a row, and have any time values be returned in HH:MM (for
 example).
 
 I can (very painfully) go through all the results, figure out which
ones
 are time values, and then do SELECT TIME_FORMAT() on each one of
those,
 but that seems like a horrendous solution to a simple problem.

What type of column are you using? TIME()? If so, then there's no way to
do this without using TIME_FORMAT() in each of your queries. If you're
using a TIMESTAMP column, you can specify the length to XX so that it
only stores data in a MMDDHHMM format. 

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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




Re: [PHP-DB] MySQL Database connection Problem

2003-01-03 Thread Andrey Hristov
  Hi,
 Does mysql user has rights to write in this directory or permissions over
this file?

Andrey

- Original Message -
From: conbud [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, January 03, 2003 11:00 AM
Subject: [PHP-DB] MySQL Database connection Problem


 Hello can someone give me some possible reasons this error happens when
 I use the mysql client to add a tabe to a database.

 mysql create table home (id int not null, heading blob not null,
  - primary key (id), unique id (id));
 ERROR 3: Error writing file './nrlug/home.frm' (Errcode: 28)

 Any help would be appreciated

 Lee


 --
 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] MySQL Database connection Problem

2003-01-03 Thread Jason Wong
On Friday 03 January 2003 17:00, conbud wrote:
 Hello can someone give me some possible reasons this error happens when
 I use the mysql client to add a tabe to a database.

 mysql create table home (id int not null, heading blob not null,
  - primary key (id), unique id (id));
 ERROR 3: Error writing file './nrlug/home.frm' (Errcode: 28)

This is obviously a mysql question. Go to their website and search on the 
error message.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *


/*
sic transit discus mundi
(From the System Administrator's Guide, by Lars Wirzenius)
*/


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




Re: [PHP-DB] MySQL Database connection Problem

2003-01-03 Thread conbud
Jason Wong wrote:

On Friday 03 January 2003 17:00, conbud wrote:


Hello can someone give me some possible reasons this error happens when
I use the mysql client to add a tabe to a database.

mysql create table home (id int not null, heading blob not null,
- primary key (id), unique id (id));
ERROR 3: Error writing file './nrlug/home.frm' (Errcode: 28)



This is obviously a mysql question. Go to their website and search on the 
error message.


Jason that seems to be your answer to everything, that and RTFM. Well I 
have already done both and cant seem to find anything on it, so thats 
why I would ask  here. Makes sense huh ?


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



Re: [PHP-DB] MySQL Database connection Problem

2003-01-03 Thread Andrey Hristov

http://www.alt-php-faq.org/local/74/

Question :

I am trying to create a database and keep getting an error :- (Errcode: 28)

Answer :

errcode: 28

No space left on device

This means that you are out of disk space.
Try du to see how much space is free/used


Best regards
Andrey Hristov


- Original Message -
From: conbud [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Friday, January 03, 2003 11:11 AM
Subject: Re: [PHP-DB] MySQL Database connection Problem


 Jason Wong wrote:
  On Friday 03 January 2003 17:00, conbud wrote:
 
 Hello can someone give me some possible reasons this error happens when
 I use the mysql client to add a tabe to a database.
 
 mysql create table home (id int not null, heading blob not null,
  - primary key (id), unique id (id));
 ERROR 3: Error writing file './nrlug/home.frm' (Errcode: 28)
 
 
  This is obviously a mysql question. Go to their website and search on
the
  error message.
 

 Jason that seems to be your answer to everything, that and RTFM. Well I
 have already done both and cant seem to find anything on it, so thats
 why I would ask  here. Makes sense huh ?


 --
 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] MySQL Database connection Problem

2003-01-03 Thread conbud
Andrey thanks, but I seen that already and theres over 80 gig left on the
server and about 17 gig of that is still alloted to the database.

Andrey Hristov [EMAIL PROTECTED] wrote in message
010c01c2b309$8d8d7210$1601a8c0@andreywin">news:010c01c2b309$8d8d7210$1601a8c0@andreywin...

 http://www.alt-php-faq.org/local/74/

 Question :

 I am trying to create a database and keep getting an error :- (Errcode:
28)

 Answer :

 errcode: 28

 No space left on device

 This means that you are out of disk space.
 Try du to see how much space is free/used


 Best regards
 Andrey Hristov


 - Original Message -
 From: conbud [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Sent: Friday, January 03, 2003 11:11 AM
 Subject: Re: [PHP-DB] MySQL Database connection Problem


  Jason Wong wrote:
   On Friday 03 January 2003 17:00, conbud wrote:
  
  Hello can someone give me some possible reasons this error happens
when
  I use the mysql client to add a tabe to a database.
  
  mysql create table home (id int not null, heading blob not null,
   - primary key (id), unique id (id));
  ERROR 3: Error writing file './nrlug/home.frm' (Errcode: 28)
  
  
   This is obviously a mysql question. Go to their website and search on
 the
   error message.
  
 
  Jason that seems to be your answer to everything, that and RTFM. Well I
  have already done both and cant seem to find anything on it, so thats
  why I would ask  here. Makes sense huh ?
 
 
  --
  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] MySQL Database connection Problem

2003-01-03 Thread Andrey Hristov
what about the permissions? are they ok?


Andrey

- Original Message -
From: conbud [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, January 03, 2003 11:30 AM
Subject: Re: [PHP-DB] MySQL Database connection Problem


 Andrey thanks, but I seen that already and theres over 80 gig left on the
 server and about 17 gig of that is still alloted to the database.

 Andrey Hristov [EMAIL PROTECTED] wrote in message
 010c01c2b309$8d8d7210$1601a8c0@andreywin">news:010c01c2b309$8d8d7210$1601a8c0@andreywin...
 
  http://www.alt-php-faq.org/local/74/
 
  Question :
 
  I am trying to create a database and keep getting an error :- (Errcode:
 28)
 
  Answer :
 
  errcode: 28
 
  No space left on device
 
  This means that you are out of disk space.
  Try du to see how much space is free/used
 
 
  Best regards
  Andrey Hristov
 
 
  - Original Message -
  From: conbud [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
  Sent: Friday, January 03, 2003 11:11 AM
  Subject: Re: [PHP-DB] MySQL Database connection Problem
 
 
   Jason Wong wrote:
On Friday 03 January 2003 17:00, conbud wrote:
   
   Hello can someone give me some possible reasons this error happens
 when
   I use the mysql client to add a tabe to a database.
   
   mysql create table home (id int not null, heading blob not null,
- primary key (id), unique id (id));
   ERROR 3: Error writing file './nrlug/home.frm' (Errcode: 28)
   
   
This is obviously a mysql question. Go to their website and search
on
  the
error message.
   
  
   Jason that seems to be your answer to everything, that and RTFM. Well
I
   have already done both and cant seem to find anything on it, so thats
   why I would ask  here. Makes sense huh ?
  
  
   --
   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 Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] MySQL Database connection Problem

2003-01-03 Thread Jason Wong
On Friday 03 January 2003 17:11, conbud wrote:
 Jason Wong wrote:
  On Friday 03 January 2003 17:00, conbud wrote:
 Hello can someone give me some possible reasons this error happens when
 I use the mysql client to add a tabe to a database.
 
 mysql create table home (id int not null, heading blob not null,
  - primary key (id), unique id (id));
 ERROR 3: Error writing file './nrlug/home.frm' (Errcode: 28)
 
  This is obviously a mysql question. Go to their website and search on the
  error message.

 Jason that seems to be your answer to everything, that and RTFM. 

I try to answer questions appropriately.

 Well I
 have already done both and cant seem to find anything on it, so thats
 why I would ask  here. Makes sense huh ?

No, it would make more sense to ask on the mysql mailing list. One would hope 
that the people there would know more about mysql than the people here.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *


/*
The ultimate game show will be the one where somebody gets killed at the end.
-- Chuck Barris, creator of The Gong Show
*/


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




Re: [PHP-DB] Mysql Passwprd validation

2003-01-03 Thread Leif K-Brooks
SELECT * from table where 
passwordfield=PASSWORD('$variablewithpassword') and 
username='$usernametocheck' limit 1

Sabina Alejandr Schneider wrote:

Hello to everybody!! I'm writing to know if somebody knows how can I 
validate a password that has been encrypted with the PASSWORD() mysql 
function. Thank you all for your time!!!

Sabina Alejandra Schneider
[EMAIL PROTECTED]






_

Tutopia - Acceso a Internet rápido, fácil y a los mejores precios.
http://www.tutopia.com


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




RE: [PHP-DB] Mysql Passwprd validation

2003-01-03 Thread Rich Hutchins
Check this resource: http://www.mysql.com/doc/en/Passwords.html

Rich

-Original Message-
From: Sabina Alejandr Schneider [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 03, 2003 8:48 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Mysql Passwprd validation


Hello to everybody!! I'm writing to know if somebody knows
how can I validate a password that has been encrypted with
the PASSWORD() mysql function. Thank you all for your
time!!!

Sabina Alejandra Schneider
[EMAIL PROTECTED]






_

Tutopia - Acceso a Internet rápido, fácil y a los mejores precios.
http://www.tutopia.com

--
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] mysql database not 'taking' changes

2002-12-23 Thread Mark
Does the user that the script runs as have full CRUD access to the
new tables? Have you set any restrictions on what that user can do to
the table(s)?

--- Jody Cleveland [EMAIL PROTECTED] wrote:
 Hello,
 
 I'm using a product called Squirrelmail for my web based email. In
 it, it
 uses a database for user preferences and address books. (I posted
 to that
 list, and it was suggested to check here) I created the database
 squirrel. I
 created two tables, one called addresses and one called prefs. For
 some
 reason, when I try to change preferences, it never writes that
 information
 to the database. But, I can addresses just fine.
 
 Is there anything with php settings, or the database itself that
 may need to
 be changed?
 
 Thanks!  Oh, I'm running Redhat 8, Apache 2, PHP 4.3.0 RC1.
 
 -Jody Cleveland
 
 Winnefox Library System
 Computer Support Specialist
 [EMAIL PROTECTED]
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


=
Mark Weinstock
[EMAIL PROTECTED]
***
You can't demand something as a right unless you are willing to fight to death to 
defend everyone else's right to the same thing.
-Stolen from the now-defunct Randy's Random mailing list.
***

__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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




RE: [PHP-DB] mysql database not 'taking' changes

2002-12-23 Thread Jody Cleveland
 Does the user that the script runs as have full CRUD access to the
 new tables? Have you set any restrictions on what that user can do to
 the table(s)?

Boy, do I feel lost...

How would I check that?

Thanks!

Jody

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




RE: [PHP-DB] mysql database not 'taking' changes

2002-12-23 Thread Mark
Sorry. Stupid technospeak on my part.

When you connect to the database, you tell it to use a particular
username and password. When these new tables were created, did you
change the permissions in the mysql table for the user, or does that
account have access to all the tables/databases? Basically, did you
grant or change permissions when the new tables were created?

BTW, CRUD = Create, Read, Update, Delete

--- Jody Cleveland [EMAIL PROTECTED] wrote:
  Does the user that the script runs as have full CRUD access to
 the
  new tables? Have you set any restrictions on what that user can
 do to
  the table(s)?
 
 Boy, do I feel lost...
 
 How would I check that?
 
 Thanks!
 
 Jody
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


=
Mark Weinstock
[EMAIL PROTECTED]
***
You can't demand something as a right unless you are willing to fight to death to 
defend everyone else's right to the same thing.
-Stolen from the now-defunct Randy's Random mailing list.
***

__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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




RE: [PHP-DB] mysql database not 'taking' changes

2002-12-23 Thread Jody Cleveland
 Sorry. Stupid technospeak on my part.

No problem, much ignorance on my part.

 When you connect to the database, you tell it to use a particular
 username and password. When these new tables were created, did you
 change the permissions in the mysql table for the user, or does that
 account have access to all the tables/databases? Basically, did you
 grant or change permissions when the new tables were created?

I created a database called squirrelmail. I was logged in as root when I
created it, but after I created the database, I typed:
GRANT select,insert,update,delete ON squirrelmail.* TO
squirreluser@localhost IDENTIFIED BY 'sqpassword';

 BTW, CRUD = Create, Read, Update, Delete

I was wondering what that meant!

It looks like the changes take now, but I have to logout of squirrelmail and
log back in for them to take effect. Any ideas?

Thanks!

Jody

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




RE: [PHP-DB] mysql database not 'taking' changes

2002-12-23 Thread Mark

--- Jody Cleveland [EMAIL PROTECTED] wrote:
  Sorry. Stupid technospeak on my part.
 
 No problem, much ignorance on my part.
 
  When you connect to the database, you tell it to use a particular
  username and password. When these new tables were created, did
 you
  change the permissions in the mysql table for the user, or does
 that
  account have access to all the tables/databases? Basically, did
 you
  grant or change permissions when the new tables were created?
 
 I created a database called squirrelmail. I was logged in as root
 when I
 created it, but after I created the database, I typed:
 GRANT select,insert,update,delete ON squirrelmail.* TO
 squirreluser@localhost IDENTIFIED BY 'sqpassword';
 
  BTW, CRUD = Create, Read, Update, Delete
 
 I was wondering what that meant!
 
 It looks like the changes take now, but I have to logout of
 squirrelmail and
 log back in for them to take effect. Any ideas?

Not to punt, but you might want to check with the Squirrelmail folks
to see if that's normal behavior. I don't use it personally, but I
can refer you to a few people who do if no one on this list knows...

 
 Thanks!
 
 Jody


=
Mark Weinstock
[EMAIL PROTECTED]
***
You can't demand something as a right unless you are willing to fight to death to 
defend everyone else's right to the same thing.
-Stolen from the now-defunct Randy's Random mailing list.
***

__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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




Re: [PHP-DB] MySQL Ques: default for date field be current date

2002-12-17 Thread David Smith
This can be done using the 'timestamp' type for your column. Note that
this field will be updated to the current time any time the row is
modified (including when it is created).

An alternative is to do it on the scripting side with the MySQL NOW()
command like so:

INSERT INTO your_table (field1,field2,...,create_date) values(
'val1','val2',...,NOW())

The create_date field can be of type time, date, or datetime. I
recommend datetime.

--Dave

On Tue, 2002-12-17 at 22:22, Michael Zornek wrote:
 I'm trying to convert an ASP/Access tutorial to PHP/MySQL and have a
 question regarding MySQL.
 
 In Access one can create a date field and set the default to Date() to get
 the current date but according to the mysql manual:
 
 http://www.mysql.com/doc/en/CREATE_TABLE.html
 
  Default values must be constants. This means, for example, that you cannot set
  the default for a date column to be the value of a function such as NOW() or
  CURRENT_DATE.
 
 Is there any other way to have MySQL automate this? I've heard of something
 called stored procedures but am unfamiliar. -- Must this be done on the
 scripting side?
 
 Thanks,
 ~ Mike
 -- 
 MikeZornek.com
 New blog, new QA column, new content everywhere!
 http://www.mikezornek.com
 
 
 -- 
 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] MySQL Ques: default for date field be current date

2002-12-17 Thread John W. Holmes
 I'm trying to convert an ASP/Access tutorial to PHP/MySQL and have a
 question regarding MySQL.
 
 In Access one can create a date field and set the default to Date()
to
 get
 the current date but according to the mysql manual:
 
 http://www.mysql.com/doc/en/CREATE_TABLE.html
 
  Default values must be constants. This means, for example, that you
 cannot set
  the default for a date column to be the value of a function such as
 NOW() or
  CURRENT_DATE.
 
 Is there any other way to have MySQL automate this? I've heard of
 something
 called stored procedures but am unfamiliar. -- Must this be done on
the
 scripting side?

If you make your column a TIMESTAMP, it will be updated with the current
time when the row is inserted or updated, unless you set it to a
specific time. 

So, if a table has two columns, name and time, then you can do this and
the time column will be set to the current date time. 

INSERT INTO table (name, time) VALUES ('name',NULL);
INSERT INTO table (name) VALUES ('name');

Hope that helps. 

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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




Re: [PHP-DB] mysql-windows xp

2002-12-13 Thread Jeffrey_N_Dyke

probably b/c of grants/rights
did you run a -- grant all on *.* to user@localhost ?  or something of the
sort. or set up root to have access

can you connect via command line?

HTH
Jeff


   
 
epeloke@echoma 
 
n.com (EdwardTo: [EMAIL PROTECTED]
 
Peloke)  cc:   
 
 Subject: [PHP-DB] mysql-windows xp
 
12/13/2002 
 
08:54 AM   
 
   
 
   
 




I got a new laptop yesterday that has xp home loaded.  I installed mysql
last night but get errors that I can't connect to 'localhost'.  Any ideas?

Thanks,
Eddie


--
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] mysql-windows xp

2002-12-13 Thread Edward Peloke
how do you do this?  I guess I could look it up in the help files.  I don't
need the firewall as it is behind one at home.

-Original Message-
From: SELPH,JASON (HP-Richardson,ex1) [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 13, 2002 8:45 AM
To: '[EMAIL PROTECTED]'; [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] mysql-windows xp


turn off the xp firewall as well.

Jason

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 13, 2002 7:29 AM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] mysql-windows xp



probably b/c of grants/rights
did you run a -- grant all on *.* to user@localhost ?  or something of the
sort. or set up root to have access

can you connect via command line?

HTH
Jeff




epeloke@echoma

n.com (EdwardTo: [EMAIL PROTECTED]

Peloke)  cc:

 Subject: [PHP-DB] mysql-windows
xp
12/13/2002

08:54 AM









I got a new laptop yesterday that has xp home loaded.  I installed mysql
last night but get errors that I can't connect to 'localhost'.  Any ideas?

Thanks,
Eddie


--
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 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] mysql-windows xp

2002-12-13 Thread Jeffrey_N_Dyke

that didn't cause me any issues on my install.  why do you have to turn
that off.  i'm not doubting you, just curious?

Jeff


   
 
SELPH,JASON   
 
(HP-Richardson   To: '[EMAIL PROTECTED]' 
[EMAIL PROTECTED],   
,ex1)[EMAIL PROTECTED]  
 
jason.selph@h   cc: [EMAIL PROTECTED]  
 
p.com   Subject: RE: [PHP-DB] mysql-windows xp
 
   
 
12/13/2002 
 
08:44 AM   
 
   
 
   
 




turn off the xp firewall as well.

Jason

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 13, 2002 7:29 AM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] mysql-windows xp



probably b/c of grants/rights
did you run a -- grant all on *.* to user@localhost ?  or something of the
sort. or set up root to have access

can you connect via command line?

HTH
Jeff




 epeloke@echoma

 n.com (EdwardTo: [EMAIL PROTECTED]

 Peloke)  cc:

   Subject: [PHP-DB] mysql-windows
xp
 12/13/2002

 08:54 AM









I got a new laptop yesterday that has xp home loaded.  I installed mysql
last night but get errors that I can't connect to 'localhost'.  Any ideas?

Thanks,
Eddie


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




RE: [PHP-DB] mysql-windows xp

2002-12-13 Thread Edward Peloke
can't seem to find that line in the install file but I probably don't know
what I am looking for

IS this the install doc you meant?

http://www.mysql.com/documentation/mysql/bychapter/manual_Installing.html#In
stalling

Thanks,
Eddie

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 13, 2002 8:54 AM
To: SELPH,JASON (HP-Richardson,ex1)
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: [PHP-DB] mysql-windows xp



that didn't cause me any issues on my install.  why do you have to turn
that off.  i'm not doubting you, just curious?

Jeff



SELPH,JASON
(HP-Richardson   To:
'[EMAIL PROTECTED]' [EMAIL PROTECTED],
,ex1)[EMAIL PROTECTED]
jason.selph@h   cc: [EMAIL PROTECTED]
p.com   Subject: RE: [PHP-DB]
mysql-windows xp

12/13/2002
08:44 AM






turn off the xp firewall as well.

Jason

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 13, 2002 7:29 AM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] mysql-windows xp



probably b/c of grants/rights
did you run a -- grant all on *.* to user@localhost ?  or something of the
sort. or set up root to have access

can you connect via command line?

HTH
Jeff




 epeloke@echoma

 n.com (EdwardTo: [EMAIL PROTECTED]

 Peloke)  cc:

   Subject: [PHP-DB] mysql-windows
xp
 12/13/2002

 08:54 AM









I got a new laptop yesterday that has xp home loaded.  I installed mysql
last night but get errors that I can't connect to 'localhost'.  Any ideas?

Thanks,
Eddie


--
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 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] mysql-windows xp

2002-12-13 Thread SELPH,JASON (HP-Richardson,ex1)
by default on a new xp install the firewall is enabled.  stops everything on
your network from getting thru.  if port 3306 is blocked then accessing
mysql thru ip would be denied.
To disable internet connection firewall...

I have not installed mysql on xp, but the same thing happens with irc, http
servers, ftp servers, netbios, file sharing, etc.

In Control Panel, double-click Networking and Internet Connections, and then
click Network Connections.
Right-click the connection on which you would like to disable ICF, and then
click Properties.
On the Advanced tab, click the box to clear the option to Protect my
computer or network.

Jason

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 13, 2002 7:54 AM
To: SELPH,JASON (HP-Richardson,ex1)
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: [PHP-DB] mysql-windows xp



that didn't cause me any issues on my install.  why do you have to turn
that off.  i'm not doubting you, just curious?

Jeff


 

SELPH,JASON

(HP-Richardson   To:
'[EMAIL PROTECTED]' [EMAIL PROTECTED],   
,ex1)[EMAIL PROTECTED]

jason.selph@h   cc: [EMAIL PROTECTED]

p.com   Subject: RE: [PHP-DB]
mysql-windows xp 
 

12/13/2002

08:44 AM

 

 





turn off the xp firewall as well.

Jason

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 13, 2002 7:29 AM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] mysql-windows xp



probably b/c of grants/rights
did you run a -- grant all on *.* to user@localhost ?  or something of the
sort. or set up root to have access

can you connect via command line?

HTH
Jeff




 epeloke@echoma

 n.com (EdwardTo: [EMAIL PROTECTED]

 Peloke)  cc:

   Subject: [PHP-DB] mysql-windows
xp
 12/13/2002

 08:54 AM









I got a new laptop yesterday that has xp home loaded.  I installed mysql
last night but get errors that I can't connect to 'localhost'.  Any ideas?

Thanks,
Eddie


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




RE: [PHP-DB] mysql-windows xp

2002-12-13 Thread SELPH,JASON (HP-Richardson,ex1)
I honestly can't give you an answer on that as I haven't installed mysql on
XP.  On linux there are 2 ways to connect to your server, socket or tcp.  I
am not sure on the windows version.  I just know that trying to access
anything on a firewalled machine, even from itself, via tcp with XP didn't
work until I disable ICF.

Try running winmysqladmin though if you haven't already.  or give a more
detailed error message.

Jason  

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 13, 2002 8:35 AM
To: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] mysql-windows xp


Forgive me if this is a dumb question but is that still the case if mysql is
on the same machine?

Thanks,
Eddie

-Original Message-
From: SELPH,JASON (HP-Richardson,ex1) [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 13, 2002 9:01 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Cc: SELPH,JASON (HP-Richardson,ex1)
Subject: RE: [PHP-DB] mysql-windows xp


by default on a new xp install the firewall is enabled.  stops everything on
your network from getting thru.  if port 3306 is blocked then accessing
mysql thru ip would be denied.
To disable internet connection firewall...

I have not installed mysql on xp, but the same thing happens with irc, http
servers, ftp servers, netbios, file sharing, etc.

In Control Panel, double-click Networking and Internet Connections, and then
click Network Connections.
Right-click the connection on which you would like to disable ICF, and then
click Properties.
On the Advanced tab, click the box to clear the option to Protect my
computer or network.

Jason

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 13, 2002 7:54 AM
To: SELPH,JASON (HP-Richardson,ex1)
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: [PHP-DB] mysql-windows xp



that didn't cause me any issues on my install.  why do you have to turn
that off.  i'm not doubting you, just curious?

Jeff




SELPH,JASON

(HP-Richardson   To:
'[EMAIL PROTECTED]' [EMAIL PROTECTED],
,ex1)[EMAIL PROTECTED]

jason.selph@h   cc: [EMAIL PROTECTED]

p.com   Subject: RE: [PHP-DB]
mysql-windows xp


12/13/2002

08:44 AM









turn off the xp firewall as well.

Jason

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 13, 2002 7:29 AM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] mysql-windows xp



probably b/c of grants/rights
did you run a -- grant all on *.* to user@localhost ?  or something of the
sort. or set up root to have access

can you connect via command line?

HTH
Jeff




 epeloke@echoma

 n.com (EdwardTo: [EMAIL PROTECTED]

 Peloke)  cc:

   Subject: [PHP-DB] mysql-windows
xp
 12/13/2002

 08:54 AM









I got a new laptop yesterday that has xp home loaded.  I installed mysql
last night but get errors that I can't connect to 'localhost'.  Any ideas?

Thanks,
Eddie


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




RE: [PHP-DB] mysql-windows xp

2002-12-13 Thread Edward Peloke
Thanks for all the help.  I finally got it running by running winmysqladmin

Eddie

-Original Message-
From: SELPH,JASON (HP-Richardson,ex1) [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 13, 2002 9:29 AM
To: '[EMAIL PROTECTED]'; [EMAIL PROTECTED]
Subject: RE: [PHP-DB] mysql-windows xp


I honestly can't give you an answer on that as I haven't installed mysql on
XP.  On linux there are 2 ways to connect to your server, socket or tcp.  I
am not sure on the windows version.  I just know that trying to access
anything on a firewalled machine, even from itself, via tcp with XP didn't
work until I disable ICF.

Try running winmysqladmin though if you haven't already.  or give a more
detailed error message.

Jason

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 13, 2002 8:35 AM
To: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] mysql-windows xp


Forgive me if this is a dumb question but is that still the case if mysql is
on the same machine?

Thanks,
Eddie

-Original Message-
From: SELPH,JASON (HP-Richardson,ex1) [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 13, 2002 9:01 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Cc: SELPH,JASON (HP-Richardson,ex1)
Subject: RE: [PHP-DB] mysql-windows xp


by default on a new xp install the firewall is enabled.  stops everything on
your network from getting thru.  if port 3306 is blocked then accessing
mysql thru ip would be denied.
To disable internet connection firewall...

I have not installed mysql on xp, but the same thing happens with irc, http
servers, ftp servers, netbios, file sharing, etc.

In Control Panel, double-click Networking and Internet Connections, and then
click Network Connections.
Right-click the connection on which you would like to disable ICF, and then
click Properties.
On the Advanced tab, click the box to clear the option to Protect my
computer or network.

Jason

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 13, 2002 7:54 AM
To: SELPH,JASON (HP-Richardson,ex1)
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: [PHP-DB] mysql-windows xp



that didn't cause me any issues on my install.  why do you have to turn
that off.  i'm not doubting you, just curious?

Jeff




SELPH,JASON

(HP-Richardson   To:
'[EMAIL PROTECTED]' [EMAIL PROTECTED],
,ex1)[EMAIL PROTECTED]

jason.selph@h   cc: [EMAIL PROTECTED]

p.com   Subject: RE: [PHP-DB]
mysql-windows xp


12/13/2002

08:44 AM









turn off the xp firewall as well.

Jason

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 13, 2002 7:29 AM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] mysql-windows xp



probably b/c of grants/rights
did you run a -- grant all on *.* to user@localhost ?  or something of the
sort. or set up root to have access

can you connect via command line?

HTH
Jeff




 epeloke@echoma

 n.com (EdwardTo: [EMAIL PROTECTED]

 Peloke)  cc:

   Subject: [PHP-DB] mysql-windows
xp
 12/13/2002

 08:54 AM









I got a new laptop yesterday that has xp home loaded.  I installed mysql
last night but get errors that I can't connect to 'localhost'.  Any ideas?

Thanks,
Eddie


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




Re: [PHP-DB] mysql-windows xp

2002-12-13 Thread Tyler Whitesides
Hi,
If you want MySQL to work in XP, make sure that you have the proper version
(XP/2000/NT) and in the advanced settings of your firewall, make sure to
allow TCP port 3306 to have full internet access from inside as well as out.
Good luck,
Tyler
- Original Message -
From: SELPH,JASON (HP-Richardson,ex1) [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Friday, December 13, 2002 6:28 AM
Subject: RE: [PHP-DB] mysql-windows xp


 I honestly can't give you an answer on that as I haven't installed mysql
on
 XP.  On linux there are 2 ways to connect to your server, socket or tcp.
I
 am not sure on the windows version.  I just know that trying to access
 anything on a firewalled machine, even from itself, via tcp with XP didn't
 work until I disable ICF.

 Try running winmysqladmin though if you haven't already.  or give a more
 detailed error message.

 Jason

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
 Sent: Friday, December 13, 2002 8:35 AM
 To: [EMAIL PROTECTED]
 Subject: RE: [PHP-DB] mysql-windows xp


 Forgive me if this is a dumb question but is that still the case if mysql
is
 on the same machine?

 Thanks,
 Eddie

 -Original Message-
 From: SELPH,JASON (HP-Richardson,ex1) [mailto:[EMAIL PROTECTED]]
 Sent: Friday, December 13, 2002 9:01 AM
 To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Cc: SELPH,JASON (HP-Richardson,ex1)
 Subject: RE: [PHP-DB] mysql-windows xp


 by default on a new xp install the firewall is enabled.  stops everything
on
 your network from getting thru.  if port 3306 is blocked then accessing
 mysql thru ip would be denied.
 To disable internet connection firewall...

 I have not installed mysql on xp, but the same thing happens with irc,
http
 servers, ftp servers, netbios, file sharing, etc.

 In Control Panel, double-click Networking and Internet Connections, and
then
 click Network Connections.
 Right-click the connection on which you would like to disable ICF, and
then
 click Properties.
 On the Advanced tab, click the box to clear the option to Protect my
 computer or network.

 Jason

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
 Sent: Friday, December 13, 2002 7:54 AM
 To: SELPH,JASON (HP-Richardson,ex1)
 Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Subject: RE: [PHP-DB] mysql-windows xp



 that didn't cause me any issues on my install.  why do you have to turn
 that off.  i'm not doubting you, just curious?

 Jeff




 SELPH,JASON

 (HP-Richardson   To:
 '[EMAIL PROTECTED]' [EMAIL PROTECTED],
 ,ex1)[EMAIL PROTECTED]

 jason.selph@h   cc: [EMAIL PROTECTED]

 p.com   Subject: RE: [PHP-DB]
 mysql-windows xp


 12/13/2002

 08:44 AM









 turn off the xp firewall as well.

 Jason

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
 Sent: Friday, December 13, 2002 7:29 AM
 To: [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Subject: Re: [PHP-DB] mysql-windows xp



 probably b/c of grants/rights
 did you run a -- grant all on *.* to user@localhost ?  or something of the
 sort. or set up root to have access

 can you connect via command line?

 HTH
 Jeff




  epeloke@echoma

  n.com (EdwardTo: [EMAIL PROTECTED]

  Peloke)  cc:

Subject: [PHP-DB] mysql-windows
 xp
  12/13/2002

  08:54 AM









 I got a new laptop yesterday that has xp home loaded.  I installed mysql
 last night but get errors that I can't connect to 'localhost'.  Any ideas?

 Thanks,
 Eddie


 --
 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 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 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] MySQL Array

2002-12-06 Thread Chevalier, Arthur
You are right about my query.  I am only pulling down one column. 

As you guys can probably tell I am pretty inexperienced with this.  I tried
what you said and still got the same results.

Here are snippets of my code and maybe this will depict what I am doing
wrong:

After creating the connection:

$query = select server_name from servers where midtier = '$server';
$dbResult = mysql_query($query,$dblink);  

$c = 1; 
print(tr);
while($row = mysql_fetch_array($dbResult))
{
print(td{$row['server_name']}/td);
if(($c % 4) == 0) 
{ 
print(/trtr); 
}
}



-Original Message-
From: 1LT John W. Holmes [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, December 05, 2002 3:26 PM
To: Ryan Jameson (USA); Art Chevalier; [EMAIL PROTECTED]
Subject: Re: [PHP-DB] MySQL Array

I think he meant that he is only pulling one column, i.e. field1 with each
mysql_fetch_array and he wants that in four columns.

$c = 1;
echo tr;
while($ar = mysql_fetch_array($result))
{
  echo td{$ar['field1']}/td;
  if(($c % 4) == 0) { echo /trtr; }
}

You'll have to account for incomplete rows and clean up the output, but
hopefully that gives you an idea.

---John Holmes...

- Original Message -
From: Ryan Jameson (USA) [EMAIL PROTECTED]
To: Art Chevalier [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Thursday, December 05, 2002 3:05 PM
Subject: RE: [PHP-DB] MySQL Array


while ($ar = mysql_fetch_array($rs))
  echo trtd. $ar['field1']./tdtd.$ar['field2']./td/tr;


Make sense?

-Original Message-
From: Art Chevalier [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 05, 2002 12:44 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] MySQL Array


Hello,

I am pulling one column out of a MySQL table in an array.  I want to place
each element into a HTML table 4 rows across.  I am currently doing this
with the mysql_fetch_array() function. How can I pull out 4 array elements
in one pass through a while loop?

Thanks

Art Chevalier



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




<    1   2   3   4   5   6   7   8   9   10   >