[PHP-DB] Re: Query Object in PHP?

2007-03-03 Thread js

Ansering myself.

DB_DataObject http://pear.php.net/package/DB_DataObject/

On 2/25/07, js [EMAIL PROTECTED] wrote:

 Hi list,


Is there any implementation of Query Object [1] written in PHP?
I spent some time searching on the net but no clues're found.

Thank you in advance.

[1] http://www.martinfowler.com/eaaCatalog/queryObject.html



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



Re: [PHP-DB] Mysql autentication problem

2007-03-03 Thread Roberto Tavares
I got 5 or 6 users... and a respectable computer...

On Fri, 02 Mar 2007 22:48:52 -0800, Micah Stevens wrote
 Reloading the grant tables should happen almost immediately unless 
 you have an extremely large set of users, very little memory, or a 
 very slow computer.
 
 On 03/02/2007 06:17 PM, bedul wrote:
  - Original Message -
  From: Micah Stevens [EMAIL PROTECTED]
  To: Roberto F Tavares Neto [EMAIL PROTECTED]
  Cc: php-db@lists.php.net
  Sent: Saturday, March 03, 2007 3:17 AM
  Subject: Re: [PHP-DB] Mysql autentication problem
 
 

  Strange. If you look at the users table, is there a password hash in the
  password field?
 
  
 
  i think this must be reload?? not just flush?? it happen to me..
  or perhaps need some times to realy reload??

  Roberto F Tavares Neto wrote:
  
  Micah:
 
  I did create the database. Then, I use the:
 
  GRANT ALL PRIVILEGES ON db.* TO [EMAIL PROTECTED] IDENTIFIED BY 'password'
 
  to do the 2 and 3 steps.
 
  FLUSH PRIVILEGES
 
  to do the step 4.
 
  But the step 5 really does not work... only on the shell or when I
  remove the password from the user...
 
  Roberto
 
  Micah Stevens escreveu:

  Did you give the user permissions to use the database in question?
 
  Here's my sequence of actions:
 
  .
  1) Create DB if it doesn't exist
  2) Create the user w/password
  3) Give the user permission to use the database.
  4) Flush privileges to update the server.
  5) login and enjoy.
 
  -Micah
 
  Roberto F Tavares Neto wrote:
  
  Hello,
 
  I'm trying to do a very simple thing: create a database and a user
  to use it.
 
  So, initially, I use the web interface phpmyadmin. Logged as root, I
  created the database, and the user with some password.
 
  But, I could not login using phpmyadmin. Either any php-based system
  could connect to the BD.
 
  So, I make sure that I got the [EMAIL PROTECTED] and [EMAIL 
  PROTECTED]
  created, with permissions and same password. Nothing.
 
  But I *can* log on mysql shell.
 
  One more info: when the user is set without password, it works fine
  on PHP.
 
 
  Does anyone can give me a clue of what is happening?
 
  Thanks!
 
  Roberto
 


  
 
 
  
  
 
 

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


--
Roberto F Tavares Neto
Prof. Assistente - Departamento de Engenharia de Produção
Universidade Federal de São Carlos - UFSCAR

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



Re: [PHP-DB] Mysql autentication problem

2007-03-03 Thread Roberto Tavares
I did the reload, but with no effect...

