Re: [PHP] Because you guys/gals/girls/women/insert pc term here are a smart lot

2009-01-06 Thread Chris
Nathan Rixham wrote: chris smith wrote: It may be worth mentioning that, IIRC, CHAR is faster due to the fixed length. If you can make your table use a fixed length row size (ie no variable length columns), it'll be faster. I'd be interested in seeing tests about this.. I doubt t

Re: [PHP] Logic puzzle. Not a question. Just for fun

2009-01-06 Thread Chris
If this seems simple to you remember I have no formal training in logic structure or DB design Neither do I - and probably a lot of others here too ;) the value of a status field is given in the sdk text as such... ...This number is determined by adding the following values togeth

Re: [PHP] Re: can a session be used in a query?

2009-01-07 Thread Chris
I will try that, thanks, I did just try to echo the $row['AddEditAdmin'] results, as I do in the query section and in that it does return YES or NO like I expect, but when I tried to echo it down in the page where I need to use it guess what..no echo... am I cutting my query off somewhere?

Re: [PHP] Re: can a session be used in a query?

2009-01-07 Thread Chris
Ashley Sheridan wrote: On Wed, 2009-01-07 at 18:50 -0500, Frank Stanovcak wrote: here is a handy little snippet of code I use. Just include it where you want to get a snap shot of all the variables in an app. ta ta for today boys! Is it just me, or can anybody else not see the code snippe

Re: [PHP] Re: a weired query issue

2009-01-08 Thread Chris
Nathan Rixham wrote: viraj wrote: i have this query.. $sql = "SELECT `id` FROM `modules_permissions` WHERE `id` = '" . $permissionId . "';"; when i pass the value 31 to permissionid, it returns me the 31st row of the table. and it's fine. but when i pass '31asasa' as the permissionid it return

Re: [PHP] Re: redoing website after 7 years

2009-01-08 Thread Chris
I know many people will grin at me for this solution but may be faster way to overcome this problem to do a find for $ and replace with $_REQUEST. even this will help you if you dealt with $_POST, $_GET, $_COOKIE. Please don't. $connection = mysql_connect(...) becomes $_REQUEST[$connection]

Re: [PHP] Re: redoing website after 7 years

2009-01-11 Thread Chris
Robert Cummings wrote: On Fri, 2009-01-09 at 08:56 -0500, Andrew Ballard wrote: On Fri, Jan 9, 2009 at 2:09 AM, Robert Cummings wrote: On Fri, 2009-01-09 at 15:17 +1100, Chris wrote: I know many people will grin at me for this solution but may be faster way to overcome this problem to do a

Re: [PHP] Re: redoing website after 7 years

2009-01-11 Thread Chris
Robert Cummings wrote: On Mon, 2009-01-12 at 09:00 +1100, Chris wrote: Robert Cummings wrote: On Fri, 2009-01-09 at 08:56 -0500, Andrew Ballard wrote: On Fri, Jan 9, 2009 at 2:09 AM, Robert Cummings wrote: On Fri, 2009-01-09 at 15:17 +1100, Chris wrote: I know many people will grin at me

Re: [PHP] pecl4win - any updates?

2009-01-11 Thread Chris
pan wrote: Has there been any progress reinstating pecl packages for windows? per the comment on php.net, join the "Windows Internals list" (or perhaps the "Windows PHP users list" might have some info). -- Postgresql & php tutorials http://www.designmagick.com/ -- PHP General Mailing List

Re: [PHP] Couple of beginner questions

2009-01-11 Thread Chris
tedd wrote: At 11:35 AM -0800 1/9/09, VamVan wrote: -- Remember as you re still a beginner try to avoid using ?> at the end of complete PHP code page. or else if you have empty lines at the end of the file "then you wont see blank page of death in PHP". I'm not a beginner, but this is a pract

Re: [PHP] switch vs elseif

2009-01-12 Thread Chris
tedd wrote: At 3:32 PM -0500 1/12/09, Robert Cummings wrote: One has to wonder about the readability of the case version though since one may not notice immediately the missing break statement. Cheers, Rob. Yes, but that's because of the way you wrote it -- consider this: I'm sure that was

Re: [PHP] variable probe revision

2009-01-12 Thread Chris
Frank Stanovcak wrote: I posted this once before, and then tried to use it multiple times in a script. As you can guess I got a bunch of func already defined errors. Here is a revision incase anyone decided to use it that will work multiple times in the same script for variable watching. --

Re: [PHP] update von php 4.4.6 zu 5.2.8

