[PHP-DB] RE : validate 2 password fields

2004-06-30 Thread Neil Smith [MVP, Digital media]
Sorry, my typo, the else line should have read (note the missing brace) return true; } else { alert(Passwords did not match); Please note you need to turn on error reporting for scripts in IE or your chosen browser - doing so would have told you the line which had

[PHP-DB] Re: MySQL: Random select with specific count of a column

2004-06-30 Thread Rui Cunha
Hi Torsten, until now,the best i could get was getting 6 random rows...still working on ensuring to retrive just 2 rows for category...meanwhile,you can solve the problem easily with a php loop trough the following query: select field_id , language , category from yourtable where language =

[PHP-DB] Re: MySQL: Random select with specific count of a column

2004-06-30 Thread Torsten Roehr
Rui Cunha [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi Torsten, until now,the best i could get was getting 6 random rows...still working on ensuring to retrive just 2 rows for category...meanwhile,you can solve the problem easily with a php loop trough the following query:

[PHP-DB] Best table structure

2004-06-30 Thread Tom Chubb
Please can someone let me know their opinion on the following: I have written some code for submitting a top 20 music chart online. I use the following to insert into mysql: INSERT INTO chart (name, chartpos, artist, title, label) VALUES ('$name', '1', '$artist', '$title', '$label'), ('$name',

Re: [PHP-DB] Image Resize

2004-06-30 Thread Neil Smith [MVP, Digital media]
Kenny - you will find there are no native PHP handlers for TIFF. If you're on a unix system you'll be able to use the imagemagick function 'convert' at a command line to do this. Something like this I developed for a client will work, you'll need to look up the passthru function in the PHP

Re: [PHP-DB] Best table structure

2004-06-30 Thread Ruprecht Helms
Tom Chubb wrote: Please can someone let me know their opinion on the following: I have written some code for submitting a top 20 music chart online. I use the following to insert into mysql: your posting is offtopic - you can get more help by asking in the mysql-mailinglist. Regards, Ruprecht

[PHP-DB] Re: [PHP] Best table structure

2004-06-30 Thread Miles Thompson
Tom, For a start, this is off-topic, and you also cross-posted - please don't do so. Have a look at this article: http://dev.mysql.com/tech-resources/articles/intro-to-normalization.html I prefer simpler tables, so I would use the structure you have suggested, with the possible addition of a

[PHP-DB] images in db

2004-06-30 Thread Bobo Wieland
How do you accualty stor jpegs in a mysql db? And what's the pros and cons of storing the whole image in the db and not just the path to the file on the server? It feels to me that it can be a bit difficult to organize the images if they're just placed in a directory on the server. It would be

[PHP-DB] Re: images in db

2004-06-30 Thread Torsten Roehr
Bobo Wieland [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] How do you accualty stor jpegs in a mysql db? And what's the pros and cons of storing the whole image in the db and not just the path to the file on the server? It feels to me that it can be a bit difficult to organize the

[PHP-DB] MySQL_unbuffered_query() and MySQL_free_result()

2004-06-30 Thread dpgirago
Howdy All, If one were to use mysql_unbuffered_query() instead of mysql_query(), are calls to mysql_free_result still needed? or valid? I'm asking because when I make this change in one of my scripts, mysql_free_result throws a warning: 'xxx' is not a valid result resource... The application

[PHP-DB] [slightly OT] OOP syntax

2004-06-30 Thread jeffrey_n_Dyke
I have some procedural code that i'm wanting to convert into classes(and i'm a bit greeen to OOP), hopefully to offer them to the PHP community. I keep all my config data in arrays of arrays, which i'd like to keep when i move to a class model, but can't seem to find out the correct defintion

Re: [PHP-DB] [slightly OT] OOP syntax

2004-06-30 Thread Justin Patrin
On Wed, 30 Jun 2004 14:20:52 -0400, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I have some procedural code that i'm wanting to convert into classes(and i'm a bit greeen to OOP), hopefully to offer them to the PHP community. I keep all my config data in arrays of arrays, which i'd like to

Re: [PHP-DB] [slightly OT] OOP syntax

2004-06-30 Thread dpgirago
Jeff, From my recent readings, and others please correct me here, I think you need to first declare the variables inside the Class, i.e., var $srvr['etime'] = array(); var $srvr['etime']['server']; -- then assign a value to them: var $srvr['etime']['server'] = '27.22.1.5:1433'; In other

Re: [PHP-DB] [slightly OT] OOP syntax

2004-06-30 Thread jeffrey_n_Dyke
On Wed, 30 Jun 2004 14:20:52 -0400, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I have some procedural code that i'm wanting to convert into classes(and i'm a bit greeen to OOP), hopefully to offer them to the PHP community. I keep all my config data in arrays of arrays, which i'd like to

[PHP-DB] addslashes replacement?

2004-06-30 Thread Ed Lazor
I'm using php addslashes to store data into MySQL and php stripslashes when pulling it back out, but I'm running into trouble when people enter HTML code. Do you have any recommendations? Here's an example of what I'm talking about: input name=Title value=?php echo

Re: [PHP-DB] addslashes replacement?

2004-06-30 Thread jeffrey_n_Dyke
I'm using php addslashes to store data into MySQL and php stripslashes when pulling it back out, but I'm running into trouble when people enter HTML code. Do you have any recommendations? Here's an example of what I'm talking about: input name=Title value=?php echo