On Sat, 3 Mar 2007 09:17:36 +0700, bedul wrote
 - Original Message -
 From: Micah Stevens [EMAIL PROTECTED]
 To: Roberto F Tavares Neto [EMAIL PROTECTED]
 Cc: php-db@lists.php.net
 Sent: Saturday, March 03, 2007 3:17 AM
 Subject: Re: [PHP-DB] Mysql autentication problem
 
  Strange. If you look at the users table, is there a password hash in the
  password field?
 
 
 i think this must be reload?? not just flush?? it happen to me..
 or perhaps need some times to realy reload??
  Roberto F Tavares Neto wrote:
   Micah:
  
   I did create the database. Then, I use the:
  
   GRANT ALL PRIVILEGES ON db.* TO [EMAIL PROTECTED] IDENTIFIED BY 'password'
  
   to do the 2 and 3 steps.
  
   FLUSH PRIVILEGES
  
   to do the step 4.
  
   But the step 5 really does not work... only on the shell or when I
   remove the password from the user...
  
   Roberto
  
   Micah Stevens escreveu:
   Did you give the user permissions to use the database in question?
  
   Here's my sequence of actions:
  
   .
   1) Create DB if it doesn't exist
   2) Create the user w/password
   3) Give the user permission to use the database.
   4) Flush privileges to update the server.
   5) login and enjoy.
  
   -Micah
  
   Roberto F Tavares Neto wrote:
   Hello,
  
   I'm trying to do a very simple thing: create a database and a user
   to use it.
  
   So, initially, I use the web interface phpmyadmin. Logged as root, I
   created the database, and the user with some password.
  
   But, I could not login using phpmyadmin. Either any php-based system
   could connect to the BD.
  
   So, I make sure that I got the [EMAIL PROTECTED] and [EMAIL 
   PROTECTED]
   created, with permissions and same password. Nothing.
  
   But I *can* log on mysql shell.
  
   One more info: when the user is set without password, it works fine
   on PHP.
  
  
   Does anyone can give me a clue of what is happening?
  
   Thanks!
  
   Roberto
  
  
  
  
 
 
 
 
 
 
  --
  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


--
Roberto F Tavares Neto
Prof. Assistente - Departamento de Engenharia de Produção
Universidade Federal de São Carlos - UFSCAR

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



Re: [PHP-DB] recursion in php and mysql

2007-03-03 Thread Haydar TUNA
Hello,
You can use class like the following code .:)

?php
  require (mysql.class);
  $conn = new MySQLConnection ($user, $password, $host,$database);
  ...
  ...
  $query1 = new MySQLCommand ($sql1, $conn);
  $query1-Execute();

  $query2 = new MySQLCommand ($sql2, $conn);
  $query2-Execute();
  ..
?




Micah Stevens [EMAIL PROTECTED], haber iletisinde sunlari 
yazdi:[EMAIL PROTECTED]
 Classes are overrated. :)

 Bastien Koert wrote:
 you could make the connection variable global, but the best bet here
 is to use a class and create a db object that your functions could call

 Bastien


 From: Ron Croonenberg [EMAIL PROTECTED]
 To: php-db@lists.php.net
 Subject: [PHP-DB] recursion in php and mysql
 Date: Thu, 01 Mar 2007 23:52:54 -0500

 Hello all,

 I wrote an app in php and it uses recursion.

 Problem I have is that when I connect to a database using
 mysql_connect($dbhost, $username, $password); and select a table with
 mysql_select_db($database) I cannot access the table anymore from some
 function.

 Now I can connect and select a database in that php function  but that
 means that process happens A LOT and connecting and selecting everytime
 probably slows down the app quite a bit

 Is there a way to connect to a database and select a table globally
 so that I have access to it in ever php function I write ?

 thanks,

 Ron

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


 _
 Find out the restaurants participating in Winterlicious
 http://local.live.com/default.aspx?v=2cp=43.658648~-79.383962style=rlvl=15tilt=-90dir=0alt=-1000scene=3702663cid=7ABE80D1746919B4!1329
 From January 26 to February 8, 2007

 

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



[PHP-DB] Re: Creating a Table to line query results in php?

2007-03-03 Thread Haydar TUNA
Hello,
 You can use HTML center tag. if you change your echo line in the 
code below, may be your problem will be fixed :)

-- 
Haydar TUNA
Republic Of Turkey - Ministry of National Education
Education Technology Department Ankara / TURKEY
Web: http://www.haydartuna.net

Scott [EMAIL PROTECTED], haber iletisinde sunlari 
yazdi:[EMAIL PROTECTED]
 Hi everyone!

 How can I create a table...or even something similar...to line information 
 up?

 The information is coming from an mysql database and there are 5
 columns of data.

 Of course I am using php to call the data out of the database.

 A simple example:

 while ($data = mysql_fetch_array($res))
 {
 $idfield = $data['IDFIELD'];
 $name = $data['Name'];
 $effect = $data['Effect'];
 $category = $data['Category'];
 $origin = $data['Origin'];
 $image = $data['Image'];

 echo img src=\image/$image\, $name, $effect, $category, $originbr;
 }

 The echo is the stuff I want to line up under the headings of the
 columns when they are displayed.

 So there are 5 headers and under the 5 headers is the resulting
 display of info and I want it lined up, centered, under the headers.

 Does that all make sense?

 Thanks for all of your time!

 S 

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