2009-01-12 Thread Chris
Merlin Morgenstern wrote: Hello everybody, I want to upgrade my system and do face some trouble with pdflib. compile says: Notice: Following unknown configure options were used: --enable-gd-imgstrttf --with-pdflib I guess the gd functionality is enabled now anyway? How about the pdflib? Is

Re: [PHP] upgrade php 5.2.6 -> 5.2.8 mysql problems!

2009-01-12 Thread Chris
Here is the configure command that is pretty much the same as in 5.2.6: So look at the differences ;) './configure' '--enable-fastcgi' '--with-mysql' '--prefix=/usr/local/php' '--with-apxs2=/usr/local/apache2/bin/apxs' '--enable-mbstring' '--with-pdo-mysql=/usr/local/mysql/' '--with-mysql-

Re: [PHP] php session GC error

2009-01-13 Thread Chris
Frank Stanovcak wrote: I'm trying to make sure that my sessions are timed out by my server. I'm running it on winxp, and my php.ini contains the following session.gc_probability = 1 session.gc_divisor = 1 ; After this number of seconds, stored data will be seen as 'garbage' and ; cleaned up

Re: [PHP] Quotes in querys

2009-01-14 Thread Chris
It is over head, but it caches the execution plan for multiple runs of the script. So different users with different data will use the same cached query on the database. Saving processing time. It also prevents SQL injection on the fly because you are indicating what data type each place holde

Re: [PHP] Basic Authentication

2009-01-14 Thread Chris
tedd wrote: At 2:19 PM -0600 1/14/09, Shawn McKenzie wrote: As others have said, use crypt(). http://php.net/manual/function.crypt.php has Example #2 Using crypt() with htpasswd. Thanks, but that doesn't really solve my problem. You see, I know the password and I know the encoded result --

Re: [PHP] program to test php security

2009-01-14 Thread Chris
paragasu wrote: one of my client says his company do have a program to test php code for common programming security problem like sql injection etc i am curious but he do not want to tell what the program is. do this program exists? what is it? https://chorizo-scanner.com/ http://securityscann

Re: [PHP] I can't get help from the binary administrator

2009-01-15 Thread Chris
Eduardo Varela wrote: Hi, folks. I own an old Pentium I machine, and I pay phone connection with Internet by the minute, so I want to recieve a digest from the list. In the first communication from this list I was said: "For help and a description of available commands, send a message to: "

Re: [PHP] print a to z

2009-01-15 Thread Chris
paragasu wrote: i have this cute little problem. i want to print a to z for site navigation my first attempt work fine for($i = '65'; $i < '91'; ++$i) echo chr($i); but someone point me a more interesting solutions $letters = range('a', 'z'); foreach ($letters as $letter) { echo $letter;

Re: [PHP] PMA_List_Database

2009-01-18 Thread Chris
Merlin Morgenstern wrote: Hi guys.. here comes the last question for today :-) Everything works fine. My Apps run beautiful with php5. The only thing now left which does not work ist phpmyadmin. I googled the error msg, but could only find servers which had the same problem. No solution to f

Re: [PHP] phpMailer Problem!

2009-01-18 Thread Chris
shahrzad khorrami wrote: I tested with port 25, but it didn't work. I confuse, I don't know what problem is it works well with gmail... http://phpmailer.codeworxtech.com/index.php?pg=sf&p=ml The phpmailer users/developers will be able to help you debug this better. -- Postgresql & php tu

Re: [PHP] Installation problems on Vista

2009-01-19 Thread Chris
lucson pierre-charles wrote: I am having problems installing the zip package (PHP5) on Windows Vista. The output will not come on the browser upon testing. Only the code is being output to the browser. Apache (Apache 2) was properly installed. Your assistance please. Regards, Lucson If you'r

Re: [PHP] Re: How to use SVN + PHP

2009-01-19 Thread Chris
Edmund Hertle wrote: 2009/1/20 Nathan Rixham you don't have to locally develop, you can develop however you want :) svn is just version controlling all your files to make it easier to team work and to rollback code. you then tag good versions of the code in svn so you have a permanent easy to a

Re: [PHP] MySQL class. Thoughts?

2009-01-21 Thread Chris
Eric Butera wrote: On Wed, Jan 21, 2009 at 12:45 PM, Edmund Hertle wrote: 2009/1/21 Jay Moore This is a MySQL class I use and I wanted to get everyone's thoughts on how/if I can improve it. This is for MySQL only. I don't need to make it compatible with other databases. I'm curious what y