Re: [PHP-DB] Re: MySQL executes several times the same request

2004-06-30 Thread Randy C Boland
I'm not sure where the value of $counter is coming from, but it you're getting it from a SQL SELECT query, it would be more efficient to just use: UPDATE statistics SET VALUE(`counter` = `counter`+1) It's just one less query on the DB, which could make a difference if you're getting heavy

[PHP-DB] Re: addslashes replacement?

2004-06-30 Thread Kim Steinhaug
Take a look at the php website on the function addslashes. You will find an example with the functions reslash and reslash. You might have some problems regarding magic_quotes. Ive been using the reslash and deslash for some time now without any problems. It might solve your problems. -- Kim

RE: [PHP-DB] Re: addslashes replacement?

2004-06-30 Thread Ed Lazor
Thanks everyone. I ended up using a combination of the htmlspecialchars and the stripslashes commands. The htmlspecialchars function has an example about halfway down that I ended up using. Thanks =) -Original Message- Take a look at the php website on the function addslashes. You

[PHP-DB] Re: MySQL: Random select with specific count of a column

2004-06-30 Thread franciccio
I suggest to first analize the problem and then go through the query, php coding ...etc etc In the table u have only one superkey which is also a key and it is made of the three fields (attributes) 'category', 'language' and ' name'. You should consider to look for a prymary key randomly,

Re: [PHP-DB] [slightly OT] OOP syntax

2004-06-30 Thread Ross Honniball
VERY brief class introduction... class database { function database() { // function with the same name as class is the 'constructor' $this-srvr = array(); // once you declare an array once, no need to declare 'sub' arrays $this-srvr['etime']['server']= '27.22.1.5:1433';

Re: [PHP-DB] Call to undefined function mysql_connect()

2004-06-30 Thread Cole S. Ashcraft
Rinku's Response: I may be missing something, but hows that related? The phpinfo() function generates a page that shows what is installed. See if the configure string has --with-mysql or something like it. There also should be a section called mysql. Take a look at

[PHP-DB] mysql limit

2004-06-30 Thread Bob Lockie
If I select rows with a limit clause I need to know if there are more rows than the limit. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] mysql limit

2004-06-30 Thread John W. Holmes
Bob Lockie wrote: If I select rows with a limit clause I need to know if there are more rows than the limit. Either do a SELECT COUNT(*) prior to your LIMIT query to see how many total rows there are, or use SQL_CALC_FOUND_ROWS and FOUND_ROWS() (more info here:

[PHP-DB] $cookie error

2004-06-30 Thread Sukanto Kho
Hi All, I'm using $_session to store user name and status and the session is used as key to access some pages and I set the cookie variables like this : setcookie (name,$user_name, $time+3600); setcookie (status,$status, $time+3600); and the authentication of the session variable like

Re: [PHP-DB] $cookie error

2004-06-30 Thread John W. Holmes
Sukanto Kho wrote: I'm using $_session to store user name and status and the session is used as key to access some pages and I set the cookie variables like this : setcookie (name,$user_name, $time+3600); setcookie (status,$status, $time+3600); and the authentication of the session variable

[PHP-DB] Multiple word queries

2004-06-30 Thread Shiloh Madsen
I'm trying to set up a page that will take a search from a previous pages form and make a query of a keywords table using that data. Eventually I will try to do some more elaborate things like adding the ability to group phrases together and use boolean searching, but for right now the

Re: [PHP-DB] $cookie error

2004-06-30 Thread Sukanto Kho
sorry, I was wrong ... all the $session in my previous post should be $cookie... (I typed the wrong word) I think the domain is not the one that cause the problem... remember that I refer to the same page (but sometimes success and the other time it's fail) What did u mean by unless you use the

Re: [PHP-DB] Multiple word queries

2004-06-30 Thread John W. Holmes
Shiloh Madsen wrote: say someone enters a search string of cat dog mouse rabbit (without the qoutes) into my search box. What I need for the results page to do is to construct a query that will search through my keywords table for every instance of ANY of those words. How would you suggest I

Re: [PHP-DB] $cookie error

2004-06-30 Thread John W. Holmes
Sukanto Kho wrote: sorry, I was wrong ... all the $session in my previous post should be $cookie... (I typed the wrong word) I think the domain is not the one that cause the problem... remember that I refer to the same page (but sometimes success and the other time it's fail) What did u mean by

Re: [PHP-DB] Multiple word queries

2004-06-30 Thread Randy C Boland
By Shiloh's description, I think you want to replace AND with OR - using AND will only return rows that contains every word, while using OR will match any row that has any of them. On Wed, 30 Jun 2004 23:22:04 -0400, John W. Holmes [EMAIL PROTECTED] wrote: For that simple example, you can just

[PHP-DB] perfornance with POST or db check ??

2004-06-30 Thread Michael Gale
Hello, I have form that a user updates, it contains 5 html select boxes. The page loads and dynamically populates the select boxes with data from the database. Now the user can change any value of any select and hit Update now all the changes are applied to the database to reflect that

Re: [PHP-DB] perfornance with POST or db check ??

2004-06-30 Thread John W. Holmes
Michael Gale wrote: The question I have it .. on three of the select boxes .. if the data is changed I require a extra function to get run. So for example if the owner value is changed I want to send a e-mail to the new owner. For performance should I just pass a hidden value with the original