[PHP-DB] Re: mssql Database name grater than 30 characters

2007-03-03 Thread Haydar TUNA
Hello,
 All of objects that you created in SQL Server is in the master 
database. In this database, there is a table called sysobjects that put all 
of information about tables and so on. You can see table name length in this 
table :)

-- 
Haydar TUNA
Republic Of Turkey - Ministry of National Education
Education Technology Department Ankara / TURKEY
Web: http://www.haydartuna.net

jp [EMAIL PROTECTED], haber iletisinde þunlarý 
yazdý:[EMAIL PROTECTED]
 It seems I'm not able to select a MS SQL database that has a name greater 
 than 29 characters? Is their a work around for this? 

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



Re: [PHP-DB] Re: Creating a Table to line query results in php?

2007-03-03 Thread Brad Bonkoski
How can I create a table...or even something similar...to line information 
up?



echo table;
echo trthHeader1/ththHeader2/ththHeader N/th/tr;


while ($data = mysql_fetch_array($res))
{
$idfield = $data['IDFIELD'];
$name = $data['Name'];
$effect = $data['Effect'];
$category = $data['Category'];
$origin = $data['Origin'];
$image = $data['Image'];

echo img src=\image/$image\, $name, $effect, $category, $originbr;


echo trtdimg 
src=\image/$image/\/tdtd$name/tdtd$effect/tdtd$category/tdtd$origin/td/tr;


}

echo /table;

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



Re: [PHP-DB] Mysql autentication problem

2007-03-03 Thread Micah Stevens
In mysql 4.1, they changed the hash format of the passwords. If you 
stored the password from a 3.x client, and area accessing with a 4.x or 
5.x client, or the other way around, you might have similar problems.


Your command line client is likely the same version as the server, so 
I'm guessing that your php might be older.


However, this situation is usually accompanied by a specific error 
message referencing the client version. Do you have that?


-Micah

On 03/02/2007 11:35 PM, bedul wrote:

now you mention it.
i hope the same problem will solve.
 
i use in windows (own pc)..not in real-life server.. thx for your 
repair on my missuderstanding


- Original Message -
*From:* Micah Stevens mailto:[EMAIL PROTECTED]
*To:* bedul mailto:[EMAIL PROTECTED]
*Cc:* php-db@lists.php.net mailto:php-db@lists.php.net
*Sent:* Saturday, March 03, 2007 1:48 PM
*Subject:* Re: [PHP-DB] Mysql autentication problem

Reloading the grant tables should happen almost immediately unless
you have an extremely large set of users, very little memory, or a
very slow computer.



On 03/02/2007 06:17 PM, bedul wrote:

- Original Message -
From: Micah Stevens [EMAIL PROTECTED]
To: Roberto F Tavares Neto [EMAIL PROTECTED]
Cc: php-db@lists.php.net
Sent: Saturday, March 03, 2007 3:17 AM
Subject: Re: [PHP-DB] Mysql autentication problem


  

Strange. If you look at the users table, is there a password hash in the
password field?




i think this must be reload?? not just flush?? it happen to me..
or perhaps need some times to realy reload??
  

Roberto F Tavares Neto wrote:


Micah:

I did create the database. Then, I use the:

GRANT ALL PRIVILEGES ON db.* TO [EMAIL PROTECTED] IDENTIFIED BY 'password'

to do the 2 and 3 steps.

FLUSH PRIVILEGES

to do the step 4.

But the step 5 really does not work... only on the shell or when I
remove the password from the user...

Roberto

Micah Stevens escreveu:
  

Did you give the user permissions to use the database in question?

Here's my sequence of actions:

.
1) Create DB if it doesn't exist
2) Create the user w/password
3) Give the user permission to use the database.
4) Flush privileges to update the server.
5) login and enjoy.

-Micah

Roberto F Tavares Neto wrote:


Hello,

I'm trying to do a very simple thing: create a database and a user
to use it.

So, initially, I use the web interface phpmyadmin. Logged as root, I
created the database, and the user with some password.

But, I could not login using phpmyadmin. Either any php-based system
could connect to the BD.

