RE: [PHP] MySQL Query Help

2010-11-21 Thread Ben Miller
is joined to p. So swap em around if I misunderstood. iPhone 4. It rocks! On Nov 21, 2010, at 1:37 AM, Simcha Younger sim...@syounger.com wrote: On Sat, 20 Nov 2010 13:54:29 -0700 Ben Miller biprel...@gmail.com wrote: Hi, I'm building a website for a client in which I need to compare

[PHP] MySQL Query Help

2010-11-20 Thread Ben Miller
DISTINCT(criteria_id) and then run through each $selected_product to make sure each has a criteria_value with a matching criteria_id, eliminating any criteria where the number of criteria_values count($selected_product), but this seems pretty inefficient. Thanks in advance for any help. Ben Miller

[PHP] Password protected directory

2010-11-02 Thread Ben Miller
I need to access and read the files in a password protected directory with a PHP script using the readdir function. I'm already making users login to a secure area, so I don't want to make them enter a password again to access the files - is there a way to include the password with the

[PHP] SELECT AVG(rating)

2010-07-02 Thread Ben Miller
Hi - I have a MySQL table full of product reviews and I'm trying to select info for only the top 5 rated products. The only way I can figure out how to do it so far is something like: $query1 = mysql_query(SELECT * FROM products); for($i=1;$i=mysql_num_rows($query1);$i++) { $row1 =

RE: [PHP] SELECT AVG(rating)

2010-07-02 Thread Ben Miller
-Original Message- From: Ashley Sheridan [mailto:a...@ashleysheridan.co.uk] Sent: Friday, July 02, 2010 2:43 PM To: b...@tottd.com Cc: php-general@lists.php.net Subject: Re: [PHP] SELECT AVG(rating) On Fri, 2010-07-02 at 14:32 -0600, Ben Miller wrote: Hi - I have a MySQL table full

[PHP] FTP Site

2010-02-16 Thread Ben Miller
Hi, I'm building a site for a client that has a need to allow their users to upload large files (up to 100mb or more) and store them on the server. I've never had a need to work with PHP's FTP functions until now and, before I go reading the manual to learn how, I wanted to see if this

[PHP] Sessions across subdomains

2010-01-29 Thread Ben Miller
Hi, I've always thought that session data was subdomain specific and would not carry over between http://www.mydomain.com and https://secure.mydomain.com, but it seems to be working for me now. Can I rely on this and post from http://www.mydomain.com to https://secure.mydomain.com and simply pass

[PHP] http vs https

2010-01-23 Thread Ben Miller
Is there a PHP function that will return whether the request was http or https? I have functions that need to cURL other servers - sometimes over SSL, sometimes not, depending whether the function is called from http://www.mydomain.com/script_that_calls_function.php or

[PHP] MySQL Increment/Decrement

2009-12-28 Thread Ben Miller
I hope this isn't a bone-head question - Is there a MySQL query that will increment/decrement the value in an integer column with a single query - in other words, I don't have to run a SELECT query to get the value, add/subtract to/from the value, and then run an UPDATE query to store the new

[PHP] Backup to local drive

2009-12-11 Thread Ben Miller
Hello - I have an application I'm building that allows users to store personal information and files (images, PDFs, etc.) in our database, but I need a way for them to be able to save the HTML output of that personal data to a local (for the user) flash drive. I'm guessing I'm going to need a

RE: [PHP] Backup to local drive

2009-12-11 Thread Ben Miller
their drive into a USB port and present the info on the road, regardless of connection to the internet. Ben -Original Message- From: Roberto [mailto:prof...@gmail.com] Sent: Friday, December 11, 2009 11:58 AM To: Ben Miller Cc: php-general@lists.php.net Subject: Re: [PHP] Backup to local drive Hi

RE: [PHP] Backup to local drive

2009-12-11 Thread Ben Miller
a) (preferred) run the presentation via an autoplay command or b) open the presentation.html file. Ben From: Ashley Sheridan [mailto:a...@ashleysheridan.co.uk] Sent: Friday, December 11, 2009 2:25 PM To: Ben Miller Cc: 'Roberto'; php-general@lists.php.net Subject: RE: [PHP] Backup to local

