Re: [PHP-DB] Checking if number is in bottom three?

2002-12-23 Thread Doug Thompson
Generally, you want to use the LIMIT function. SELECT num FROM myfile ORDER BY num LIMIT 3; However, if the values may be repeated (e.g., 1,1,1,2,4,4,5), the query above will return 1,1,1. If you are interested in the three lowest values and not just smallest entries, add DISTINCT SELECT

Re: [PHP-DB] PHP and MySQL

2002-12-25 Thread Doug Thompson
The simplest solution is to edit php.ini on your Linux box and set the parameter register_globals to ON. As of PHP4.2.0 the default setting is OFF and new super globals are available. A better solution is to update your windows box to the same version of PHP so that you are programming to the

Re: [PHP-DB] php and mysql on RH8.0

2002-12-29 Thread Doug Thompson
1. Is mysqld running? I don't remember if the default configuration for RH8.0 sets it to start on system boot. The easy way to check is: ps aux | grep mysql or mysqladmin -u root ping will return MySQL is alive if the server is running. 2. See chapter 2.4 of the MySQL

RE: [PHP-DB] php variables to JS

2003-01-05 Thread Doug Thompson
OK. I consider this an easier way. I use it to display fullsize images when a thumbdnail is clicked. Same principle. From head script var pixNum=,winName=, mheight=, mwidth= var pixURL=http://**someURL**/; function viewPix(pixNum,winName,mheight,mwidth) { win =

Re: [PHP-DB] If select query doesn't net any results