Re: [PHP] MySQL class. Thoughts?

2009-01-21 Thread Chris
Yea if you're only targeting 1 db, then why not use that class? At least then there's the php manual to figure out what something does. Because then to add query logging for the whole app, you just need to put it in the class :) (I've done that before to check what's being run and where from,

Re: [PHP] Re: Multiple queries in PHP

2009-01-26 Thread Chris
This extension does not have to be installed. If your server is running php5, then this extension is installed No it's not. The mysql extension no longer ships with php by default, you have to build it when you ./configure or install the external php-mysql package (depending on your o/s and

Re: [PHP] PHP 5.2.8 fails to find libiconv

2009-01-26 Thread Chris
Ro Achterberg wrote: Hi, I'm attempting to install PHP 5.2.8 on CentOS 5.2 x86_64. The glibc iconv doesn't seem to function very well, leading to a bunch of failed tests when running 'make test' (see below). After a bit of Googling I stumbled upon http://nl2.php.net/manual/en/intro.iconv.php

Re: [PHP] Multiple queries in PHP

2009-01-26 Thread Chris
Per Jessen wrote: Ashley Sheridan wrote: I've run into a bit of a problem. I put together a query using mysql variables in the form set @m:= 0; with the select that uses it directly after. For any wondering, the select was using it as an incremental value which can't be hard coded, as the value

Re: [PHP] Variable formatting problem using sessions...

2009-01-26 Thread Chris
Rick Duval wrote: I'm using an "OnClick" routine to set a session variable before I go to another page. onClick= works fine but I need a variable where "rick" is I've tried onClick= and other variations but it doesn't work. Can anybody tell me what the proper formatting is to get this to r

Re: [PHP] Global Changes With Loop To Allow Nulls In A Table...

2009-01-27 Thread Chris
The other responses should get you started if this is something you really want to do. However, I'll play devil's advocate here and just raise the question why you would want to make this change in the first place. I'm not quite as anti-NULL as a lot of arguments I've read against them, but I te

Re: [PHP] Global Changes With Loop To Allow Nulls In A Table...

2009-01-27 Thread Chris
Boyd, Todd M. wrote: -Original Message- From: Chris [mailto:dmag...@gmail.com] Sent: Tuesday, January 27, 2009 4:04 PM To: Boyd, Todd M. Cc: php-general@lists.php.net Subject: Re: [PHP] Global Changes With Loop To Allow Nulls In A Table... The other responses should get you started if

Re: [PHP] php forking/spawning question...

2009-01-27 Thread Chris
bruce wrote: Hi... got the follwoing example... basically, when i call the function "spawn_" i get the passed vars for appname/args... the $appname,$args are valid when the spawn_ function is initially invoked. however, when the app does the fork, the $appname, $args get lost. when the function

Re: [PHP] Installation of php-5.2.8-win32-installer.msi

2009-01-27 Thread Chris
Jerry Foote wrote: Tried to install PHP using this installer and about 2/3 of the way through the installation I get an error message: I am trying to install the IIS ISAPI module and MySQL to the hard drive under c:\Program Files\PHP on an XP Professional SP2 machine. The mailing list

Re: [PHP] Installation of php-5.2.8-win32-installer.msi

2009-01-27 Thread Chris
Always cc the mailing list so others can offer suggestions/advice and so it will also show up in the archives later on. Jerry Foote wrote: The error message is: "There is a problem with this Windows Installer package. A script required for this install to complete could not be run. Contact

Re: [PHP] Making a Variable from different tables with Matching Dbfields?

2009-01-28 Thread Chris
Here are my variables when I reveal them, I am picking up the right adminID I can't figure out why it's returning random orders though: $query"SELECT admin.AdminID, workorders.AdminID FROM admin, workorders WHERE admin.UserName = 'tmiller' " Please please please trim your posts to relevant stu

Re: [PHP] Making a Variable from different tables with Matching Dbfields?

2009-01-28 Thread Chris
Terion Miller wrote: I'm not sure what you mean by trim the posts, please explain so I can spare folks from redundant text. Before you post, remove any text that you're not referencing (in this case I removed my suggestion). Your post made perfect sense to me about the INNER JOIN , I looke

Re: [PHP] Making a Variable from different tables with Matching Dbfields?

2009-01-28 Thread Chris
Well I tried both ways and still cannot get it to pick up the AdminID, $query "SELECT admin.AdminID , workorders.AdminID FROM admin INNER JOIN workorders on AdminID WHERE admin.UserName = 'tmiller' " $result "" $row"" $SortBy "WorkOrderID DESC" $Page "1" $PerPage"30" $StartPage

Re: [PHP] Making a Variable from different tables with Matching Dbfields?

2009-01-28 Thread Chris
The main problem is that you've never explained what you want to get from the query. The replies have used your code as an example and I'm pretty sure that's not what you want. Unless I totally mis-understand what you want, you have 2 options: 1. Use the 2 queries that I gave you in a previou

Re: [PHP] PHP Linux/Windows Outlook 2003 HTML email problem

2009-02-01 Thread Chris
German Geek wrote: Hi All, We've got a problem with our Ubuntu Linux machine sending HTML emails to Outlook 2003: It's an Ubuntu Server (uname -a Linux CDR2-221 2.6.24-19-server #1 SMP Wed Jun 18 15:18:00 UTC 2008 i686 GNU/Linux) with the newest version of Postfix installed as the Mail server.

Re: [PHP] pear:Auth invalid username/password

2009-02-02 Thread Chris
John Corry wrote: I'm using Pear Auth on several sites and am looking for suggestions on the best way to implement error reporting on a failed log-in. Currently I'm using a function that checks if the posted username is in the users table...and if the password is a match. Auth logs the user on i

Re: [PHP] Re: More questions about SESSION use

2009-02-02 Thread Chris
Edmund Hertle wrote: 2009/2/1 Terion Miller This is how it was originally written: if (empty($_SESSION['AdminLogin']) || $_SESSION['AdminLogin'] != true){ header ("Location: LogOut.php"); $_SESSION['user']=$UserName; $_SESSION['AdminID']=$AdminID; <--*I added this one originally

Re: [PHP] How can I do the opposite of property_exists(), maybe a creat_property() in PHP5?

2009-02-03 Thread Chris
the question is what is __set() doing, if it's throwing an exception for undefined properties then obviously it with 'blow up'. But why should __set() even be called if I'm accessing the property directly? This seems stupid. $this->oraclecustomerid = 1122; should NOT be the same as $this

Re: [PHP] is this use of subquery "smart"

2009-02-04 Thread Chris
Solution 2: SELECT r.reg_id, r.date_registered, r.old_record, if(r.ghost_record!=0, (SELECT CONCAT(people.last_name, ', ', people.first_name) FROM people, registrants WHERE people.instance_id=12 and people.person_id=registrants.person_id AND registrants.reg_id=r.ghost_record), 'y') as regis

Re: RES: [PHP] Mutiple SQL request

2009-02-04 Thread Chris
Jônatas Zechim wrote: For example i’ve this query: SELECT admin_nome FROM ctalk_admin WHERE admin_lastping <= '1233762658' AND admin_lastping >= '1233762608' AND admin_id='1' I ran explain, the result for extra is ‘Impossible WHERE noticed after reading const table...’ Well this one i

Re: RES: [PHP] Mutiple SQL request

2009-02-04 Thread Chris
Ashley Sheridan wrote: On Thu, 2009-02-05 at 08:38 +1100, Chris wrote: Jônatas Zechim wrote: For example i’ve this query: SELECT admin_nome FROM ctalk_admin WHERE admin_lastping <= '1233762658' AND admin_lastping >= '1233762608' AND admin_id='1' I

Re: RES: [PHP] Mutiple SQL request

2009-02-04 Thread Chris
MySQL may have noticed it was impossible with the current data he had using the index on that field, but in the future it may become valid, so I wouldn't necessary eliminate it if it's deemed crucial. A query that returns no results is equally as useful as one that returns many. I'm not arguin

Re: [PHP] Speed Opinion

2009-02-04 Thread Chris
PHP wrote: Hi all, I am seeking some knowledge, hopefully I explain this right. I am wondering what you think is faster. Say you have 1000 records from 2 different tables that you need to get from a MySQL database. A simple table will be displayed for each record, the second table contains re

Re: [PHP] is this use of subquery "smart"

2009-02-04 Thread Chris
Bastien Koert wrote: On Wed, Feb 4, 2009 at 4:33 PM, Chris <mailto:dmag...@gmail.com>> wrote: Solution 2: SELECT r.reg_id, r.date_registered, r.old_record, if(r.ghost_record!=0, (SELECT CONCAT(people.last_name, ', ', people.firs

Re: [PHP] PHP pop-up windows

2009-02-04 Thread Chris
Clancy wrote: I'm working on a website editor, primarily for my own use. Normally it will be used on my own computer, and much of what I wish to achieve could arguably be better done in either C or JavaScript, but both of these have a similar programming syntax to PHP, but with subtle differen

Re: [PHP] DB Comparisons

2009-02-05 Thread Chris
Larry Garfield wrote: On Thu, 05 Feb 2009 12:36:02 -0800, revDAVE wrote: Hi Folks, I¹m curious if there are any previous discussions / Articles / URL¹s that compare the power and scalability of MySQL (with php) with other technologies like MS sequel server oracle - coldfusion etc I imagi

Re: [PHP] Preserving History

2009-02-05 Thread Chris
tedd wrote: Hi gang: To further the Garbage Collection thread on to another level (i.e., preserving history) please consider this: Okay, let's say we have a table containing all the instances of tutors teaching courses. A record might look like this: Course-to-Tutor table course_id = 123 t

Re: [PHP] CLI not obeying php.ini

2009-02-05 Thread Chris
Philip Thompson wrote: In my php.ini, I have error_reporting = E_ALL & ~E_NOTICE When I run a script from the command line, I get a lot of notices even when I said I don't want them. Also, in my script, I specified error_reporting(E_ERROR) in attempts to explicitly tell it what I want. I

Re: [PHP] function_exists question

2009-02-05 Thread Chris
How about this PHP developers: You could make a global variable (or constant) the user can set like define('PHP_COMPATIBLE_VERSION', '5.0.1'); or something to tell PHP 6 to interpret it like PHP 5.x . That way, at least you are guaranteed that the code will work like on that version. It might

Re: [PHP] Re: move_uploaded_file() problem

2009-02-07 Thread Chris
if($_FILES['file']['name'] && $_FILES['file']['size']<55){ $file_name = "news_".$_FILES['file']['name']; $image="../_img/news/".$file_name;

Re: [PHP] Adding Records & Capture The New Record ID

2009-02-08 Thread Chris
tedd wrote: At 1:36 AM + 2/8/09, Ashley Sheridan wrote: On Sat, 2009-02-07 at 15:26 -0500, tedd wrote: > That's one way, to use "mysql_insert_id" (probably the best). But another is simply to read back in the record you just created and check the $row['id']. That's the way I do it somet

Re: [PHP] Generate unique login token

2009-02-09 Thread Chris
sean greenslade wrote: I have a login system that I am coding. I need it to generate a unique token on login to be stored in the browser's cookie. I currently use a script that generates a MD5 hash of the current unix timestamp, then checks the mysql database to see if the token already exists. I

Re: [PHP] Generate unique login token

2009-02-09 Thread Chris
What would be wrong with using the session and getting the session id? That should be unique for each visitor, for as long as they are logged in. Probably wouldn't be useful for repeated visits, but I'm assuming that on next login they would be issued another token anyway? Nothing - I just did

Re: [PHP] problem with sending data

2009-02-09 Thread Chris
Mousa Masri wrote: Dear I have problem with writing large data (large text) in the database or any file . If we try to do, the field in the DB or the file will be empty . (We lose the data) . I mean by large data more them 60 Kbyte . But if we try to write small text (less then 60K) , the text

Re: [PHP] Simple open source CMS as a starting point

2009-02-12 Thread Chris
Michael A. Peters wrote: Shawn McKenzie wrote: Michael A. Peters wrote: Another thing the common CMS tools frequently do - they want a configuration file that the web server has write permission to that is parsed as php by almost every page the app displays. Big mistake - if you want a web inte

Re: [PHP] Re: inset data to multiple tables

2009-02-16 Thread Chris
PJ wrote: Hell, I feel about as dumb as can be. I just goth things straight and it seems to work just fine... Here is where my problem was... $sql1 = "INSERT INTO books ( title, sub_title, descr, comment, bk_cover, publish_date, ISBN, language ) VALUE

Re: [PHP] PHPers: help KDE wiki, please!

2009-02-17 Thread Chris
Dotan Cohen wrote: KDE really needs a developer with PHP experience to sort out some issues with their wiki: http://aseigo.blogspot.com/2009/02/php-helper-for-userbase.html I anyone could donate the time, KDE and myself personally would appreciate it. Thanks! Aren't you a php developer? ;) --

Re: [PHP] Unique User Hashes

2009-02-17 Thread Chris
Ian wrote: Hi, I am busy building an application that requires one time voting and to get around the user deleting a cookie that I set im keeping a hash on my side which I then try match before allowing anything. I assume this is backed by a db of some sort. $query = "update user set has_vote

Re: [PHP] Unique User Hashes

2009-02-17 Thread Chris
Ian wrote: Hi, Yep it is backed by DB and i do record when they vote - but its still flawed in how to track unique users :) Thanks though - will continue to look further. Do you have to log in to vote? How are you stopping people from signing up multiple times? -- Postgresql & php tutorial

Re: [PHP] Unique User Hashes

2009-02-19 Thread Chris
Martin Zvarík wrote: tedd napsal(a): At 5:28 PM +0100 2/19/09, Martin Zvarík wrote: tedd napsal(a): At 5:10 PM +0100 2/19/09, Martin Zvarík wrote: tedd napsal(a): At 1:49 AM +0100 2/19/09, Martin Zvarík wrote: Guys, I have not seen a poll where you need to input your email address - and if

Re: [PHP] Unique User Hashes

2009-02-19 Thread Chris
Martin Zvarík wrote: Chris napsal(a): Martin Zvarík wrote: tedd napsal(a): At 5:28 PM +0100 2/19/09, Martin Zvarík wrote: tedd napsal(a): At 5:10 PM +0100 2/19/09, Martin Zvarík wrote: tedd napsal(a): At 1:49 AM +0100 2/19/09, Martin Zvarík wrote: Guys, I have not seen a poll where you

Re: [PHP] Execute flash files with PHP

2009-02-19 Thread Chris
R B wrote: Hello. I have two scripts in php that reads a .swf or .flv movie file, like this: SCRIPT # 1 SCRIPT # 2 The script # 1 with the .swf file works fine: the video is executed with streaming. The script # 2 with the .flv file is executed but without streaming. If i execute the mo

Re: [PHP] Execute flash files with PHP

2009-02-19 Thread Chris
R B wrote: Hello. I have two scripts in php that reads a .swf or .flv movie file, like this: SCRIPT # 1 SCRIPT # 2 The script # 1 with the .swf file works fine: the video is executed with streaming. The script # 2 with the .flv file is executed but without streaming. There's a tutorial

Re: [PHP] PDO buffered query problem

2009-02-23 Thread Chris
Stewart Duncan wrote: Hi there, I'm having some serious problems with the PHP Data Object functions. I'm trying to loop through a sizeable result set (~60k rows, ~1gig) using a buffered query to avoid fetching the whole set. No matter what I do, the script just hangs on the PDO::query() - it

Re: [PHP] PDO buffered query problem

2009-02-24 Thread Chris
Thodoris wrote: Stewart Duncan wrote: Hi there, I'm having some serious problems with the PHP Data Object functions. I'm trying to loop through a sizeable result set (~60k rows, ~1gig) using a buffered query to avoid fetching the whole set. No matter what I do, the script just hangs on th

Re: [PHP] syntax

2009-02-24 Thread Chris
Terion Miller wrote: Need syntax help when it comes to using a timestamp. What I'm trying to say in my query WHERE clause is to select records if the timestamp on the record is in the past 7 days from NOW() $query .= " WHERE stamp < NOW()-7 "; I have no clue here on this the lay language

Re: [PHP] syntax

2009-02-24 Thread Chris
Micah Gersten wrote: Martin Zvarík wrote: Chris napsal(a): Terion Miller wrote: Need syntax help when it comes to using a timestamp. What I'm trying to say in my query WHERE clause is to select records if the timestamp on the record is in the past 7 days from NOW() $query .= " W

Re: [PHP] optimizing space for array of booleans

2009-02-24 Thread Chris
leledumbo wrote: Good points, I'll try it. Without testing it (it's late here), your binstr() function doesn't accept parameters, so it would always return the same result each time it's called, regardless of what you pass into it. In case you want to check it tomorrow or later: private func

Re: [PHP] Re: catch the error

2009-02-26 Thread Chris
In examples sent to you, people foolishly replaced your $db var with $db_connect ONLY FOR PART OF THE SCRIPT. You've defined your database connection as $db_connect in some versions of the source, but then you reference $db (without _connect) in your mysql_select call in that same source. $db =

Re: [PHP] Re: catch the error

2009-02-26 Thread Chris
Boyd, Todd M. wrote: -Original Message- From: Chris [mailto:dmag...@gmail.com] Sent: Thursday, February 26, 2009 4:16 PM To: Boyd, Todd M. Cc: PJ; PHP General list Subject: Re: [PHP] Re: catch the error In examples sent to you, people foolishly replaced your $db var with $db_connect

Re: [PHP] Re: How do I remove an array element from within a recursive function?

2009-02-26 Thread Chris
Daevid Vincent wrote: I tried that and it still doesn't work. I even tried this hardcore "test": public static final function removeMenuItems(&$menuItems, $removeArray) { foreach($menuItems as &$value) { unset($value); } } You don't unset the value, you unset the key. $va

Re: [PHP] Re: How important is your Express or Web Edition database? Please weigh in--

2009-03-02 Thread Chris
Wait, wait, wait... I know SQL Server doesn't have "LIMIT", but haven't you guys ever used "TOP"? As in... select top 10 * from some_table where some_column = 'some_value'; FWIW you have to do a similar thing in oracle. select * from table where rownum <= 5; <-- get 5 rows. to use a limit

Re: [PHP] Re: How important is your Express or Web Edition database? Please weigh in--

2009-03-02 Thread Chris
There isn't a BOTTOM, the solution looks something like this: SELECT * FROM (SELECT TOP 10 * FROM (SELECT TOP 20 * FROM table WHERE clause ORDER BY col) AS temp ORDER BY col DESC) as temp2 ORDER BY col It's an awful mess, but was the only way I found to select results x to y in a reliable mann

Re: [PHP] allow_url_fopen & allow_url_include

2009-03-02 Thread Chris
Kaushal Shriyan wrote: Hi, I have enabled allow_url_fopen & allow_url_include in php.ini file. is it a security issue ? allow_url_fopen means you can fetch pages: $page = file_get_contents('http://www.example.com'); This is ok to enable - all it does is fetch the page. It does not execute t

Re: [PHP] allow_url_fopen & allow_url_include

2009-03-03 Thread Chris
Kaushal Shriyan wrote: On Tue, Mar 3, 2009 at 12:21 PM, Kaushal Shriyan mailto:kaushalshri...@gmail.com>> wrote: On Tue, Mar 3, 2009 at 11:52 AM, Chris mailto:dmag...@gmail.com>> wrote: Kaushal Shriyan wrote: Hi, I have enabled all

Re: [PHP] Re: Intermittent problem sending mail with PHP

2009-03-03 Thread Chris
Stephen Hutchison wrote: This appears to by a problem with the mail function. When I comment out the lines: if (mail($recipient, $subject, $message, $headers)) echo 'Succeeded'; else echo 'Error - please check your e-mail address'; More likely a mail server issue rather than the mail

Re: [PHP] allow_url_fopen & allow_url_include

2009-03-03 Thread Chris
allow_url_fopen is not a security issue - it only returns the code, it does not execute it. But yes you can use curl instead of relying on allow_url_fopen. Well, allow_url_fopen is really a security issue. A renowned programmer (http://hasin.wordpress.com) said it could even cau

Re: [PHP] whoami explanation

2009-03-04 Thread Chris
for FILE in $LIST do cp $FILE $FILE.bak done which works as long as you can guarantee that none your file names contain spaces ... ;) Which he already said: Note that in both of these examples, filenames with spaces in them will blow the whole thing up :( ;) -- Postgresql & php

Re: [PHP] if elseif elseif elseif....

2009-03-04 Thread Chris
PJ wrote: Daniel Brown wrote: On Wed, Mar 4, 2009 at 17:51, PJ wrote: elseif ($obligatoryFieldNotPresent = 1) { $obligatoryFieldNotPresent = 0; } Are you certain you only wanted a single equal operator in the last elseif() condition? Further, are you sure it shou

Re: [PHP] if elseif elseif elseif....

2009-03-04 Thread Chris
Shawn McKenzie wrote: Chris wrote: PJ wrote: Daniel Brown wrote: On Wed, Mar 4, 2009 at 17:51, PJ wrote: elseif ($obligatoryFieldNotPresent = 1) { $obligatoryFieldNotPresent = 0; } Are you certain you only wanted a single equal operator in the last elseif

Re: [PHP] if elseif elseif elseif....

2009-03-04 Thread Chris
finally found the problem... wrong names for string and this is what now verifies correctly if (strlen($_POST["titleIN"]) == 0 ) { $obligatoryFieldNotPresent = 1; } elseif (strlen($_POST["first_nameIN"]) == 0 ) { $obligatoryFieldNotPresent = 1; } elsei

Re: [PHP] escape your variables

2009-03-04 Thread Chris
PJ wrote: Sorry, but I have been waylaid by other posts... :'( and have not had the opportunity to finish my quest and I posted to mysql but they are not very helpful I see I was not very clear below and will annotate below. But the problem is still there, I cannot figure out how to sanitize

Re: [PHP] escape your variables

2009-03-04 Thread Chris
Eric Butera wrote: On Wed, Mar 4, 2009 at 8:18 PM, Chris wrote: You only need to escape data coming from a user going in to your database. If you put user input into your database and pull it back out, it's still raw user input. Never trust any piece of data ever, whether it comes f

Re: [PHP] escape your variables

2009-03-04 Thread Chris
Actually no; you said "You only need to escape data coming from a user going in to your database." Using a known variable in my app is not going to cause an sql injection problem. switch ($value) { case 'x': $my_field = 1; break; default: $my_field = 0; } an insert here with

Re: [PHP] Long Execution Time - Safe Mode

2009-03-05 Thread Chris
? wrote: Hello. I have a script which updates some database by loading information from external websites. For example, it has a table of website addresses, and it updates their HTML source on the database. I am using cronjobs to activate the script every 8 hours. The problem is the ser

Re: [PHP] Long Execution Time - Safe Mode

2009-03-05 Thread Chris
Firstly always cc the mailing list so others can add their own suggestions. Also please don't put your reply at the top, it makes it very hard to follow what's going on. Put it underneath or inline (put comments after mine and put more later on). ? wrote: Several problems Firs

Re: [PHP] PHP & Apache - Consuming Too much memory

2009-03-05 Thread Chris
Shota Gedenidze wrote: Php and apache memory problem. I have apache and php, recently added APC module to php, and after that each apache process consumes 30-100 mb of resident memory. Operating System is Linux. Does anybody have Idea how to optimize php to consume less memory? ini_set('memory

Re: [PHP] concat woes

2009-03-05 Thread Chris
PJ wrote: Here we go again! I'm trying to do some form entry verification and am trying to figure out how to verify if there are 4 fields entered: f_nameIN, l_nameIN, f_name2IN, l_name2IN Verifying for each is ok, but somewhat tortured and long. I thought of using CONCAT_WS but it doesn't seem to

Re: [PHP] Re: if elseif elseif elseif....

2009-03-05 Thread Chris
Rather than encoding all the variable names into one long unwieldy set of statements, I would put them all into an array, and then use a loop to process the array. This way all the variable names are together, and the next time you want to enter another set of variables you can use the same c

Re: [PHP] verify problem

2009-03-05 Thread Chris
PJ wrote: And again, this works: if (strlen($_POST["first_nameIN"]) == 0 ) { $obligatoryFieldNotPresent = 1; ... this does not: if (strlen($_POST["first_nameIN"]) > 0 ) && (strlen($_POST["last_nameIN"]) > 0 ) { echo $first_nameIN, " ", $last_nameIN); else (echo "error";)} But, $fir

Re: [PHP] verify problem

2009-03-05 Thread Chris
Are both first_nameIN AND last_nameIN longer than 0 chars? var_dump($_POST['first_nameIN']); var_dump($_POST['last_nameIN']); maybe you only filled in first_name or last_name but not both. Well, echo $first_nameIN, " ", $last_nameIN; Prints out the whole name - without the if clause; and I'v

Re: [PHP] Sending out large amounts of email

2009-03-05 Thread Chris
I have been running some tests with PHP mail() function, PHPMailer and PEAR:Mail using 6000 mails at once. Here's a sumarry of some of the results: PHP mail() send out 6000 mails in 1.75 seconds. PHPMailer using PHP mail() send out 6000 mails in 1.87 seconds. PHPMailer using SMTP send out 6000

Re: [PHP] Sending out large amounts of email

2009-03-05 Thread Chris
Brian Hansen wrote: 2009/3/6 Chris mailto:dmag...@gmail.com>> What about 10,000? I haven't been able to send out more than 6000 at most. It is proberly caused by a limit set in Postfix as you wrote. If you're sending emails one by one in a mail() call there is no l

Re: [PHP] Re: Database Abstraction Class

2009-03-08 Thread Chris
Wow, a proprietary language that I get to learn on top of the two that do the job and that I already know! Bonus! Not trying to be an ass, I haven't used doctrine, but they need some marketing help. My point is that the ability to write queries in a "proprietary dialect" is not really a "feat

Re: [PHP] Cookies/Sessions and how they work

2009-03-09 Thread Chris
Paul M Foster wrote: This is in two parts. First cookies. I'm a little unclear on how they work. From what I've read, cookies are stored by the browser. When a request for that cookie comes in from the server, the browser returns only the value, and no other data. One question: When the browser r

<    1   2   3   4   5   6   7   8   9   10   >