RE: [PHP] Backup to local drive

2009-12-11 Thread Ben Miller
, December 11, 2009 2:39 PM To: Ben Miller Cc: 'Roberto'; php-general@lists.php.net Subject: RE: [PHP] Backup to local drive On Fri, 2009-12-11 at 14:36 -0700, Ben Miller wrote: Too much reliance on the user knowing how to extract the files to the flash drive – need something that does it all

[PHP] Case Insensativity in String Comparisons

2009-08-25 Thread Ben Miller
Is there a simple to way to compare two strings with case insensitivity so that the following will return true? $foo = Arnold; $bar = arnold; If($foo == $bar) { } Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Single Quotes in Form Inputs

2009-07-27 Thread Ben Miller
INTO customers (`cust_first`,`cust_last`) VALUES ('$firstName','$lastName')); Ben Miller

[PHP] preg_replace

2009-06-05 Thread Ben Miller
I bought PHP MySQL for DUMMIES and it shows me how to use special characters for pattern matching and I've figured out the basics of using preg_replace to replace pattern matches. What I am having trouble with, though, is figuring out how to replace anything that does not match the pattern.

RE: [PHP] preg_replace

2009-06-05 Thread Ben Miller
Oh yeah - not sure if spaces are considered alphanumeric or not, but I need to keep spaces - replacing anything that is NOT a letter, a number or a space. Thanks again. -Original Message- From: Ben Miller [mailto:biprel...@gmail.com] Sent: Friday, June 05, 2009 2:09 AM To: php-general

[PHP] Failed MySQL queries

2006-04-05 Thread Ben Miller
Rather than using the following, which simply displays a white screen with the die message, is there a way to add the die message to the body of the original form page, such as in a variable, so that I can display the message on the original form page with all the values already filled out, so

[PHP] Letters in Loops

2006-03-23 Thread Ben Miller
In trying to make an alpha list, using the following: for($i=A;$i=Z;$i++) { echo $i; } Produces: A B C... X Y Z AA AB AC... AX AY AZ... all the way to YZ. What am I doing wrong that it's not stopping at just plain old Z, without moving on to AA and continuing? -- PHP General Mailing

[PHP] Floored!

2006-02-23 Thread Ben Miller
If anyone has an answer for this, I would be greatly appreciative. I was trying to compare two values, the first is the total cost of products to be refunded, and the second is the original order total. To the naked eye, they both were coming out as 102.85, yet an if($Refund_Amount

[PHP] Determining number of days in a selected month

2006-01-19 Thread Ben Miller
Is there a way to easily tell PHP how many days there are in a selected month without writing the following out for each month: if($Month == January) { $NumberOfDays = 31; } elseif($Month == February) { if($Year == A Leap Year) { $NumberOfDays = 29; }

[PHP] Pages Expiring

2006-01-05 Thread Ben Miller
When using forms with PHP sessions, hitting the back button results in WARNING: Page has Expired I am wondering if there is a work around for this so that it (IE, in this case) resubmits the form information and displays the previous page. Any ideas? -- PHP General Mailing List

[PHP] Counting in Hex

2006-01-04 Thread Ben Miller
Is there a way in PHP to count using hex instead of numerals so that the following statement $var = 237F; $var++; echo $var; would result in 2380 Thanks a bunch. Ben -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] Counting in Hex

2006-01-04 Thread Ben Miller
Never mind - wasn't adding properly. Found it after all on php.net, anyway. Thanks anyway. -Original Message- From: Ben Miller [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 04, 2006 5:01 PM To: php-general@lists.php.net Subject: [PHP] Counting in Hex Is there a way in PHP to count

[PHP] Arrays

2005-12-06 Thread Ben Miller
If I have an array, such as $Var[0] = Dog; $Var[1] = Cat; $Var[2] = Horse; Is there a way to quickly check to see if $Var contains Lion without walking through each value? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Cookies

2005-11-17 Thread Ben Miller
Is there a way to test if a user has cookies turned on or not so that I can use cookies if the user allows them and use the URL if the user does not allow them? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] Cookies