So, I make sure that I got the [EMAIL PROTECTED] and [EMAIL PROTECTED]
created, with permissions and same password. Nothing.

But I *can* log on mysql shell.

One more info: when the user is set without password, it works fine
on PHP.


Does anyone can give me a clue of what is happening?

Thanks!

Roberto

  
  








  

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



  




[PHP-DB] Re: auto upload

2007-03-03 Thread Haydar TUNA
Hello,
I have got a very interesting answer. I built an exe program with 
Delphi or other Visual Programming. In this program, I use WebBrowser API. 
With this API, I use your secure file upload program. then I call this exe 
program from task manager. In this way, you can auto uplaod file everytime:)


-- 
Haydar TUNA
Republic Of Turkey - Ministry of National Education
Education Technology Department Ankara / TURKEY
Web: http://www.haydartuna.net


bedul [EMAIL PROTECTED], haber iletisinde sunlari 
yazdi:[EMAIL PROTECTED]
 this might a strange code i request, plz forgive my rudeness.

 everyday i was update a doc where i always put on d:\report\today.xls 
 where
 i use a simple upload document prog (inside only box for upload only? and
 submit). the file i upload will save on file folder (inside the upload
 folder)

 today i want to skip that procedure.. i want to build this web where i 
 open
 the site (http://server-e/upload/index.php) then click the button/submit..
 this button will triger action where i will upload the d:\report\today.xls
 file without using browse/file input.

 can u help me?? i do know about the unsafe that metodh.. thx for your
 attention. 

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



Re: [PHP-DB] error creating tables

2007-03-03 Thread Haydar TUNA
Hello,
I tried to run your SQL query with my private database and there 
wasn't any problem. You can use primary key like your PHP code because I run 
your SQL in the mysql command line succesfully. Did you connect root account 
to your mysql server? If the account is root, there isn't any problem. if 
the accout isn't root, you should check your user privileges.


-- 
Haydar TUNA
Republic Of Turkey - Ministry of National Education
Education Technology Department Ankara / TURKEY
Web: http://www.haydartuna.net

Frank Flynn [EMAIL PROTECTED], haber iletisinde sunlari 
yazdi:[EMAIL PROTECTED]
 Good rule - to debug try to run the same command on the command line
 of the terminal tool, you'll get better errors.

 But I suspect you have not said what the PRIMARY KEY is - typically
 you would say: PRIMARY KEY(f_name, l_name)
 or perhaps account whatever, it should be unique.

 Good Luck,
 Frank

 On Feb 27, 2007, at 3:58 AM, [EMAIL PROTECTED] wrote:

 From: aconite [EMAIL PROTECTED]
 Date: February 27, 2007 3:58:23 AM PST
 To: php-db@lists.php.net
 Subject: error creating tables



 im trying to create a database in a php file.i have MySql 5.0.33
 PHP 5.2.1
 this is the code i have in the php file



 $con = mysql_pconnect(127.0.0.1,root,12345);
 if (!$con)
   {
   die('Could not connect: ' . mysql_error());
   }


 if (mysql_query(CREATE DATABASE mydatabase,$con))
   {
   echo 'Database created  ';
   }
 else
   {
   echo Error creating database:  . mysql_error();
   }


 if(!mysql_select_db(mydatabase))
 {
 die('Could not select database: mydatabase ' . mysql_error());
 }

  echo Database selected ;

 if (mysql_query(CREATE TABLE customer
  (f_name VARCHAR(15) NOT NULL,
l_name VARCHAR(15) NOT NULL,
   phone  VARCHAR(11) ,
   account INT UNSIGNED PRIMARY KEY))
)
 {
   echo 'table created';
   }
 else
   {
   echo   Error creating table:  . mysql_error();
   }

 when i view this file in the browser i get

 Database created Database selected Error creating table: Can't
 create table
 '.\mydatabase\customer.frm' (errno: 121)

 any idea wht the prob is??
 I did some reading and found it might have something to do with
 InnoDB. but
 i dont know what that is  .If that is the prob can someone please
 explain
 InnoDB concept
 -- 
 View this message in context: http://www.nabble.com/error-creating-
 tables-tf3300307.html#a9180499
 Sent from the Php - Database mailing list archive at Nabble.com.



 

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