Re: [PHP-DB] Re: Very complex query

2003-12-11 Thread Muhammed Mamedov
You can also DISTINCT command instead.
UNIQUE command isnot supported by mySQL (at least at MySQL 3.23.41- I am
using)

Hope this helps,
M.Mamedov


- Original Message - 
From: "Justin Patrin" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, December 11, 2003 9:52 AM
Subject: [PHP-DB] Re: Very complex query


> Mike U. Petrov wrote:
>
> > Hi every1!
> > Excuse me for maybe offtopic but I need help on mysql database.
> > I have 4 tables, and here are some important extractions from 'em:
> > objects{
> > object_id;
> > name;
> > }
> > users{
> > user_id;
> > nick;
> > date;
> > }
> > notes{
> > user_id;
> > object_id;
> > }
> > object_properties{
> > object_id;
> > property_name;
> > property_value;
> > }
> > I need to get EACH object_id from notes with ONLY ONE of corresponding
> > user_id's. Also for each object I need it's name from objects and
property
> > from object_properties where property_name = 'foo'. And for each of
obtained
> > user_id I need it's nick and it's date.
> > Does anyone know how to do it just by one mysql query?
> >
> > Thanx...
> > Mike U. Petrov
>
> Use unique(user_id). And please don't reply to a previous post when
> posting a new threadit screws up threading.
>
> -- 
> paperCrane 
>
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.545 / Virus Database: 339 - Release Date: 27.11.2003

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



Re: [PHP-DB] Re: Very complex query

2003-12-11 Thread Muhammed Mamedov
Give me exactly the sample table with data and show what you want there.
I will try to help you.

M.Mamedov

- Original Message - 
From: "Mike U. Petrov" <[EMAIL PROTECTED]>
To: "Muhammed Mamedov" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, December 11, 2003 10:17 AM
Subject: RE: [PHP-DB] Re: Very complex query


> No, DISTINCT isn't match my purpose cause of it rerurns unique rows but I
> need ONE user_id per one object_id.
>
> Mike U. Petrov
>
>
> -Original Message-
> From: Muhammed Mamedov [mailto:[EMAIL PROTECTED]
> Sent: Thursday, December 11, 2003 11:01 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP-DB] Re: Very complex query
>
>
> You can also DISTINCT command instead.
> UNIQUE command isnot supported by mySQL (at least at MySQL 3.23.41- I am
> using)
>
> Hope this helps,
> M.Mamedov
>
>
> - Original Message -
> From: "Justin Patrin" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Thursday, December 11, 2003 9:52 AM
> Subject: [PHP-DB] Re: Very complex query
>
>
> > Mike U. Petrov wrote:
> >
> > > Hi every1!
> > > Excuse me for maybe offtopic but I need help on mysql database.
> > > I have 4 tables, and here are some important extractions from 'em:
> > > objects{
> > > object_id;
> > > name;
> > > }
> > > users{
> > > user_id;
> > > nick;
> > > date;
> > > }
> > > notes{
> > > user_id;
> > > object_id;
> > > }
> > > object_properties{
> > > object_id;
> > > property_name;
> > > property_value;
> > > }
> > > I need to get EACH object_id from notes with ONLY ONE of corresponding
> > > user_id's. Also for each object I need it's name from objects and
> property
> > > from object_properties where property_name = 'foo'. And for each of
> obtained
> > > user_id I need it's nick and it's date.
> > > Does anyone know how to do it just by one mysql query?
> > >
> > > Thanx...
> > > Mike U. Petrov
> >
> > Use unique(user_id). And please don't reply to a previous post when
> > posting a new threadit screws up threading.
> >
> > --
> > paperCrane 
> >
> > --
> > PHP Database Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.545 / Virus Database: 339 - Release Date: 27.11.2003
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
>


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.545 / Virus Database: 339 - Release Date: 27.11.2003

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



Re: [PHP-DB] SQL question

2003-12-11 Thread Muhammed Mamedov
It should be as follows:
SELECT * FROM x_table WHERE name Like = "%part_of_name%"

Hope this helps,
M.Mamedov

- Original Message - 
From: "Constantin Brinzoi" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, December 11, 2003 1:51 PM
Subject: [PHP-DB] SQL question


> I know it is  possible to search a database like this:
> 
> SELECT * FROM x_table WHERE name="%part_of_name%"
> 
> but I don't know for sure the correct command.
> 
> Could you tell me the right syntax?
> 
> TIA
> Aurel.
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.545 / Virus Database: 339 - Release Date: 27.11.2003

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



Re: [PHP-DB] SQL question

2003-12-11 Thread Muhammed Mamedov
I am sorry without equal "=" sign

SELECT * FROM x_table WHERE name Like "%part_of_name%"

there are actually three ways to do this:
"%part_of_name%"  part_of_name appears anywhere
"%part_of_name"part_of_name appears at the end
"art_of_name%"   part_of_name appears at the begining
 
M.Mamedov


----- Original Message - 
From: "Muhammed Mamedov" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, December 11, 2003 2:00 PM
Subject: Re: [PHP-DB] SQL question


> It should be as follows:
> SELECT * FROM x_table WHERE name Like = "%part_of_name%"
> 
> Hope this helps,
> M.Mamedov
> 
> - Original Message - 
> From: "Constantin Brinzoi" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Thursday, December 11, 2003 1:51 PM
> Subject: [PHP-DB] SQL question
> 
> 
> > I know it is  possible to search a database like this:
> > 
> > SELECT * FROM x_table WHERE name="%part_of_name%"
> > 
> > but I don't know for sure the correct command.
> > 
> > Could you tell me the right syntax?
> > 
> > TIA
> > Aurel.
> > 
> > -- 
> > PHP Database Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> > 
> 
> 
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.545 / Virus Database: 339 - Release Date: 27.11.2003
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.545 / Virus Database: 339 - Release Date: 27.11.2003

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



Re: [PHP-DB] Another question

2003-12-15 Thread Muhammed Mamedov
Really?
What is the reason for that?...

Muhammed.

- Original Message - 
From: "Duane Lakoduk" <[EMAIL PROTECTED]>
To: "'Constantin Brinzoi'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Monday, December 15, 2003 3:17 PM
Subject: RE: [PHP-DB] Another question


> 
> You can avoid the prompt when using javascript to close the window if you
> use this:
> 
> function closeit(){
> window.opener = top;
> window.close();
> }
> 
> Now, window will close without prompting.
> 
> hth,
> 
> Duane
> > -Original Message-
> > From: Constantin Brinzoi [mailto:[EMAIL PROTECTED]
> > Sent: Monday, December 15, 2003 6:15 AM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP-DB] Another question
> >
> >
> > Is there a php function that closes a browser window?
> >
> > I know there is a javascript function (window.close), but I
> > can't use it
> > because it complains that the window is not opened by javascript
> > (window.open).
> >
> > I looked over the function reference but I didn't find anything about
> > this problem.
> >
> > TIA
> > Constantin Brinzoi
> >
> >
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.545 / Virus Database: 339 - Release Date: 27.11.2003

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



Re: [PHP-DB] Another question

