Re: [PHP] Simplifying MySql queries

2011-02-14 Thread Simcha Younger
> Thanks! select * from (select * from `CandidateQuestions` order by rand() ) t group by `Category`; > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- Simcha Younger -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Problem with Include

2010-12-19 Thread Simcha Younger
sheridan.co.uk Since it is being included by PHP, and not served by Apache, the extension is not important. -- Simcha Younger -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] MySQL Query Help

2010-11-22 Thread Simcha Younger
> You should probably select all relevant rows for each product, without checking that a given criteria has a matching value for each product. Use php to filter out the criteria which do not apply to all products. -- Simcha Younger -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] MySQL Query Help

2010-11-20 Thread Simcha Younger
rectly, you have products which reference a criteria ID which has no matching value. If this is the problem you have a to first take care of the integrity of your data, as this should never happen. -- Simcha Younger -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Character encoding hell

2010-10-26 Thread Simcha Younger
chine). I don't want to type the display name of these files > twice and the website has no database capability If you are not constantly adding/changing the files there, you can use a csv file in place of a database. -- Simcha Younger -- PHP General Mailing List (http://www.php.net/

Re: [PHP] Auto-generating HTML

2010-09-21 Thread Simcha Younger
hat is the usual place where I look at my HTML.) If there is a specific place you want to look at in the html, just change the lines there to look like this: echo ' '; but this will make your PHP quite messy if you do it alot. I would go with templating, as many here suggested. --

Re: [PHP] MySQL select matching

2010-07-20 Thread Simcha Younger
003 > isn't in the same order as ID 1, but the data is still the same. > select distinct id from `table` where concat(`b`, `c`, `d`) in (select concat(`b`,`c`,`d` from `table` where id = '0001') AND id != '0001'; (untested) -- Simcha Younger -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] functions and global variables

2010-07-19 Thread Simcha Younger
> > > } > > > > > > I've tried it both ways and both ways it works, with and without the > > > global statement. I was under the impression that to be useful in a > > > function variables outside were not accessible. > > > Thanks. >

Re: [PHP] What am I missing here?

2010-06-20 Thread Simcha Younger
you fixed this, SCRIPT_NAME was the same length as REQUEST_URI so nothing was returned. look at the documentation on substr, you need to fix you parameters. -- Simcha Younger -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] SQL Syntax

2010-06-16 Thread Simcha Younger
($condition as $count=>$cond){ $join .= ' left join b as b'.$count' on a.pid=b'.$count.'.pid '; $where[] = 'b'.$count'.'.'.$cond; } $sql .= $join.implode(' AND ', $where); -- Simcha Younger -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Preg Match Problem

2010-06-03 Thread Simcha Younger
the pattern looks like > Mon, Tue You need a leading slash as a delimiter, eg "/Sat/i" also note that you will match any phrase that contains 'sun', 'mon' etc, which can also have irrelevant text, eg 'Mars Jupiter Saturn' will match, but thats probably not what you want -- Simcha Younger -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] can't retrieve more than 1 record at the time

2009-12-09 Thread Simcha Younger
On Wed, 09 Dec 2009 11:39:55 -0800 Catherine Madsen wrote: It looks like you have to take out this line: > $stmt = NULL; /* release the connection */ You are destroying the variable instead of just deleting the data, so the while statement terminates after the first record. -- Simcha Youn

RE: [PHP] Math problems (No not high school math!)

2008-09-25 Thread Simcha
e timecard for > anyone following along at home) Something like this should work: Select SUM(timediff(`timeout`, `timein`)) where date = X; And for a week: Select SUM(timediff(`timeout`, `timein`)) where week(date) = week_of_year ; (Not tested) Simcha Younger -- PHP General Mailing Lis

RE: [PHP] PHP tags - any reasons to close ?>

2008-09-23 Thread Simcha Younger
ith the script higher up on the screen, and very few editors allow you to scroll the last lines of the program above the bottom of the screen. (Crimson Editor is the only one I have found that does this.) > > Thanks for ideas, > Martin > Simcha Younger -- PHP General Mailing List

RE: [PHP] Function parameters and arrays