2005-11-17 Thread Ben Miller
Hi Ben, Thursday, November 17, 2005, 3:26:04 PM, you wrote: Is there a way to test if a user has cookies turned on or not so that I can use cookies if the user allows them and use the URL if the user does not allow them? Set one? :) Then check if it exists or not. This of course will not

[PHP] Sending arrays from page to page

2005-11-15 Thread Ben Miller
I am trying to learn how to work with arrays, and have the basic concept down for working within a single page, but I am having trouble sending an array from one page to another. For example, I can send a variable from page to page using either the URL, such as www.domain.com/?foo=bar, or using a

[PHP] Removing non-numbers

2005-02-14 Thread Ben Miller
OK - easy one here, I know. Having troubles removing anything that is not a number from user input. According to manual, [!] is supposed to mean set of non-matching optional characters. Tried $var = ereg_replace([!0-9],,$var); and it removes the numbers, but so does $var =

[PHP] Column Totals

2004-11-15 Thread Ben Miller
I am trying to get the total sales revenue for each day of the month, and having no luck at all. The following query seems to return an empty string, which should only give me the total for the entire column anyway. $query = SELECT SUM(Revenue) FROM Sales WHERE Date='$Date'; I also tried, among

RE: [PHP] Column Totals

2004-11-15 Thread Ben Miller
-Original Message- From: Robby Russell [mailto:[EMAIL PROTECTED] Sent: Monday, November 15, 2004 11:12 AM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Column Totals On Mon, 2004-11-15 at 11:01 -0700, Ben Miller wrote: SELECT SUM(Revenue) FROM Sales WHERE Date='$Date

RE: [PHP] Column Totals

2004-11-15 Thread Ben Miller
That did it perfectly. Why don't any of the stupid books tell you that you need the AS statement? -Original Message- From: Jay Blanchard [mailto:[EMAIL PROTECTED] Sent: Monday, November 15, 2004 11:16 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RE: [PHP] Column Totals [snip]

RE: [PHP] Arrays

2004-11-08 Thread Ben Miller
edit I hope this is not a stupid question, but I am learning how to work with Arrays, and am having trouble figuring out how to move array values [the whole array and all of it's values] from page to page and/or store in a db. Once again, I am new to arrays (and fairly new to PHP for that

RE: [PHP] Arrays

2004-11-08 Thread Ben Miller
Thank you to all for help with this. Once I have a general idea of which path to head down, I can figure it out pretty well from there, and you have all given me a pretty good road map. Anyway, thanks again. It is greatly appreciated. I'll let you know hot it all comes out. Ben -Original

[PHP] mysql_connect

2004-11-03 Thread Ben Miller
I am having trouble connecting to a database on another server. I have the following for the connection, but it seems to be overriding the value for the $host variable, and replacing it with localhost. Anyone got any ideas? $host=domain.com; $user=username;

RE: [PHP] mysql_connect

2004-11-03 Thread Ben Miller
] Sent: Thursday, November 04, 2004 7:47 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] mysql_connect On Thursday 04 November 2004 06:22, Ben Miller wrote: I am having trouble connecting to a database on another server. I have the following for the connection, but it seems to be overriding the value

[PHP] Simple Time Question

2004-10-21 Thread Ben Miller
Probably a stupid question, but hopefully has a simple answer. Is there a way to get Grenwich Mean time? time() and date() functions that I can see only seem to get date/time from the server, which knowing where that is, could easily figure out GM time, but would rather go the other way.

RE: [PHP] Referring Page

2004-10-14 Thread Ben Miller
Thanks all. That did it perfectly. -Original Message- From: Matt M. [mailto:[EMAIL PROTECTED] Sent: Thursday, October 14, 2004 2:21 PM To: Ben Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Referring Page I am trying to set up a script that will do different things based on the reffering