2003-01-09 Thread Doug Thompson
... if ($result) { while ($row... ... } $result will be 0 (false) if nothing satisfies the query. Any other comparison is just extra typing with no improvement in logic. Regards, Doug On Thu, 09 Jan 2003 13:06:51 -0500, Michael Cortes wrote: I am a programming novice

Re: [PHP-DB] db connect probs

2003-01-15 Thread Doug Thompson
MySQL cannot find the username in its grant tables. The error message very clearly states that there is no user named 'x,@host' which is the value of your $user variable. For your example, $email == 'x' and $femail == '@host'. The comma is included because it is part of the literal string,

Re: [PHP-DB] Secure variable transport (newbie)

2003-01-23 Thread Doug Thompson
Here is a link to a tutorial which explains the issues and introduces how to use the new global variables. Write Secure Scripts with PHP 4.2! Regards, Doug On Thu, 23 Jan 2003 00:30:24 +0100, Karina S wrote: Hi, I have read, that use global variables

Re: [PHP-DB] update

2003-02-04 Thread Doug Thompson
UPDATE is for changing values in existing rows. It appears you want to add new information. Use INSERT. $query= INSERT tablename SET (username, email, location) VALUES( $username, $email, $location); Note that a WHERE condition is incorrect for INSERT. Your UPDATE syntax is not correct either.

Re: [PHP-DB] update

2003-02-04 Thread Doug Thompson
clause, see the INSERT table SELECT ... syntax. Extremely convenient. You inherit all the flexibility of the SELECT statement. Ignatius - Original Message - From: Doug Thompson [EMAIL PROTECTED] To: Ike Austin [EMAIL PROTECTED]; [EMAIL PROTECTED

Re: [PHP-DB] Remnant data from previous queries when using mysql_fetch_array...

2003-02-06 Thread Doug Thompson
Try getting the results from the query like the following. Doug // generate and execute query $query = select * from changelog where changedBy = '$changedBy' or vendorNumber = '$vendorNumber' or oldName like '$oldName' or newName like '$newName' or newVendorNumber = '$newVendorNumber'; $result

Re: [PHP-DB] Remnant data from previous queries when using mysql_fetch_array...

2003-02-06 Thread Doug Thompson
On Thu, 06 Feb 2003 10:33:23 -0700, Doug Thompson wrote: Try getting the results from the query like the following. -snip- With the correct syntax. 8-( Doh! // $numrows = mysql_num_rows ($result); ^ -- PHP Database Mailing List (http

Re: [PHP-DB] sorting values

2003-02-10 Thread Doug Thompson
Merlin: You might find it easiest to CREATE a temporary table. You can use an INSERT .. SELECT query to extract the values from your data tables and insert them in the temp table. Then you can SELECT from the temporary table and use all of the SQL functions for ordering, grouping, etc. Doug On

Re: [PHP-DB] question about access

2003-02-10 Thread Doug Thompson
If your client's friend wants to do learning/development, let him load PHPTriad, FoxServ, or one of the other trinity setups onto his computer. It is truly remarkable that you/your company would even consider such a request for longer than it takes to say: Never in a million years. Also, if I

Re: [PHP-DB] Question about replacing large textfields

2003-02-14 Thread Doug Thompson One example: Good luck, Doug On Fri, 14 Feb 2003 16:09:34 +0100, Ingen, Wart van wrote: Hi there, I'm looking for a way to let people without any knowledge of coding replace large fields of text and images on their

Re: [PHP-DB]

2003-02-18 Thread Doug Thompson
Nikos: The mysql.sock file is created by mysqld when it is running. The error you report is very common and you will find troubleshooting tips at: Doug On Tue, 18 Feb 2003 10:18:42 +0200, nikos wrote: GlacierHi List I run mysql 3,23..

Re: [PHP-DB] Random not working?

2003-03-01 Thread Doug Thompson
This recent thread from the mysql list explains a lot about the problem. hth, Doug On Sat, 1 Mar 2003 12:24:57 +0100, Frank Keessen wrote: Hi All, I'm trying to get a random record each time this script runs; Only it's giving me everytime

Re: [PHP-DB] Re: sorting results in PHP

2003-03-18 Thread Doug Thompson
Without knowing your query, it is hard to say whether mysql can return the results you want. However, you can GROUP BY and SORT BY multiple columns in a single query. The following simple query returns a subset of property owners grouped by lastname, alpabetized by group, and ordered by

Re: [PHP-DB] multiple connections to MySQL in a single script example

2003-03-30 Thread Doug Thompson
You will use the mysql_select_db() function. It sets the currently active database. You will call this function each time you wish to change which database is being used prior to issuing a query. You need to open only one connection as long as the databases are on the same server. If you

Re: [PHP-DB] Re: [PHP] mysl_connect question

2003-04-05 Thread Doug Thompson
The access denied message you are seeing is usually the result of either an incorrect password or username, but you don't give enough information to allow guessing beyond that. Are you certain your script is submitting the expected values? Doug On Sat, 05 Apr 2003 21:54:33 -0600, [EMAIL

RE: [PHP-DB] Can't do anything with variables

2003-04-06 Thread Doug Thompson
Unlike Luke, I'm not familiar with this book. However, it's a pretty safe bet that it was written prior to the first version of PHP that defaulted register_globals to OFF. All of your variables for the second page will be found in the global array $_POST[] because the method for the form on

Re: [PHP-DB] HELP, Still not be able to connect to MySQL

2003-06-12 Thread Doug Thompson
Your IP users have no permissions. (Hint: N = No) How is this a PHP problem? (Hint: It is all over the mysql list archives.) Doug On Thu, 12 Jun 2003 13:35:21 +0300, nabil wrote: GUYS help me please. 1- mysql server in on my own machine.. 2- my machine IP is 3- when i tired to

Re: [PHP-DB] Select statement drops 10th digit during table lookup?

2003-06-13 Thread Doug Thompson
Why not use the built-in conversion functions in mysql? From the manual: quote INET_NTOA(expr) Given a numeric network address (4 or 8 byte), returns the dotted-quad representation of the address as a string: mysql SELECT INET_NTOA(3520061480); - INET_ATON(expr) Given

Re: [PHP-DB] Adding MySQL support to PHP - version problem

2003-06-15 Thread Doug Thompson
This is in the archives, but it was faster to find it in my stack of saved stuff: quote For those who installed RH 8.0 and went threw the same php/mysql woes you just have to go to And install the 8.0.5 (psyche?) or 8.0.7 php-mysql

Re: [PHP-DB] Adding MySQL support to PHP - version problem

2003-06-15 Thread Doug Thompson
So look a little farther down the list and try the RPM for RH9.0. On Mon, 16 Jun 2003 00:05:19 -0400, Jack Orenstein wrote: Doug Thompson wrote: This is in the archives, but it was faster to find it in my stack of saved stuff: quote For those who installed RH 8.0 and went threw the same php

Re: [PHP-DB] PHP Install conflicts w/ MySQL

2003-06-16 Thread Doug Thompson
Check that mysql is still the owner of its subdirectories. You might also look on the mysql list for other possibilities as this is a frequent topic. Doug On 17 Jun 2003 10:02:29 +0800, Ramil G. Sagum wrote: On Tue, 2003-06-17 at 03:08, Nathan wrote: # ./bin/mysqld_safe Starting mysqld

Re: [PHP-DB] connect to db with php?

2003-06-21 Thread Doug Thompson
1. The default user table sets up root with no password. Leave out the password and it will probably connect OK. You really need to fix the user table, but as long as the system isn't accessible from outside, you can get by. 2. You don't need to use host, in this case, when

Re: [PHP-DB] Rand() Emulation

2003-06-24 Thread Doug Thompson
An incredible interpretation of quote If called without the optional min, max arguments rand() returns a pseudo-random value between 0 and RAND_MAX. If you want a random number between 5 and 15 (inclusive), for example, use rand (5, 15). /quote Doug On Tue, 24 Jun 2003 11:14:55 -0400,

Re: [PHP-DB] generating sequence without AUTO_INCREMENT

2003-06-26 Thread Doug Thompson
Maybe it's because I'm not fully awake yet that the problem seems less complex than it is. What is wrong with using a seperate table for each year? Doug On Thu, 26 Jun 2003 08:43:17 +0200, anders thoresson wrote: Hi, I'm working on a web based article planning system for a news paper, based

Re: [PHP-DB] MySQL full text search

2003-07-18 Thread Doug Thompson
Full text searches only work against fulltext indexes. This isn't a PHP issue. Doug On Fri, 18 Jul 2003 09:42:17 +0200, Angelo Zanetti wrote: Hi I have a table which contains 3 fields (ID, Title, Abstract) the title and abstract fields have

Re: [PHP-DB] Regular Expressions? URGENT

2003-08-01 Thread Doug Thompson
Try one of these: Doug On Fri, 1 Aug 2003 11:34:16 -0400, Aaron Wolski wrote: Hi All, Sorry for OT post but need some info. Does anyone know a good tutorial that explains regular

Re: [PHP-DB] query works fine on console but not with PHP - why?

2003-08-03 Thread Doug Thompson
You have an error in your PHP code, just as the error says. Including only the query, which you've already tested, isn't very helpful. The error message is telling you that the result link identifier used in your fetch statement isn't the same as returned by the query statement OR there was an

Re: [PHP-DB] % operator

2003-08-12 Thread Doug Thompson
One day I'll learn to wait until two cups of coffee before attempting to post replies. On top of which, I have no idea where 0.8 came from. 8-/ Sorry for the confusion factor. Doug On Tue, 12 Aug 2003 10:47:21 +0100, Phil Driscoll wrote: On Tuesday 12 August 2003 10:39 am, Phil Driscoll

Re: [PHP-DB] % operator

2003-08-14 Thread Doug Thompson
The % is called the Modulus operator. It is very briefly explained in the PHP manual in table 11-2. In your example, $mod = $a % $b == $mod = 0.8 It is a very easy operator to use. Doug On Tue, 12 Aug 2003 11:04:39 +0200, Alain Barthélemy wrote: Hello, If you have $a = 24; $b = 5; and

Re: [PHP-DB] To slash or not to slash....

2003-09-03 Thread Doug Thompson
On Tue, 2 Sep 2003 16:45:28 +0100, Craig Cameron wrote: Ok simple problem I hope. Have the following code, used to store the location and a few details about meeting minutes. snip $connection = mssql_connect(server,user,password);

Re: [PHP-DB] Re: php/mysql weblog - addnews function problems

2004-02-18 Thread Doug Thompson
On Wed, 18 Feb 2004 09:35:22 -, Slippyaah wrote: Well basically I think it's a problem with the declaration of variables and/or the way they are being processed by the form. Here is the individual addNews function: function addNews() { global $db; /* declare variables here?

Re: [PHP-DB] Q

2004-02-22 Thread Doug Thompson
On Sun, 22 Feb 2004 11:02:29 EST, [EMAIL PROTECTED] wrote: Dear friends, I have pap4, mysql, apache installed. How do I enable to access /$_SERVER[PHP_SELF]/ .Comments, please Correct your syntax errors: \$_SERVER['PHP_SELF']\ Doug -- PHP Database Mailing List ( To

Re: [PHP-DB] SQL File Import problem (Was: HELP!!!)

2004-02-26 Thread Doug Thompson
On Fri, 27 Feb 2004 01:16:20 +0100, Erwin Kerk wrote: Robin 'Sparky' Kopetzky wrote: Good afternoon! I used SQLYOG to export the tables and data from a Mysql database. Now, when i try to re-import the data back into a different database, I get an error stating Error : MySQL server has gone


2004-03-01 Thread Doug Thompson
On Mon, 1 Mar 2004 17:16:01 -0800 (PST), Mike Ni wrote: Hey everyone, Does anyone outhere is running Apache/Linux/PHP/Mysql? I am having hard time with MYSQL PHP API. Apache/PHP simply would not recognize any cmysql function call such as mysql_connect. I have recompile the php with mysql

Re: [PHP-DB] Password encryption

2004-03-04 Thread Doug Thompson
On Thu, 04 Mar 2004 12:46:51 -0600, Mignon Hunter wrote: Can anyone recommend, or does anyone have handy, a script that will encrypt passwords AND then also be able to retrieve the encrypted password. Checking out the docs and some books has confused me mostly. Thx Yes and no. $pw =

Re: [PHP-DB] Password encryption

2004-03-04 Thread Doug Thompson
It is a string function that returns a 32-character md5 hash of password. MD5 is the name for a current RSA Message Digest Algorithm encryption method. A search in the manual for md5 gets you to the little bit of information in the manual plus a link to RFC 1321 which likely provides more

Re: [PHP-DB] How to calculate size of INT(x) field

2004-03-05 Thread Doug Thompson
Richard, Why do you exclude the MySQL Manual from your list of references? See sections 6.2 and 6.2.1. In 6.2.1, you will find: quote Another extension is supported by MySQL for optionally specifying the display width of an integer value in parentheses following the base keyword for the type

Re: [PHP-DB] Re: How to calculate size of INT(x) field

2004-03-05 Thread Doug Thompson
On Fri, 5 Mar 2004 16:45:12 -0500, Chris Ruprecht wrote: On Friday 05 March 2004 06:36, Kae Verens wrote: Richard Davey wrote: Hi all, Sorry for such a newbie question! But I have been digging through the O'Reilly MySQL book + MySQL Cookbook and cannot find an answer to what I think is

Re: [PHP-DB] Pulldown value not passed to next page

2004-03-11 Thread Doug Thompson
Hi Karen, Depending upon the method used for your form, you should be able to find the value in either $_GET['pagesize'] or $_POST['pagesize']. hth, Doug Karen Resplendo wrote: What is wrong with this picture? I build a pulldown for selecting page size(number of rows in one page). If page is

Re: [PHP-DB] tick mark `

2004-03-22 Thread Doug Thompson
Craig: I don't see a reply to your question in today's posts. Backticks or tick marks allow you to use reserved words for column names. Interval is a reserved word. Hope you weren't waiting this long for a response. Doug Thompson Craig Hoffman wrote: Why is it when I have this ` tick mark

Re: [PHP-DB] Strange problem with mySQL

2004-03-25 Thread Doug Thompson
Brown, Craig wrote: I am trying to update a database that I use to store user names and the hashed values of passwords. The database name is Login, the table is users. I have the following commands in my php file. @ $db=mysql_pconnect('localhost','apache','password');

Re: spam: [PHP-DB] php, mysql security question

2004-03-31 Thread Doug Thompson
JeRRy wrote: Hi, I have a php, mysql security question. You know how there is a way to enable/disable hot linking to your images via CPanel to allow/disallow people to link to your images from an external site? Well is there a way to allow/disable external sites connecting to a mysql via

[Fwd: Re: [PHP-DB] php, mysql security question]

2004-03-31 Thread Doug Thompson
Oops. For some reason my filter concluded your email was spam and it modifies the subject line. I missed cleaning the subject line on the first reply. Here is is again in case others filter on that keyword. I apologize for the double post and possible confusion. \Doug JeRRy wrote: Hi, I

Re: [PHP-DB] Can't access HTTP Post Array

2004-04-10 Thread Doug Thompson
[EMAIL PROTECTED] wrote: I'm running Apache/2.0.49 and PHP/4.3.5 on windows XP with MSIE 6.0. -- local host. When I try to access the variables in the array (HTTP POST), they are empty or null. Did I miss a PHP or Apache setting in the php.ini or httpd.conf? Use$_POST['array_element'] Doug

Re: [PHP-DB] Handling missing rows on joins

2004-04-21 Thread Doug Thompson
-{ Rene Brehmer }- wrote: Working with PHP 4.3.0 and MySQL 4.0.14 (but code MUST be compatible with 3.23.56). For my forums, I've got this 4-way join to load (and output) the posts with info on the poster: $fullthread = SELECT

Re: [PHP-DB] supernoob strikes again

2004-05-09 Thread Doug Thompson
Dan Bowkley wrote: got it...rather than return false, mysql_result throws an error if the query returns nothing. What a pain. NOT True. If the query is syntactically valid and nothing matches, mysql returns zero rows which is not an error, at least on the part of the dbms. Use mysql_num_rows()

Re: [PHP-DB] PostgreSQL lib and character case

2004-04-28 Thread Doug Thompson
Tumurbaatar S. wrote: I use pg_fetch_array() to get a record content. But it seems that to access elements of the returned associative array, I should use lowercase field names. Is there any way to use case-insensitive field names? Assuming you want all lower case, convert the form field entry

Re: [PHP-DB] Getting a result from MAX() query

2004-07-13 Thread Doug Thompson
[EMAIL PROTECTED] wrote: Would somebody be kind enough to explain why this query produces a false result $latest=mysql_query(SELECT MAX(fee_recd) FROM members,$connectup)or die (Query failed:br$latestbrError: . mysql_error()); but this one doesn't $latest=mysql_query(SELECT fee_recd FROM members

Re: [PHP-DB] Case sensitive search

2004-07-18 Thread Doug Thompson
Rosen wrote: Hi, I have a simple table: test ( id int unsigned NOT NULL auto_increment, data varchar(30) default NULL, PRIMARY KEY (id)) with two simple records: id data 1 a 2 A When I perform select * from test where data='a' - it return me both rows.

Re: [PHP-DB] Php if statement in a form

2004-08-05 Thread Doug Thompson
if (is_null($row[timeout]).) [EMAIL PROTECTED] wrote: Still no joy. The parse error actually refers to the -- if ($row[timeout] IS NULL); --- line. -Original Message- From: Eric Schwartz [mailto:[EMAIL PROTECTED] Sent: Friday, 6 August 2004 11:32 AM To: [EMAIL PROTECTED] Subject: Re:

Re: [PHP-DB] MySQL denying access to...everything

2004-08-18 Thread Doug Thompson
[EMAIL PROTECTED] wrote: I finally got my PHP5 installation to support MySQL and now this. When I try to edit anything on mysqlgui.exe, it just gives me this error: error in database function: access denied for user @localhost... I don't know if this has to do with my php installation or what.

Re: [PHP-DB] Q

2004-08-22 Thread Doug Thompson
[EMAIL PROTECTED] wrote: Dear Friends, Data in the table is displayed by php query. .Say column A, in which name of company will be stored. Now i want to add another column B to table in which web addresse will be stored against each name in Column B.and same should be displayed in an html

Re: [PHP-DB] mysql results with limit

2004-09-04 Thread Doug Thompson
Michael Gale wrote: Hello, Right now I have a mysql select statement with the LIMIT option of 500. Is there a way to find what the total number of selected results would of been with out doing a mysql select first with out the limi and using mysql_num_rows ? Thanks You could use

Re: [PHP-DB] where can I post some mysql related questions?

2004-09-19 Thread Doug Thompson
Mike wrote: hi, I've currently been looking for a mysql news server where I could post some questions on mysql database design (cause they shurely wouldn't fit here) and I have yet to find one. Can anyone help? -- PHP Database Mailing List ( To

Re: [PHP-DB] MultSelect ListBox hell!

2004-09-22 Thread Doug Thompson
Stuart Felenstein wrote: I am in the process of building a search form for the database. The entire thing consists of 3 multi selects and 2 text boxes with a contains. Oh and I've only rigged 2 of the multi selects for the time being. So the way the multiselects should work that the user can

Re: [PHP-DB] parse error in php backend sqlite

2004-10-20 Thread Doug Thompson
Aravalli Sai wrote: hi this is php code for inventory management system which is done using SQLite.this is an user interface where an user wil giv values to the text boxes and it should be saved in the backend database which is sqlite.. but when i run this code on browser it is giving an

Re: [PHP-DB] Problems with mysql_num-rows()

2004-10-31 Thread Doug Thompson
The variables are not being expanded. As a minimum, you need to escape the single quotes. $query = SELECT * from user where name=\'$userid\' and pass=password(\'$password\') Alternatively, you can concatenate the expanded variables. $query = SELECT * from user where name='.$userid.' and

Re: [PHP-DB] MySQL problem..

2004-11-08 Thread Doug Thompson
ian wrote: Any body met this error? Warning: mysql_connect(): Client does not support authentication protocol requested by server; consider upgrading MySQL client in /usr/local/apache2/html/poems/browse.php on line 15 -- PHP Database Mailing List

Re: [PHP-DB] php newsletter with mysql data

2004-11-22 Thread Doug Thompson
Bishnu Prasad Dahal wrote: Dear all, I have to create a newsletter for a site , I didn't code for any newsletter. could you suggest me how can I design the newsletter? And please send me sample php codes for newsletter Thanks, Hame I suggest you take a look at

Re: [PHP-DB] searching an entry in inventory db

2004-12-04 Thread Doug Thompson
Aravalli Sai wrote: hi i had designed an inventory management system where in i can ADD,INSERT,DELETE,UPDATE the data elements..but when i am trying to find(search) an entry in theinventory data base system (i want to find the entrybased on the tagno since this is the primary key in my table)

Re: [PHP-DB] select particular columns in query

2004-12-08 Thread Doug Thompson
The manual is your friend. You cannot execute the SQL statement you provided because mysql specifically disallows it: Same reference, your presumption about auto-increment columns is also wrong. Doug blackwater dev wrote: Hello, I want to

Re: [PHP-DB] List Active??

2004-12-29 Thread Doug Thompson
Dave, The list has been very active with many posts per day all week. Based on your domain, you might check with the sysops and see if they've done any updating to firewalls and/or corporate filters. Good luck, Doug [EMAIL PROTECTED] wrote: Just testing the list mail server as I haven't received

Re: [PHP-DB] MySQL version issue

2005-01-04 Thread Doug Thompson
It seems to me that the _mysql manual_ gives a most straightforward and useful explanation: If you specify the ON DUPLICATE KEY UPDATE clause (new in MySQL 4.1.0), and a row is inserted that would cause a duplicate value in a UNIQUE index or PRIMARY KEY, an UPDATE of the old row is performed.

Re: [PHP-DB] Re: MySQL version issue

2005-01-05 Thread Doug Thompson
I isn't my intention to start a peeing contest, but if *you* get rid of the chip and actually read the manual excerpt, the equivalent SQL statements it cites are very definitely available in mysql 3.xx.xx. DT Mark Benson wrote: Doug, read my e-mail again, specifically the second and third

Re: [PHP-DB] Integrating and PHP

2005-01-15 Thread Doug Thompson
Todd Cary wrote: I have compiled, but even though I have in the php.ini file, it is not part of PHP. Has anyone had success doing this? Todd A quick peek at the list archives (search revealed this:

Re: [PHP-DB] Given only one mySQL user account by Host Company

2005-01-23 Thread Doug Thompson
Simple _complete_ solution: Find a different hosting company that provides a virtual server and root access to everything about your account. Cost should be nominal, but probably not free. Simple _partial_ solution: Use INCLUDEs for the login portions of the script(s) and place them in a

Re: [PHP-DB] Given only one mySQL user account by Host Company

2005-01-23 Thread Doug Thompson
Shay wrote: Yes they gave me phpMyAdmin to use, and no, I have no access to the user/privilege table. So the only way to output database entries is to connect with the single super account they gave me. Principally, this means you cannot allocate user accounts for mysql. No big deal unless

Re: [PHP-DB] Given only one mySQL user account by Host Company

2005-01-23 Thread Doug Thompson
/grant privileges via straight sql thur the PMA sql window? ie grant select, insert, update to 'bob'@'localhost' on mysql.users indentified by password('my_pass'); bastien From: Doug Thompson [EMAIL PROTECTED] To: Shay [EMAIL PROTECTED] CC: Subject: Re: [PHP-DB] Given only one