2008-09-18 Thread Simcha
This would be a little neater: foreach(func_get_arg(2) as $k => $WhereArray) { //echo $WhereArray[0][0]; $SQLStmt .= ' ' . $WhereArray[0] . ' ' . $WhereArray[1] . ' ' . $WhereArray[2]; if($k != 0) $SQLStmt .=' ' . $WhereArray[3];

RE: [PHP] Confused

2008-09-02 Thread Simcha
Ignore my previous email - It was sloppy. I was not focusing on the email. SY -Original Message- From: Simcha [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 02, 2008 8:41 PM To: 'Dan Shirah'; 'PHP List' Subject: RE: [PHP] Confused This does not seem to be an

RE: [PHP] Confused

2008-09-02 Thread Simcha
This does not seem to be an installation problem - Your test [(!$connect_id = ] fails, since the connect returns false, so it does not run the condition. Compare: -Original Message- From: Dan Shirah [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 02, 2008 7:31 PM To: PHP List Subj

RE: [PHP] Re: Variable name as a string

2008-08-28 Thread Simcha
, one the parameter - so it makes sense (sort of) to use two different terms. Simcha Younger -Original Message- From: tedd [mailto:[EMAIL PROTECTED] Sent: Thursday, August 28, 2008 4:40 PM To: php-general@lists.php.net Subject: RE: [PHP] Re: Variable name as a string At 11:50 AM +0100 8

RE: [PHP] Large/unreliable file uploading over HTTP

2008-08-26 Thread Simcha Younger
Is this what you are looking for -- It's a java applet that has most of the features you mentioned. I have used it for very large files with no problem. http://www.javazoom.net/applets/jclientupload/jclientupload.html (Sorry, its not free software.) -Original Message- From: mike [mailto

RE: [PHP] Search Suggestions

2008-08-26 Thread Simcha Younger
send back a list of names to expand, and then have Javascript go through the whole listing to find those names. Simcha Younger -Original Message- From: Dan Shirah [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 26, 2008 3:31 PM To: PHP-General List Subject: [PHP] Search Suggestions

RE: [PHP] Negative Look Ahead Regex

2008-08-18 Thread Simcha Younger
ot;; $href = $href[1]; if(!strpos($href, "PHPSESSID")) $href = preg_replace("/^([^#?]*)\??/", "$1$id", $href); return $href."\""; } $buffer = preg_replace_callback("/(href=\".*?)\"/", "addid", $buffer); Simcha Younger -

RE: [PHP] preg_replace strange behaviour, duplicates

2008-08-18 Thread Simcha Younger
Simcha Younger -Original Message- From: Adz07 [mailto:[EMAIL PROTECTED] Sent: Monday, August 18, 2008 10:17 AM To: php-general@lists.php.net Subject: Re: [PHP] preg_replace strange behaviour, duplicates Problem is that a negative assertion assumes i know what is

RE: [PHP] Negative Look Ahead Regex - Code Mistake or Bug?

2008-08-17 Thread Simcha Younger
omain\.com([\/\w\.\-]*\??)(?!PHPSESSID\=2u0c caffoh6jaeapkke35qpp87;?)/', '"http://www.domain.com$1?PHPSESSID=t9gksvpdcuobsnqt98qloe6lg4;', $buffer); (not tested) Simcha Younger -Original Message- From: Cameron B. Prince [mailto:[EMAIL PROTECTED] Sent: Monday, Au

RE: [PHP] import XLS sheet into DB

2008-08-16 Thread Simcha
Try using: http://sourceforge.net/docman/display_doc.php?docid=22092&group_id=99160 I have never used it, but it looks very straightforward. Docs are here: http://sourceforge.net/docman/display_doc.php?docid=22092&group_id=99160 code should be something like this: (for mysql, based on

RE: [PHP] Removing an element from the middle of an mdlti-dimentsional array

2008-08-14 Thread Simcha Younger
array_splice($a, 1, 1); This will remove the second element, and reset the keys. Simcha Younger -Original Message- From: Don [mailto:[EMAIL PROTECTED] Sent: Friday, August 15, 2008 4:30 AM To: php-general@lists.php.net Subject: [PHP] Removing an element from the middle of an mdlti