2003-12-15 Thread Muhammed Mamedov
Could you provide the code you use for destroying your session?

Because if you destroy it "session_unregister($session_name)" then no need
for browser closing.
But if you don't destroy it, then it will be destroyed automatically after
you close the browser.. this is how PHP works.

Regards,
Muhammed.


- Original Message - 
From: "Constantin Brinzoi" <[EMAIL PROTECTED]>
To: "Muhammed Mamedov" <[EMAIL PROTECTED]>
Sent: Monday, December 15, 2003 4:05 PM
Subject: Re: [PHP-DB] Another question


> The reason is that I want to logout from the system.
> I destroyed the session but the session is still there!
> So I'm thinking of closing the window for good!
>
> Do you have any ideas how to make it work?
>
> Aurel.
>
> On Mon, 2003-12-15 at 15:25, Muhammed Mamedov wrote:
> > Really?
> > What is the reason for that?...
> >
> > Muhammed.
> >
> > - Original Message - 
> > From: "Duane Lakoduk" <[EMAIL PROTECTED]>
> > To: "'Constantin Brinzoi'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> > Sent: Monday, December 15, 2003 3:17 PM
> > Subject: RE: [PHP-DB] Another question
> >
> >
> > >
> > > You can avoid the prompt when using javascript to close the window if
you
> > > use this:
> > >
> > > function closeit(){
> > > window.opener = top;
> > > window.close();
> > > }
> > >
> > > Now, window will close without prompting.
> > >
> > > hth,
> > >
> > > Duane
> > > > -Original Message-
> > > > From: Constantin Brinzoi [mailto:[EMAIL PROTECTED]
> > > > Sent: Monday, December 15, 2003 6:15 AM
> > > > To: [EMAIL PROTECTED]
> > > > Subject: [PHP-DB] Another question
> > > >
> > > >
> > > > Is there a php function that closes a browser window?
> > > >
> > > > I know there is a javascript function (window.close), but I
> > > > can't use it
> > > > because it complains that the window is not opened by javascript
> > > > (window.open).
> > > >
> > > > I looked over the function reference but I didn't find anything
about
> > > > this problem.
> > > >
> > > > TIA
> > > > Constantin Brinzoi
> > > >
> > > >
> > >
> > > -- 
> > > PHP Database Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> >
> >
> > ---
> > Outgoing mail is certified Virus Free.
> > Checked by AVG anti-virus system (http://www.grisoft.com).
> > Version: 6.0.545 / Virus Database: 339 - Release Date: 27.11.2003
>


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.545 / Virus Database: 339 - Release Date: 27.11.2003

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



Re: [PHP-DB] Another question

2003-12-15 Thread Muhammed Mamedov
I see.

You use something like this right?

 header('WWW-Authenticate: Basic realm="My Realm"');
 header('HTTP/1.0 401 Unauthorized');

and of course want to get rid of PHP_AUTH_USER and PHP_AUTH_PW variables
which are then return.
Well..this is something different than the session. If you look at PHP
documentation these are represented as globals. So most probably you will
have to unset() them (using $Global['var_name'] maybe .?)


M.Mamedov

- Original Message - 
From: "Constantin Brinzoi" <[EMAIL PROTECTED]>
To: "Muhammed Mamedov" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, December 15, 2003 4:13 PM
Subject: Re: [PHP-DB] Another question


> I destroy the session with:
> session_destroy()
>
> The file is deleted from the /tmp directory (which is good) but after
> that I want to go on another page (public space) and get rid of
> PHP_AUTH_USER and PHP_AUTH_PW.
>
> How can I do it?
>
> On Mon, 2003-12-15 at 16:10, Muhammed Mamedov wrote:
> > Could you provide the code you use for destroying your session?
> >
> > Because if you destroy it "session_unregister($session_name)" then no
need
> > for browser closing.
> > But if you don't destroy it, then it will be destroyed automatically
after
> > you close the browser.. this is how PHP works.
> >
> > Regards,
> > Muhammed.
> >
> >
> > - Original Message - 
> > From: "Constantin Brinzoi" <[EMAIL PROTECTED]>
> > To: "Muhammed Mamedov" <[EMAIL PROTECTED]>
> > Sent: Monday, December 15, 2003 4:05 PM
> > Subject: Re: [PHP-DB] Another question
> >
> >
> > > The reason is that I want to logout from the system.
> > > I destroyed the session but the session is still there!
> > > So I'm thinking of closing the window for good!
> > >
> > > Do you have any ideas how to make it work?
> > >
> > > Aurel.
> > >
> > > On Mon, 2003-12-15 at 15:25, Muhammed Mamedov wrote:
> > > > Really?
> > > > What is the reason for that?...
> > > >
> > > > Muhammed.
> > > >
> > > > - Original Message - 
> > > > From: "Duane Lakoduk" <[EMAIL PROTECTED]>
> > > > To: "'Constantin Brinzoi'" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
> > > > Sent: Monday, December 15, 2003 3:17 PM
> > > > Subject: RE: [PHP-DB] Another question
> > > >
> > > >
> > > > >
> > > > > You can avoid the prompt when using javascript to close the window
if
> > you
> > > > > use this:
> > > > >
> > > > > function closeit(){
> > > > > window.opener = top;
> > > > > window.close();
> > > > > }
> > > > >
> > > > > Now, window will close without prompting.
> > > > >
> > > > > hth,
> > > > >
> > > > > Duane
> > > > > > -Original Message-
> > > > > > From: Constantin Brinzoi [mailto:[EMAIL PROTECTED]
> > > > > > Sent: Monday, December 15, 2003 6:15 AM
> > > > > > To: [EMAIL PROTECTED]
> > > > > > Subject: [PHP-DB] Another question
> > > > > >
> > > > > >
> > > > > > Is there a php function that closes a browser window?
> > > > > >
> > > > > > I know there is a javascript function (window.close), but I
> > > > > > can't use it
> > > > > > because it complains that the window is not opened by javascript
> > > > > > (window.open).
> > > > > >
> > > > > > I looked over the function reference but I didn't find anything
> > about
> > > > > > this problem.
> > > > > >
> > > > > > TIA
> > > > > > Constantin Brinzoi
> > > > > >
> > > > > >
> > > > >
> > > > > -- 
> > > > > PHP Database Mailing List (http://www.php.net/)
> > > > > To unsubscribe, visit: http://www.php.net/unsub.php
> > > > >
> > > >
> > > >
> > > > ---
> > > > Outgoing mail is certified Virus Free.
> > > > Checked by AVG anti-virus system (http://www.grisoft.com).
> > > > Version: 6.0.545 / Virus Database: 339 - Release Date: 27.11.2003
> > >
> >
> >
> > ---
> > Outgoing mail is certified Virus Free.
> > Checked by AVG anti-virus system (http://www.grisoft.com).
> > Version: 6.0.545 / Virus Database: 339 - Release Date: 27.11.2003
>


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.545 / Virus Database: 339 - Release Date: 27.11.2003

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



Fw: [PHP-DB] Something ease... I guess

2003-12-16 Thread Muhammed Mamedov

- Original Message - 
From: "Muhammed Mamedov" <[EMAIL PROTECTED]>
To: "Nikos Gatsis" <[EMAIL PROTECTED]>
Sent: Tuesday, December 16, 2003 3:56 PM
Subject: Re: [PHP-DB] Something ease... I guess


> you will need dynamic variable construction..
> use this
> for($i=1;$i<5;$++) {
> $tmp = "check".$i;
> echo $$tmp; //will print $check1, 2,3,...
> }
> 
> this should work.
> 
> Regards,
> Muhammed Mamedov
> 
> - Original Message - 
> From: "Nikos Gatsis" <[EMAIL PROTECTED]>
> To: "PHP-mailist" <[EMAIL PROTECTED]>
> Sent: Tuesday, December 16, 2003 3:44 PM
> Subject: [PHP-DB] Something ease... I guess
> 
> 
> > Hello list
> > 
> > I have 4 variables, $check1, $check2, $check3, $check4
> > 
> > How can i use a for loop to echo each one.
> > 
> > (lets say echo $check($i)...)
> > 
> > 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] Hello

2003-12-17 Thread Muhammed Mamedov
Welcome Rodrigo!
Start checking php.net

for object/clasess check out this mirror site of php.net
http://php.oregonstate.edu/manual/en/ref.classobj.php

By the way I don't know if we have from Brazil here...

M. Mamedov

- Original Message - 
From: "Rodrigo Kochenburger" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, December 16, 2003 10:33 PM
Subject: [PHP-DB] Hello


> Hi everybody,
> i'm new in this list, so let me introduce my self.
> My name is Rodrigo and i'm from brazil, so sorry if my english isnt
> correct.
> 
> let me know know if there's anothers brazilians here.
> 
> And i'd like to starting using this to ask about some tutorial or
> something like that to help me with Software Architecture in PHP using
> Oriented Object Programming.
> 
> Thanks a Lot.
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

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



[PHP-DB] DB, XML and & sign

2003-12-18 Thread Muhammed Mamedov
Hello everyone,

I read input from user, then via XML send it to DB.
thing is that when user enters "&" sign XML is no more well-formatted, what causes 
error. 
Does anyone has any suggestions on how to remove & sign from user input, considering 
that data entered by users can be multilingual, that is "ö" character is being 
converted to some unicode "ê" character which also contains "&" sign, but this 
one doesn't cause any problem - any other user entered "&" signs should be removed or 
should be translated to unicode & "!".

Your help will be appreciated.

Muhammed Mamedov

[PHP-DB] Re: Re:Subject: DB, XML and & sign

2003-12-19 Thread Muhammed Mamedov
Then thing is that I have a string to play with AFTER form submission..
So if user enters something like this "Say hello to Alex & Özgür" to my PHP
file this will be sent like "Say hello to Alex & Özgİr". You see there
are 2 ampersands here, and only one should be removed - the one just after
"Alex ".

As you say I can use JavaScript on the Browser(Client) side, but it an
option I don't want to use. I want everything to be done on Server side to
be 100% assured that everything worked fine. One way to do this is maybe
using regular expression, so that i.e. say "Do not remove ampersand if it is
followeb by # sign, 3 letters and ; right aferwards, in any other cases just
remove it"..what do you think? And what will the reg. expr. be in this case?

Any other suggestions?

Regards,
Muhammed Mamedov



- Original Message - 
From: "Neil Smth" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, December 19, 2003 2:27 AM
Subject: Re:Subject: DB, XML and & sign


htmlspecialchars() will deal with the following special characters :

<
 >
&

And so you might find these will be converted into XML entities intact, and
prevernt these causing problems. As you pointed out though, users can also
enter other values which will cause problems in an XML parser, for example
UTF-16 values in a parser expecting UTF-8.

I recommend if possible, that you check for XML support in the browser.
Then, use 'loadXML' or equivalent from the form field, and place this
value.xml in a hidden form field. That way, your users browser will convert
any unsafe characters to XML equivalents (usually 〹 format).

If XML support fails (use a javascript try catch block or set the XML
form field to empty), set another form field so you can switch on
htmlspecialchars() at the server if required.

Cheers - Neil.

At 17:33 18/12/2003 +, you wrote:
>Message-ID: <[EMAIL PROTECTED]>
>From: "Muhammed Mamedov" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Date: Thu, 18 Dec 2003 18:51:06 +0200
>MIME-Version: 1.0
>Content-Type: multipart/alternative;
> boundary="=_NextPart_000_01CF_01C3C597.E5096E80"
>Subject: DB, XML and & sign
>
>Hello everyone,
>
>I read input from user, then via XML send it to DB.
>thing is that when user enters "&" sign XML is no more well-formatted,
>what causes error.
>Does anyone has any suggestions on how to remove & sign from user input,
>considering that data entered by users can be multilingual, that is "ö"
>character is being converted to some unicode "ê" character which also
>contains "&" sign, but this one doesn't cause any problem - any other user
>entered "&" signs should be removed or should be translated to unicode &
>"!".
>
>Your help will be appreciated.

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



Re: [PHP-DB] Database Array Question

2003-12-22 Thread Muhammed Mamedov
! - sign adds a negative meaning to the statement.

Thus,

if(!isset($_SESSION['uid'])) means = If (NOT isset($_SESSION['uid'])))

you know that if(statement) will work if "statement" returns a "true"
value...so if $_SESSION['uid'] is already set(has some value),
isset($_SESSION['uid']) will also return a true value...
so, by writting if(!isset()) { ...some_actions... }, some_actions will be
executed only if uid session is not set (doesn't contain any value).

Hope this helps,

Muhammed Mamedov

- Original Message - 
From: "Kieran Hood" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, December 22, 2003 1:26 PM
Subject: [PHP-DB] Database Array Question


> I'm new to PHP and was wondering if there's any better way of retrieving
> the records from the query other than using an array (This query will only
> return 1 row):
>
> $auth = mysql_query("SELECT username, userlevel, password, email FROM
> users WHERE id = '".$_SESSION['uid']."'");
> while ($row = mysql_fetch_array($auth))
> {
> $password = $row['password'];
> }
>
>
> Also, can anyone tell me what the relevance of adding '!' is to an if
> statement eg.
>
> This:
> if(!isset($_SESSION['uid']))
>
> Instead of this:
> if(isset($_SESSION['uid']))
>
>
> Thanks
> -- 
> Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
>
> -- 
> Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
>
> -- 
> 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] Remove all instances of a character....

2003-12-24 Thread Muhammed Mamedov
Try this :

mysql_query("DELETE FROM YOURTABLE WHERE YOURCOLUMN_NAME=';'");

Saygilarla,
Muhammed Mamedov
- Original Message - 
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, December 24, 2003 1:12 PM
Subject: [PHP-DB] Remove all instances of a character


> I have a MySQL database, with around 500 entries in one table...
> I've noticed that many entries have an erroneous ';' in the one of the 
> fields.
> 
> What I need to do, is tell MySQL to go through the ENTIRE table and find 
> any instances of '  ;  ' and them delete them... leaving the rest of the 
> data intact.
> 
> I'll run along to google now, and mysql.org, but it's xmas eve, and I'm 
> feeling lazy.. ;-)
> 
> Cheers,
> Tris...
> 
> *
> The information contained in this e-mail message is intended only for 
> the personal and confidential use of the recipient(s) named above.  
> If the reader of this message is not the intended recipient or an agent
> responsible for delivering it to the intended recipient, you are hereby 
> notified that you have received this document in error and that any
> review, dissemination, distribution, or copying of this message is 
> strictly prohibited. If you have received this communication in error, 
> please notify us immediately by e-mail, and delete the original message.
> ***
> 
> 

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



Re: [PHP-DB] PHP Error or installation problem?

2003-12-26 Thread Muhammed Mamedov
Try to edit php.ini file.

There you specify the path of MySQL. After you ugraded that path maybe
changed, maybe this is the cause of the problem.

Regards,
Muhammed Mamedov
turkmenweb.com

- Original Message - 
From: "Chris Payne" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, December 26, 2003 8:16 AM
Subject: [PHP-DB] PHP Error or installation problem?


Hi there everyone,

I just upgraded my Linux installation of MySQL from 3.23 to 4.0 (Well, the
latest production build).  In Webmin everything is fine, I can login etc
. BUT with PHP 4, the version I used for 3.23 with no modifications
(Which may be the problem?) I am having problems connecting tot he server,
and with PHPMyADMIN I get the following error:

cannot load MySQL extension

HELP I am so confused and I need my DB up as soon as possible :-(

Chris

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



Re: [PHP-DB] Dilemma (PDA based solution??)

2003-12-26 Thread Muhammed Mamedov
try XHTML
or simply do some WAP around it will be the easiest thing... from PDA, in a
WAP browser, you will just send needed requests to your current system

or maybe you'd like to use J2ME? I am experienced in this this - J2ME rulez
'em all :)

Regards,
Muhammed Mamedov

- Original Message - 
From: "Robert Sossomon" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, December 26, 2003 4:59 PM
Subject: [PHP-DB] Dilemma (PDA based solution??)


> OK folks,
>
> I've been working on a quote system for a while and now the boss has
> added a new twist.
>
> He wants to be able to hook a PDA up to it, push a single button, and
> the system transmit and receive data including:
> New prices, customers, data, etc...
> I figure I am going to have to run some MySQL, PHP, Apache on the PDA
> itself so that all the information can be local, but I was wondering if
> anyone has had to do this or maybe had some pointers?
>

> > Thanks,
> Robert
>
> ~~~
> I'd love to, but... The President said he might drop in.
> ~~~
>
> -- 
> 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] PHP Problem, Special String Character...please help

2004-01-14 Thread Muhammed Mamedov
You can encode string before sending it out.
Try htmlspecialchars($str, ENT_QUOTES).. before sending string

-
from PHP manual:
The translations performed are:


  a.. '&' (ampersand) becomes '&'

  b.. '"' (double quote) becomes '"' when ENT_NOQUOTES is not set.

  c.. ''' (single quote) becomes ''' only when ENT_QUOTES is set.

  d.. '<' (less than) becomes '<'

  e.. '>' (greater than) becomes '>'

-

Hope this helps,

Muhammed Mamedov
tmchat.com


- Original Message -
From: "Ferry CS" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, January 14, 2004 12:20 PM
Subject: [PHP-DB] PHP Problem, Special String Character...please help


> Hai...
>
> I have problem with manipulating the string...
> How to send the string with special character
> included to the other pages...
>
> For example the string "Father & Son", when I send into
> other page the display become "Father"
> Example special characters are &, +, <, >, etc
>
>
> How to fix it???
> Thanks very much for your kind attention
>
> Best Regards,
> Ferry
>
>
> PHP sample
>
> file 1 : string_test.php
>
> 
>  $title="Father & Son";
> echo "the real title : $title";
> ?>
>
> 
> next page
>
> 
>
>
>
>
> file 2 : string_display.php
>
> 
>  echo "in this page";
> echo "the title : $stitle";
> ?>
> Could you fix this problem??
> the title should be "Father & Son"
> the problem is using the special character ( &, +, ", <, >, etc)
> 
> back
>
> 
>
> _
> Add photos to your messages with MSN 8. Get 2 months FREE*.
> http://join.msn.com/?page=features/featuredemail
>
> --
> 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] SQL query...

2004-01-15 Thread Muhammed Mamedov
Try this

 "SELECT DISTINCT(file_name), Count(file_name) AS cnt FROM $table_name WHERE
date
> BETWEEN '2003-10-01' AND '2003-12-31' group by file_name order by cnt;
> desc"

Regards,
Muhammed Mamedov
tmchat.com


- Original Message - 
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, January 15, 2004 1:01 PM
Subject: [PHP-DB] SQL query...


> "SELECT DISTINCT(file_name), Count(file_name) FROM $table_name WHERE date
> BETWEEN '2003-10-01' AND '2003-12-31' group by file_name order by ???
> desc"
>
> In the above sql statement, I'm trying to achieve:
>
> 1. select all file names, between two dates.
> 2. list them, and order by the highest number of occurences of count()
>
> Basically, it's for a download tool we have, and my boss wants to easily
> be able to see the top downloaded files.
> It all works, but not the 'order by' bit... what do I have to order by...
> it's not 'file_name', and 'order by count(file_name0' causes an error...
>
> thoughts?
>
> Cheers,
> Tris...
>
> *
> The information contained in this e-mail message is intended only for
> the personal and confidential use of the recipient(s) named above.
> If the reader of this message is not the intended recipient or an agent
> responsible for delivering it to the intended recipient, you are hereby
> notified that you have received this document in error and that any
> review, dissemination, distribution, or copying of this message is
> strictly prohibited. If you have received this communication in error,
> please notify us immediately by e-mail, and delete the original message.
> ***
>
>

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



Re: [PHP-DB] Embedded DB

2004-01-16 Thread Muhammed Mamedov
If you have enough time, wait till PHP5.0. They are going to embed sqlite
into it.

Regards,
Muhammed Mamedov
turkmenweb.com


- Original Message -
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Friday, January 16, 2004 1:47 PM
Subject: RE: [PHP-DB] Embedded DB


> You could try sqlite.  http://www.sqlite.com/ would give you more details
on
> sqlite, http://hu.php.net/sqlite is the PHP manual pages for the sqlite
> extension (PHP4).  You can download the php_sqlite.dll extension for
windows
> here as well.
>
> Neil Morgan
>
> -Original Message-
> From: GUIRAUDOU [mailto:[EMAIL PROTECTED]
> Sent: 16 January 2004 10:08
> To: [EMAIL PROTECTED]
> Subject: [PHP-DB] Embedded DB
>
>
>
> Hi the List,
>
> Could somebody tell me if it exists < embedded database >. I would like to
> integrate a small database in a terminal that has not a big memory size.
> Please tell me if this kind of database exist and please give me some
> information / an Internet site where found it.
>
> Regards
>
> Michel GUIRAUDOU
>
> --
> 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] multi-language site

2004-01-16 Thread Muhammed Mamedov
Hello Ignatius,

I am working on a project which requires a CLEAR seperation of code and
appearance.
Think of this: There is a page which lists news from DB in a specific manner
(latest 10 added, and next,prev links on the bottom). Of course this
requires some PHP code which will retrieve data from DB and display it.
Firstly, designers design appearance of the page (in pure HTML/css) and then
coders re-code that page embedding pieces of PHP code. What I want to do is
to make this process as easy as possible for designers/coders. I am familiar
with XML and XSLT, but in "practise" never used XSL to transform XML...

What do you suggest?
Waiting for your suggestions.

M.Mamedov

- Original Message -
From: "Ignatius Reilly" <[EMAIL PROTECTED]>
To: "Dan Hewins" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, January 15, 2004 8:03 PM
Subject: Re: [PHP-DB] multi-language site


> I would not consider a DB-based design.
>
> I use two approaches (sometimes mixed):
>
> 1. Write content in XML files (one per language) and transform them with
> XSLT. This is nice for mostly content-based sites.
>
> 2. Write the complete application in English and translate it with the
> excellent PHP gettext() extension. Makes it fast, efficient and very cheap
> to maintain. A better option for web applications.
>
> In any case the user's language must be stored in a session variable.
>
> HTH
> Ignatius
>
> _
> - Original Message -
> From: "Dan Hewins" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Thursday, January 15, 2004 18:50
> Subject: [PHP-DB] multi-language site
>
>
> > Forgive me if this is pedestrian or has been covered before.  I'm new
> > to the list and I haven't used PHP too much (yet).
> >
> > Here's my question:
> >
> > I'm looking to use PHP for an upcoming site project where the site
> > needs to be in either English or Spanish. Would PHP be a good approach?
> > I was envisioning having a database with every text bit and image with
> > text in it in two columns, one for English, and one for Spanish. Then
> > each web page would reference some kind of global variable (a cookie?)
> > to determine whether to pull the images and text from the English
> > column or the Spanish column. Does this sound like a good approach? Is
> > PHP capable of something like this?
> >
> > Thanks for any help or suggestions you can give.
> >
> > Dan Hewins
> >
> > --
> > 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] multi-language site

2004-01-16 Thread Muhammed Mamedov
Thank you for your comments Ignatius.
(just to note) : I do not agree that all projects SHOULD require CLEAR
sepeartion of code and appearance.

Further on this issue:
Consider that there are lots of dynamic stuff like "news", and there are
thousands of users and all data is stored in a database. Currently data is
stored as a simple text. And I want to provide users (or their graphic
editors) to display these "news" on their page in the way they like. So, to
achieve this task I need a nice seperation of code and design. We may not
achieve a 100% seperate work, but at least a graphical designer (who doesn't
know any PHP) has to be able to develop a new design for his customers (our
user) with ease.

I also wonder if XSLT can accept any php code?

Any suggestions?

M.Mamedov.


- Original Message -
From: "Ignatius Reilly" <[EMAIL PROTECTED]>
To: "Muhammed Mamedov" <[EMAIL PROTECTED]>; "phpdb" <[EMAIL PROTECTED]>
Sent: Friday, January 16, 2004 3:41 PM
Subject: Re: [PHP-DB] multi-language site


> Preliminary note:
> ALL projects should require a CLEAR seperation of code and appearance.
>
> Now:
> To do what you describe, if you present your data as a HTML table, I would
> suggest retrieving data from the DB as an arra, and using the PEAR
> HTML_Table class to display them. Very easy to learn and extremely
powerful.
> In addition you can use XSLT if the news are stored as XML strings in the
> DB.
>
> HTH
> Ignatius
> _
> - Original Message -
> From: "Muhammed Mamedov" <[EMAIL PROTECTED]>
> To: "Ignatius Reilly" <[EMAIL PROTECTED]>; "phpdb"
> <[EMAIL PROTECTED]>
> Sent: Friday, January 16, 2004 13:57
> Subject: Re: [PHP-DB] multi-language site
>
>
> > Hello Ignatius,
> >
> > I am working on a project which requires a CLEAR seperation of code and
> > appearance.
> > Think of this: There is a page which lists news from DB in a specific
> manner
> > (latest 10 added, and next,prev links on the bottom). Of course this
> > requires some PHP code which will retrieve data from DB and display it.
> > Firstly, designers design appearance of the page (in pure HTML/css) and
> then
> > coders re-code that page embedding pieces of PHP code. What I want to do
> is
> > to make this process as easy as possible for designers/coders. I am
> familiar
> > with XML and XSLT, but in "practise" never used XSL to transform XML...
> >
> > What do you suggest?
> > Waiting for your suggestions.
> >
> > M.Mamedov
> >
> > - Original Message -
> > From: "Ignatius Reilly" <[EMAIL PROTECTED]>
> > To: "Dan Hewins" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> > Sent: Thursday, January 15, 2004 8:03 PM
> > Subject: Re: [PHP-DB] multi-language site
> >
> >
> > > I would not consider a DB-based design.
> > >
> > > I use two approaches (sometimes mixed):
> > >
> > > 1. Write content in XML files (one per language) and transform them
with
> > > XSLT. This is nice for mostly content-based sites.
> > >
> > > 2. Write the complete application in English and translate it with the
> > > excellent PHP gettext() extension. Makes it fast, efficient and very
> cheap
> > > to maintain. A better option for web applications.
> > >
> > > In any case the user's language must be stored in a session variable.
> > >
> > > HTH
> > > Ignatius
> > >
> > > _
> > > - Original Message -
> > > From: "Dan Hewins" <[EMAIL PROTECTED]>
> > > To: <[EMAIL PROTECTED]>
> > > Sent: Thursday, January 15, 2004 18:50
> > > Subject: [PHP-DB] multi-language site
> > >
> > >
> > > > Forgive me if this is pedestrian or has been covered before.  I'm
new
> > > > to the list and I haven't used PHP too much (yet).
> > > >
> > > > Here's my question:
> > > >
> > > > I'm looking to use PHP for an upcoming site project where the site
> > > > needs to be in either English or Spanish. Would PHP be a good
> approach?
> > > > I was envisioning having a database with every text bit and image
with
> > > > text in it in two columns, one for English, and one for Spanish.
Then
> > > > each web page would reference some kind of global variable (a
cookie?)
> > > > to determine whether to pull the images and text from the English
> > > > colum

Fw: [PHP-DB] multi-language site

2004-01-17 Thread Muhammed Mamedov
Thank you for your help Martin,

I am aware of the seperation stuff you are talking. There is a much more
professional term for that 'Design Patterns' use in JAVA (I tell you as a
JAVA professional).. I am also aware of need for code and design
seperation..

What I meant here is that NOT every project needs this! If you are on a
small project it is much easier to write straight forward, without making
this hard seperation..

By the way thanks for "HTML_Template_IT " advice.. I will check that out. If
you have any other advice I am waiting..

What do you think guys how it is better to seperate PHP code from Design
(HTML)?

Regards,
Muhammed Mamedov
turkmenweb.com

- Original Message -
From: "Martin Marques" <[EMAIL PROTECTED]>
To: "Muhammed Mamedov" <[EMAIL PROTECTED]>;
Cc: "Ignatius Reilly" <[EMAIL PROTECTED]>; "phpdb"
<[EMAIL PROTECTED]>
Sent: Friday, January 16, 2004 10:21 PM
Subject: Re: [PHP-DB] multi-language site


> Mensaje citado por Muhammed Mamedov <[EMAIL PROTECTED]>:
>
> > Thank you for your comments Ignatius.
> > (just to note) : I do not agree that all projects SHOULD require CLEAR
> > sepeartion of code and appearance.
>
> Let me disagree with you! :-)
> I a multi-tiered design yuo have a client layer, a server layer (this
should be the
> PHP pages on the server), and the database layer (simply for storage).
>
> Now, the server layer is easier to maintain if you have it devided in a
buissness
> layer and a presentation layer.
>
> The presentation layer should have programs that print the results.
>
> Now, to make it even easier to maintain your code, abstraction of HTML
code from the
> PHP code is the best way to go. It make the PHP more readable, and the
HTML easy to
> edit by non programmers.
>
> > Further on this issue:
> > Consider that there are lots of dynamic stuff like "news", and there are
> > thousands of users and all data is stored in a database. Currently data
is
> > stored as a simple text. And I want to provide users (or their graphic
> > editors) to display these "news" on their page in the way they like. So,
to
> > achieve this task I need a nice seperation of code and design. We may
not
> > achieve a 100% seperate work, but at least a graphical designer (who
doesn't
> > know any PHP) has to be able to develop a new design for his customers
(our
> > user) with ease.
>
> I think you should point to HTML_Template_IT (pear.php.net)
>
> --
> select 'mmarques' || '@' || 'unl.edu.ar' AS email;
> -
> Martín Marqués  |   Programador, DBA
> Centro de Telemática | Administrador
>Universidad Nacional
> del Litoral
> -
>

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



Re: [PHP-DB] Different character sets

2004-01-20 Thread Muhammed Mamedov
Try Unicode (UTF-8) encoding...
Make charset=utf-8 an your pages


Muhammed Mamedov
turkmenweb.com



- Original Message - 
From: "Christine Clerc" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, January 20, 2004 3:59 PM
Subject: [PHP-DB] Different character sets


> Hi,
> 
> My pages collect short texts from different languages through HTML 
> forms. The texts are stored in a MySQL database. Then, they are used 
> in HTML pages.
> 
> Problem 1 : the carriage returns don't show back up.
> Problem 2 : The character above chr128 are not coded properly (obviously)
> Problem 3 : what about other character sets (russian for example)
> 
> Thank you for any information on those subjects.
> 
> Christine
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

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



[PHP-DB] Database Abstraction Layer?

2004-01-21 Thread Muhammed Mamedov
Hello everybody,
What do you think is the best method to abstract php code from a specific database?.
Make PHP code 100% database independent?..

Waitin' for your comments.
Muhammed Mamedov


Re: [PHP-DB] Database Abstraction Layer?

2004-01-21 Thread Muhammed Mamedov
Thanks Ricardo for your comments.

What do you think guys: ADODB or PEAR::DB ?

- Original Message -
From: "Ricardo Lopes" <[EMAIL PROTECTED]>
To: "Muhammed Mamedov" <[EMAIL PROTECTED]>
Sent: Wednesday, January 21, 2004 11:21 AM
Subject: Re: [PHP-DB] Database Abstraction Layer?


> You have ADODB and PEAR DB that both work as abstraction layer. I have
used
> ADODB and seems to me that is very good, yet i have not tested PEAR DB...
>
> To make php code 100% database independent is not very easy, depends of
what
> are you going to do with your code. Use the ADODB or PEAR functions every
> time possible, and avoid the using of sql statements in your code because
> you have to carefull design then to be database independent but that can
be
> a very difficult task.
>
> - Original Message -
> From: "Muhammed Mamedov" <[EMAIL PROTECTED]>
> To: "phpdb" <[EMAIL PROTECTED]>
> Sent: Wednesday, January 21, 2004 8:31 AM
> Subject: [PHP-DB] Database Abstraction Layer?
>
>
> Hello everybody,
> What do you think is the best method to abstract php code from a specific
> database?.
> Make PHP code 100% database independent?..
>
> Waitin' for your comments.
> Muhammed Mamedov
>
>

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



Re: [PHP-DB] Database Abstraction Layer?

2004-01-21 Thread Muhammed Mamedov
Hmm..
Thank you for you sql picks:)
But what do you guys think aabout Pear :: DB? Is it as effective as these
Paul's picks?

Thank you.
Muhammed Mamedov

- Original Message -
From: "Paul Miller" <[EMAIL PROTECTED]>
To: "phpdb" <[EMAIL PROTECTED]>
Sent: Wednesday, January 21, 2004 5:44 PM
Subject: RE: [PHP-DB] Database Abstraction Layer?


> There are a couple of products out there that I am about to start testing,
> starting first with:
>
>  - SQL Relay
> http://sqlrelay.sourceforge.net/
> This product uses its on C interfaces to interact with DBs and different
> programming languages.  It addresses a bunch of items in the PHP DB calls.
> Connection pooling and load balancing.
>
>  - Propel
> http://propel.phpdb.org/
> Extensive templates create the SQL definition files you need to setup your
> database and the classes you need to work with your data model in your PHP
> scripts. The classes for your object model are generated from a simple XML
> schema and any customizations are written in plain PHP.
>
> This will effectively that add SQL and DB dependence out of your mix.
This
> is PHP5 also.
>
> HTH
>
> - Paul
>
> -Original Message-
> From: Muhammed Mamedov [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, January 21, 2004 2:31 AM
> To: phpdb
> Subject: [PHP-DB] Database Abstraction Layer?
>
>
> Hello everybody,
> What do you think is the best method to abstract php code from a specific
> database?.
> Make PHP code 100% database independent?..
>
> Waitin' for your comments.
> Muhammed Mamedov
>
> --
> 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] Database Abstraction Layer?

2004-01-23 Thread Muhammed Mamedov
I don't think that DB_DataObject will create a nicce SQL. I think it's
better to write it yourself (you know when you have large data sets its
better to handle the work youurself)...
But your comments on that PEAR::DB is a good package and that many others
depend on it makes it the favorite one, I am right?..

And one more question : A guy from this list told that MDB supports XML
files (can create db from an XML file and ...) . What do you all think about
it?

Regards,
Muhammed Mamedov

- Original Message -
From: "Justin Patrin" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, January 22, 2004 11:26 PM
Subject: Re: [PHP-DB] Database Abstraction Layer?


> There's also PEAR's DB_DataObject which does build SQL for you. The join
> syntax isn't set up to be totally DB independant yet, but it can and
> will be.
>
> Paul Miller wrote:
>
> > PEAR is great from what I hear.  The issue you are going to run into
with DB
> > independence is not the function calls which could be handled with
something
> > as simple as sqlalphp.  It is the SQL calls themselves.  The two options
I
> > have found is a SQL library with unembeded SQL or the Propel solution.
> >
> > Either way adds a significant time to coding and product release
initially.
> >
> > - Paul
> >
> > -Original Message-
> > From: Muhammed Mamedov [mailto:[EMAIL PROTECTED]
> > Sent: Wednesday, January 21, 2004 10:07 AM
> > To: [EMAIL PROTECTED]; phpdb
> > Subject: Re: [PHP-DB] Database Abstraction Layer?
> >
> >
> > Hmm..
> > Thank you for you sql picks:)
> > But what do you guys think aabout Pear :: DB? Is it as effective as
these
> > Paul's picks?
> >
> > Thank you.
> > Muhammed Mamedov
> >
> > - Original Message -
> > From: "Paul Miller" <[EMAIL PROTECTED]>
> > To: "phpdb" <[EMAIL PROTECTED]>
> > Sent: Wednesday, January 21, 2004 5:44 PM
> > Subject: RE: [PHP-DB] Database Abstraction Layer?
> >
> >
> >
> >>There are a couple of products out there that I am about to start
testing,
> >>starting first with:
> >>
> >> - SQL Relay
> >>http://sqlrelay.sourceforge.net/
> >>This product uses its on C interfaces to interact with DBs and different
> >>programming languages.  It addresses a bunch of items in the PHP DB
calls.
> >>Connection pooling and load balancing.
> >>
> >> - Propel
> >>http://propel.phpdb.org/
> >>Extensive templates create the SQL definition files you need to setup
your
> >>database and the classes you need to work with your data model in your
PHP
> >>scripts. The classes for your object model are generated from a simple
XML
> >>schema and any customizations are written in plain PHP.
> >>
> >>This will effectively that add SQL and DB dependence out of your mix.
> >
> > This
> >
> >>is PHP5 also.
> >>
> >>HTH
> >>
> >>- Paul
> >>
> >>-Original Message-
> >>From: Muhammed Mamedov [mailto:[EMAIL PROTECTED]
> >>Sent: Wednesday, January 21, 2004 2:31 AM
> >>To: phpdb
> >>Subject: [PHP-DB] Database Abstraction Layer?
> >>
> >>
> >>Hello everybody,
> >>What do you think is the best method to abstract php code from a
specific
> >>database?.
> >>Make PHP code 100% database independent?..
> >>
> >>Waitin' for your comments.
> >>Muhammed Mamedov
> >>
> >>--
> >>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
>
>
> --
> paperCrane 
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

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



[PHP-DB] Database Search Engine

2004-02-25 Thread Muhammed Mamedov
Hi,

I have many databases, each full up of more than 20 tables. I need to
perform search based on search criteria entered by users.

Does anyone know effective way of performin this task?

Waiting for your comments.

Regards,
Muhammed Mamedov

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



Re: [PHP-DB] What's wrong with this query?

2004-02-26 Thread Muhammed Mamedov
Try this:

$logit = mysql_query("INSERT INTO log (term,returns,time,date,ip) VALUES
('$search','$arrayword',CURTIME(), CURDATE(), '$ip'"));


Regards,
Muhammed Mamedov
turkmenweb.com

- Original Message -
From: "Axel IS Main" <[EMAIL PROTECTED]>
To: "PHP-DB" <[EMAIL PROTECTED]>
Sent: Thursday, February 26, 2004 11:05 AM
Subject: [PHP-DB] What's wrong with this query?


> I've just tried to do something I've done a thousand times. It does not
> work. I've checked all of the syntax, made sure the field and variable
> names are correct. No matter what I do it just doesn't work. The table
> remains empty. Here's the query:
>
> $logit = mysql_query("INSERT INTO log SET term='$search',
> returns='$arrayword', time=CURTIME(), date=CURDATE(), ip='$ip'");
>
> Now that doesn't look too difficult does it? Well, apparently it's
> impossible! I'm really hoping someone out there can see something that I
> missed.
>
> Nick
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

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



[PHP-DB] Database Search Engine ?

2004-02-26 Thread Muhammed Mamedov
Anyone knows/uses IMP database search engine?
http://www.imptechnology.com/DesktopDefault.aspx?tabid=56

Thanks,
M.Mamedov


Re: [PHP-DB] Database Search Engine ?

2004-02-27 Thread Muhammed Mamedov
I see.
But what if I am using mySQL? 
*by the way, can you tell me from where I get them.

-M.Mamedov

- Original Message - 
From: "Joshua D. Drake" <[EMAIL PROTECTED]>
To: "Muhammed Mamedov" <[EMAIL PROTECTED]>
Cc: "phpdb" <[EMAIL PROTECTED]>
Sent: Thursday, February 26, 2004 12:59 PM
Subject: Re: [PHP-DB] Database Search Engine ?


> Hello,
> 
> I suggest PostgreSQL+TSearch2+OpenFTS...
> 
> 30 minutes to a wonderful search engine.
> 
> On Thu, 26 Feb 2004, Muhammed Mamedov wrote:
> 
> > Anyone knows/uses IMP database search engine?
> > http://www.imptechnology.com/DesktopDefault.aspx?tabid=56
> > 
> > Thanks,
> > M.Mamedov
> > 
> 
> -- 
> Co-Founder
> Command Prompt, Inc.
> The wheel's spinning but the hamster's dead
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

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



[PHP-DB] Re: Creating an autonumber setup

2003-09-09 Thread Muhammed Mamedov
First of all let me tel you that in MySQL you don't have an option to define
your autonumber value format.

You can use this approach which is flexible:

Make users to enter the autonumber format for each of these: Quote,
Project,Customer,Supplier,Invoice

Quote - user entere "Q+" as autonumber for for example. In this case
autonumbers for Quotes will be like Q+1, Q+2...etc.. Of course for each of
these autonumber format you have to use a seperate table to store these user
entered values.

Then each time you add a Quote, you will look at that table in order to
understand the autonumber format of the Quote, and add next autonumber
value(Of course autonumber assigned to quote should be stored in the same
row with the current Quote).

Here is what I mean:

AUTONUMBER_FOFMATS_TABLE
-
ITEM| USERID   |  FORMAT  | AUTONUMBER_ID (autoincrement)
---
Quote  3Q + 1
Project 3P-2
Customer       3
Supplier..
4
Invoice...
...etc
Quote  4Quote #
Project 4Project #

...
...

QUOTE_TABLE
--
QUOTE_ID | USERID |
-
13 (QUOTE FORMAT WILL BE "Q +
somenumber")
24  (QUOTE FORMAT WILL BE "Quote +
somenumber")



Hope this helps.

Sincerely,
Muhammed Mamedov





"Richi Watts" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Hi,

Could someone explain to me how this could be done? I have seen something
similar using Access on a local machine and would like to know if it is
posible to do it in PHP and Mysql
In a project management web based applicaton using PHP and Mysql I would
need to allow the user to create

Quote
Project
Customer
Supplier
Invoice

Each time one of the above will be created it needs to be assigned an
autonumber. So If 3 quotes were created today each quote would receive an
autonumber, maybe something like the fllowing:
yy/MM/dd-01
yy/MM/dd-02
yy/MM/dd-03

Creating the autonumber isn't the problem if I want to have a set way of
numbering, however, is it possible for me to allow the user to enter a setup
page or something and define the way the autonumbers will look like and be
created for quotes, projects, customers, suppliers or invoice.

let's say I have five Project Managers each working with a seperate version
of the app. The app currently sets each new project created with a default
autonumber (let's say yy/MM/dd-01, -02, 03 and so on), however, each Project
Manager wants their database to number new projects differently:

PM1 = yy/MM/dd-a
PM2 = dd/MM/yy-01
PM3=  YY- (Number being the amount of projects this year)
PM4 = PROJ- (Number being the amount of projects ever)
PM5 = P-yyMMdd1

Instead of me creating a different application for each project manager can
I allow them to setup their own number system in a set up page?

Many thanks for any ideas
Richi

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



[PHP-DB] Help on a simple SQL problem

2003-09-10 Thread Muhammed Mamedov
Below I include solutions to your problems.
* now I am in Turkey/Istanbul.. I graduated from a University herebut I
am,myself, citizen of Turkmenistan

Muhammed Mamedov
Software Engineer
YTM.com.tr

- Original Message - 
From: "Ferry CS" <[EMAIL PROTECTED]>
To: "Muhammed Mamedov" <[EMAIL PROTECTED]>
Sent: Wednesday, September 10, 2003 1:56 AM
Subject: the expalinationRe: need help


> Thanks very much for your nice attention.
> I really appreciate that..
>
> Oke, I will expalin more detail...
> For example I use mysql database
> Database = bathroom
> Table = inventory
> Field=item,date,price
>
> mysql> select * from inventory;
> item__date__price
> soap_1/9/03_100
> soap_3/9/03_500
> soap_5/9/03_200
> toothpaste_1/9/031000
>
>
> in php editor the script look like:
>
>  $db_name = "bathroom";
> $table_name = "inventory";
>
> $connection = @mysql_connect("localhost", "", "") or die("Couldn't
> connect.");
>
> $db = @mysql_select_db($db_name, $connection) or die("Couldn't select
> database.");
>
> $sql = "SELECT * FROM $table_name Order by item";
>
> $result = @mysql_query($sql,$connection) or die("Couldn't execute
query.");
>
> //how to write the script here to display result on group with subtotal
and
> grand total

$tmp = mysql_query("select distinct item  from inventory",$connection); //to
select DISTINCT items: soap,toothpaste,etc..

while ($row = mysql_fetch_array($tmp)) {

$it = $row[0]; //will contain one of soap or toothpaste,etc.

$str = " SELECT date,price FROM inventory WHERE item='$it' ";

$tmp2=mysql_query($str,$connection);

 echo "ITEM: ".$row[0]."";  //will write "Item: soap";
 echo "DATEPRICE";

 while($row2 = mysql_fetch_array($tmp2) ) { //here I contain all
occurencies of a certain item
echo $row2[0]."___".$row2[1];
  }

}


>
> //Would you help me with the script (coding)...
>
> ?>
>
> The result that I love to be display look like :
> -
>
> Item: soap
> -
> Date_Price
> 1/9/03100
> 3/9/03500
> 5/9/03200
> Total_800
> ---
>
> Item: toothpaste
> -
> Date_Price
> 1/9/03___1000
> Total1000
> ---
>
> Grand Total__1800
> =
>
>
> Have you understand with my explaination? I hope You will
> By the way, where You from, I mean country & city?
>
> May I guess? I think You from Kazaktan or Ukrain or may be India..
> Am I right? You know, I from Indonesia, South East Asia
>
> Oke, can't wait your reply...& thanks very much
> Wish You always be happy
>
> Best Regards,
> Ferry
>
>
>
>
>
>
> - Original Message -
> From: "Muhammed Mamedov" <[EMAIL PROTECTED]>
> To: "Ferry CS" <[EMAIL PROTECTED]>
> Sent: Thursday, September 11, 2003 12:28 AM
> Subject: Re: need help
>
>
> > Hi Ferry,
> >
> > I couldn't understand your problem exactly. Could you please explain it
in
> > more detail.
> > * By the way if you are asking me to help you with ODBC, want to tell
you
> > that I haven't used it before. I always use Unix based approach with
MySQL
> +
> > PHP .. actually in Windows you can also make the same stuff without
using
> > ODBC.
> >
> >
> > Sincerely,
> > M.Mamedov
> >
> > - Original Message -
> > From: "Ferry CS" <[EMAIL PROTECTED]>
> > To: "Muhammed Mamedov" <[EMAIL PROTECTED]>
> > Sent: Wednesday, September 10, 2003 12:21 AM
> > Subject: need help
> >
> >
> > > Hi Muhammed..
> > >
> > > I knew You from php forum and I see that You great on php and a nice
one
> > > also
> > > My name Ferry from indonesia ..
> > > I have a problem to make report in php
> > >
> > > Connect with ODBC
> > > I like to display report look like
> > >
> > >
> > > -----
> > >
> > > Item: soap
> > > --

[PHP-DB] Re: copy tables between db's

2003-09-10 Thread Muhammed Mamedov
What DBMS are you using? ... Oracle, MySQL or what?
If MySQL then you don't have to make it manual with PHP code (I mean copy
process) .. use something link PhpMyAdmin - there it is very easy to do it.

-- 

Muhammed Mamedov
Software Engineer
YTM.com.tr


"Jeremy" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I need to copy some tables from one mysql database to another mysql
database
> on the same server.
>
> I looked at the php manual and couldn't find it...I found stuff on
> mysqlhotcopy, but it doesn't look like that will do what I need it to do,
or
> maybe I'm reading the manual wrong.
>
> Can someone please show me how to do this? To be specific, it's just a
table
> with a list of US states in it...
> table name: states
> fields: state_id, name, abbreviation
>
> Thanks,
>
> Jeremy

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



[PHP-DB] Re: PHP Oracle connection across page.

2003-09-10 Thread Muhammed Mamedov
eventhough I've never used Oracle with PHP here is my suggestion:

create a file that will have your DB connection strings and include it in
every PHP file which uses Oracle connection.

EXAMPLE:


[dbCon.php] file
[EMAIL PROTECTED]($o_conn_vars["username"], $o_conn_vars["password"],
$o_conn_vars["db"]);

[myPhpFile.php]

include_once("dbCon.php");
//Write youe queries now.
-- 

Muhammed Mamedov
Software Engineer
YTM.com.tr

"Syho" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I have the following problem, please help me.  Many thanks.
>
> Script 1:
> 
> [EMAIL PROTECTED]($o_conn_vars["username"],
$o_conn_vars["password"],
> $o_conn_vars["db"]);
>
> //Parse sql statement
> //Execute sql statement.
> ..
> ...
>
> require('2.inc');
>
> ?>
>

> ___
>
> 2.inc:
>
> // This script will switch the brower to script2.php
>
> 
>
> 
>
>
> 
>
>

> 
>
> script2.php:
>
>
> 
> My problem is, how to get back the Oracle database connection in this
> script?  Please advise.
>
> ?>

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