Re: [PHP] PHP SQL Code

2003-03-02 Thread Tim Ward
I'd use ... WHERE UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(sUpdated) > 60*60*24*60 but I'm sure someone will come up with something more efficient. Tim Ward http://www.chessish.com mailto:[EMAIL PROTECTED] - Original Message - From: Philip J. Newman <[EMAIL PROTECT

Re: [PHP] Counting table fields having specific values

2003-02-27 Thread Tim Ward
the just the first row) if ($result = mysql_query("...")) {if ($array = mysql_fetch_array($result)) {... } } // for multiple return rows if ($result = mysql_query("...")) {while ($array = mysql_fetch_array($result)) {... } } Tim Ward http://w

Re: [PHP] form variable problem

2003-02-15 Thread Tim Ward
you need to use $_POST["userid"], etc. accessing the form elements by name directly is unsafe and doesn't work anyway with register_globals off, which is the default setting in your veresion of PHP. Tim Ward http://www.chessish.com mailto:[EMAIL PROTECTED] - Original Mess

Re: [PHP] Help with classes (oop)

2003-02-03 Thread Tim Ward
the function with the same name as the class is the constructor and is called when the instance is created. So "$first = new first" runs first::first() without passing any parameters hence the warning. Tim Ward http://www.chessish.com mailto:[EMAIL PROTECTED] - Original Message

Re: [PHP] processing form with unknown number of checkboxes, each with a unknown name.

2003-02-02 Thread Tim Ward
howabout making the checkboxes an array i.e. then when processing ... foreach($_REQUEST["checkbox"] as $checkbox) { ... } Tim Ward http://www.chessish.com mailto:[EMAIL PROTECTED] - Original Message - From: anders thoresson <[EMAIL PROTECTED]> To: <[EMAIL PROTE

Re: [PHP] Sorting multidimensional arrays..

2003-01-30 Thread Tim Ward
if 'EXTENSION' is unique then you can make life a lot easier by making that the key of the root array (this is a heirarchy of arrays). Tim Ward http://www.chessish.com mailto:[EMAIL PROTECTED] - Original Message - From: Chad Day <[EMAIL PROTECTED]> To: php general <[EMA

Re: [PHP] Update row problems

2003-01-27 Thread Tim Ward
what version of PHP? try $HTTP_POST_VARS instead. Tim Ward http://www.chessish.com mailto:[EMAIL PROTECTED] - Original Message - From: Steve Jackson <[EMAIL PROTECTED]> To: PHP General <[EMAIL PROTECTED]> Sent: Monday, January 27, 2003 1:14 PM Subject: RE: [PHP] Update

Re: [PHP] Update row problems

2003-01-27 Thread Tim Ward
your query needs to be inside the foreach loop so that it runs for every item, at the moment it just runs after you've scanned through all the items so just does the last one. Tim Ward http://www.chessish.com mailto:[EMAIL PROTECTED] - Original Message - From: Steve Jackson &l

Re: [PHP] nested queries/loops

2003-01-23 Thread Tim Ward
} } // then do ... foreach($partners as $services) {... foreach($services as $service) {... } } this may not be quite what you need but you get the general idea. looks like services as effectively a many to many link table, nothing wrong with that as far as I ca

Re: [PHP] ADV SQL Help Needed.

2003-01-21 Thread Tim Ward
off the top of my head SELECT risk_level, COUNT(risk_level) AS rl_count GROUP BY risk_level should do it, though I'd have to experiment with what's inside the COUNT(). Tim Ward http://www.chessish.com mailto:[EMAIL PROTECTED] - Original Message - From: [-^-!-%- <[EMAIL P

Re: [PHP] Error in variable when looping

2003-01-14 Thread Tim Ward
print ""; print""; print""; you'll then have as many forms as you have rows and which one is submitted will depend on which button is pressed. Tim Ward http://www.chessish.com mailto:[EMAIL PROTECTED] - Original Message - From: Denis L. Menezes <[

Re: [PHP] Weird Errors

2003-01-14 Thread Tim Ward
surely you can post the part of the code that checks the e-mail is blank or not? Tim Ward http://www.chessish.com mailto:[EMAIL PROTECTED] - Original Message - From: Mike Bowers <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, January 14, 2003 12:04 AM Subject:

Re: [PHP] Error in variable when looping

2003-01-14 Thread Tim Ward
you're not differentiating between form elements on different rows. all the hidden elements have the same name and are in the same form so only the last one will be available as all the submit buttons are in the same form. you need to put ... tags around each submit/hidden pair. Tim Ward

Re: [PHP] dumb time question

2003-01-13 Thread Tim Ward
use the date() function, in this case date("i") and date("h") or date("H") Tim Ward http://www.chessish.com mailto:[EMAIL PROTECTED] - Original Message - From: Pag <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, January 13, 2003

Re: [PHP] checkboxes, radio buttons and $_POST['']

2003-01-09 Thread Tim Ward
isset($_POST["chk1"]) will only be true if the checkbox is checked. Tim Ward http://www.chessish.com mailto:[EMAIL PROTECTED] - Original Message - From: John-Erik Omland <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, January 09, 2003 6:25 PM Subject: [

Re: [PHP] URL parsing

2002-12-18 Thread Tim Ward
you could use a combination of the string functions (strstr(), substr(), strpos()) or you could work out something with regular expressions. Tim Ward http://www.chessish.com mailto:[EMAIL PROTECTED] - Original Message - From: Mako Shark <[EMAIL PROTECTED]> To: <[EMAIL PROTECT

Re: [PHP] nested if in a for statement

2002-12-17 Thread Tim Ward
looks ok as long as you are really testing what you mean to. As you've written it if any of the variables are an empty string, zero, logical false or not set then the if statement will be true. what is $auth? Tim Ward http://www.chessish.com mailto:[EMAIL PROTECTED] - Original Me

Re: [PHP] key pairs

2002-12-17 Thread Tim Ward
what do you mean by key pairs - I assumed you meant a key that could link the records in each table. If you've already done that then what's the problem? Tim Ward http://www.chessish.com mailto:[EMAIL PROTECTED] - Original Message - From: Ashley M. Kirchner <[EMAIL PROTEC

Re: [PHP] key pairs

2002-12-17 Thread Tim Ward
mysql_insert_id(). 5. insert the data into the other table(s) with this order_id(). Tim Ward http://www.chessish.com mailto:[EMAIL PROTECTED] - Original Message - From: Ashley M. Kirchner <[EMAIL PROTECTED]> To: PHP-General List <[EMAIL PROTECTED]> Sent: Tuesday, December 17,

Re: [PHP] "Use of undefined constant" error

2002-12-17 Thread Tim Ward
f id and proceeds accordingly. Thats why you can get away with not using the quote marks (as long as there's no white space in the string). On a live site (and, I'd have thought, most default set-ups) you'd expect error reporting to be set all off and you'd never see the

Re: [PHP] Returning multiple values from function

2002-12-12 Thread Tim Ward
you can always return an array of arrays ... return array($array1, $array2, ...); but in your case why not make the column names the array keys so the one array holds both column names and types. Tim Ward http://www.chessish.com mailto:[EMAIL PROTECTED] - Original Message - From: Lisi

Re: [PHP] Update query

2002-12-12 Thread Tim Ward
The best way would be to design the table so that it had an item_id field that was an auto-incremented integer and not updateable. It shouldn't be too late to add such a field, then it can be passed from the form as a hidden field (as I assume you're currently doing with $oldItemCode).

Re: [PHP] How do I populate a select?

2002-12-10 Thread Tim Ward
t the function names wrong - I use an abstraction layer these days Tim Ward http://www.chessish.com mailto:[EMAIL PROTECTED] - Original Message - From: Steve Jackson <[EMAIL PROTECTED]> To: PHP General <[EMAIL PROTECTED]> Sent: Tuesday, December 10, 2002 3:24 PM Subject: [PHP] H

Re: [PHP] Hiding URL Variable

2002-12-08 Thread Tim Ward
store them in a session or cookie Tim Ward http://www.chessish.com mailto:[EMAIL PROTECTED] - Original Message - From: Stephen <[EMAIL PROTECTED]> To: PHP List <[EMAIL PROTECTED]> Sent: Sunday, December 08, 2002 8:10 PM Subject: [PHP] Hiding URL Variable > How can you hid

Re: [PHP] fopen have a "setTimeout" feature?

2002-12-08 Thread Tim Ward
how about something like... $start = time(); $timeout = 60; // number of seconds to try while (!$file = fopen("...") && time() < $start + $timeout); if ($file) { // do stuff with file } Tim Ward http://www.chessish.com mailto:[EMAIL PROTECTED] - Original Message --

Re: [PHP] Simple text editor for Windows?

2002-12-07 Thread Tim Ward
I like arachnophilia. Tim Ward http://www.chessish.com mailto:[EMAIL PROTECTED] - Original Message - From: John W. Holmes <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, December 07, 2002 4:11 PM Subject: [PHP] Simple text editor for Windows? > I know

Re: [PHP] More $_ array question...

2002-12-06 Thread Tim Ward
not quite ... if the form elements are (e.g) , etc. then you need $_POST["array"][0] to refer to the element (just like any other array of arrays in PHP). but you're right about count($_POST["array"]) ... and foreach ($_POST["array"] as $key=>$value),

Re: [PHP] Output of MySQl sorted query to text or Word file.

2002-12-06 Thread Tim Ward
everything you need is here http://www.php.net/manual/en/ref.filesystem.php in particular fopen(), fputs(), fwrite(), etc. Tim Ward http://www.chessish.com mailto:[EMAIL PROTECTED] - Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, Decembe

Re: [PHP] A small problem with input feilds.

2002-12-05 Thread Tim Ward
only checked checkboxes are submitted therefore you have to number the form fields if you want to keep the relationship between the arrays - this should be easy enough if the form is generated by your code. Tim Ward http://www.chessish.com mailto:[EMAIL PROTECTED] - Original Message

[PHP] RE: Problem with Class - incomplete object error

2002-11-18 Thread Tim Ward
you've included the class definition at the top of every page, right? and why don't you just use $_SESSION["cart"] directly instead of using $cart? that way you don't have to worry about scoping issues and continually passing $cart through to functions. Tim > -Original Message- > From: P

[PHP] RE: OOP-classes in PHP

2002-11-18 Thread Tim Ward
you can't access $overall->foo because you've never defined it you need: function load($class){ eval("\$this->$class = new $class;"); return true; } Tim > -Original Message- > From: Tularis [mailto:[EMAIL PROTECTED]] > Sent: 17 November 200

[PHP] RE: newbie: php/mysql

2002-10-28 Thread Tim Ward
the best way to do password validation is using one way encryption (e.g. MySQL PASSWORD() function). That way you check the encrypted user entered password against the database ... " ... WHERE pass = PASSWORD('{$_POST["password"]}')" Tim Ward www.chessish

[PHP] RE: No ouput until program end, why?

2002-10-04 Thread Tim Ward
does output buffering not work with command line PHP? http://www.php.net/manual/en/ref.outcontrol.php Tim Ward www.chessish.com > -Original Message- > From: Jean-Christian Imbeault [mailto:[EMAIL PROTECTED]] > Sent: 04 October 2002 05:59 > To: [EMAIL PROTECTED] > Subject:

[PHP] RE: Incrementing the value

2002-10-03 Thread Tim Ward
I think you mean ++$hid, otherwise the value is inserted before it is incremented, and why not change to $_GET["hid"] for future compatibility and just to make sure. Are there any scoping issues we don't know about, e.g. is this snippet within a function? Tim Ward w

[PHP] RE: local resource variables

2002-09-26 Thread Tim Ward
to test this try returning $result from the function e.g. function test() { $result = mysql_query("SELECT * FROM bigbigtable"); return $result; } echo(mysql_numrows(test())) remember $result holds a number that is a pointer to the result set resource, it isn't the actual result data set, if

[PHP] RE: PHP Form and Arrays help

2002-09-25 Thread Tim Ward
use a hidden input in front of each checkbox with the same name and the value '0' (as opposed to '1' for the checkbox). Tim www.chessish.com > -Original Message- > From: Tom Ray [mailto:[EMAIL PROTECTED]] > Sent: 24 September 2002 17:24 > To: [EMAIL PROTECTED] > Subject: PHP Form and Arr

[PHP] RE: Maybe a stupid question but can it be done?

2002-09-24 Thread Tim Ward
the ID field in the first table can be an auto-increment field and the second table needs to have an ID INT field that is not auto increment. Insert into the first table, use mysql_insert_id() (or whatever it is) to get the auto incremented value and then do your second insert using that value fo

[PHP] RE: Update undefined List Values in DB

2002-09-23 Thread Tim Ward
make your checkboxes in the form an array with the index being the customer id. e.g. in the form ... foreach($customers as $cust) { echo(""); ... echo(""); echo(""); ... echo(""); } and when processing foreach($_POST["status"] as $custid=>status) {

[PHP] RE: PHP source code

2002-09-20 Thread Tim Ward
then keep this info in a config file off root and use a data abstraction class to connect. Tim www.chessish.com > -Original Message- > From: Oliver Witt [mailto:[EMAIL PROTECTED]] > Sent: 19 September 2002 19:15 > To: [EMAIL PROTECTED]; Stephan Seidt > Subject: Re: PHP source code > >

[PHP] RE: redefining a function

2002-09-20 Thread Tim Ward
eem to remember that that isn't always the case at first. Tim > -Original Message- > From: David T-G [mailto:[EMAIL PROTECTED]] > Sent: 19 September 2002 17:13 > To: PHP General list > Cc: Tim Ward > Subject: Re: redefining a function > > > Tim, et al --

[PHP] RE: redefining a function

2002-09-19 Thread Tim Ward
is using classes an option? Tim Ward www.chessish.com > -Original Message- > From: David T-G [mailto:[EMAIL PROTECTED]] > Sent: 19 September 2002 04:54 > To: PHP General list > Subject: redefining a function > > > Hi, all -- > > I

[PHP] RE: use of mysql_free_result (was Re: [PHP] Efficiency)

2002-09-19 Thread Tim Ward
if your query is within a loop then it would probably help, e.g. for ($i = 1; $i <= 1000; $i++) { $result = mysql_query("..."); ... } in this case as $result is a resource identifier then reusing it doesn't release the original result. Tim Ward

[PHP] RE: How to approach a new project?

2002-09-19 Thread Tim Ward
learn - not PHP. Tim Ward www.chessish.com > -Original Message- > From: Wm [mailto:[EMAIL PROTECTED]] > Sent: 18 September 2002 23:25 > To: [EMAIL PROTECTED] > Subject: How to approach a new project? > > > I'm trying to work out the best

[PHP] RE: Pass array in HTTP_POST_VARS question

2002-09-04 Thread Tim Ward
you just name the form elements as array elements, e.g. with explicit keys name='array[0]' name='array[1]' etc. or allowing php to assign the keys name='array[]' name='array[]' etc. then the array is an element of $HTTP_POST_

[PHP] RE: PHP checkbox/hidden field question

2002-09-02 Thread Tim Ward
you need to define the key for checkbox arrays in order to distinguish them (as only the checked ones will be posted).. something like ... Tim Ward www.chessish.com > -Original Message- > From: Paul Maine [mailto:[EMAIL PROTECTED]] > Sent: 02 September 2002 00:56 >

[PHP] RE: RE: array_unique & multi-dimensional arrays

2002-08-20 Thread Tim Ward
een added to the array then it overwrites the existing one instead of adding a new element. Tim Ward > -Original Message- > From: sasha [mailto:[EMAIL PROTECTED]] > Sent: 20 August 2002 14:36 > To: Tim Ward > Subject: Re: RE: array_unique & multi-dimensional arrays >

[PHP] RE: array_unique & multi-dimensional arrays

2002-08-20 Thread Tim Ward
ill prevent duplicate combinations of month and year (and, incidentally, allow you to sort on year and month very easily). Tim Ward www.chessish.com > -Original Message- > From: sasha [mailto:[EMAIL PROTECTED]] > Sent: 19 August 2002 19:10 > To: [EMAIL PROTECTED] > Subject:

[PHP] RE: sessions don't work

2002-08-16 Thread Tim Ward
why do you think the session isn't working? If there is a run time error in 'file' then an error would be reported and the output terminated. If you have error reporting off then you would expect to get eactly what you see. Sounds like a problem inside 'file'.

[PHP] RE: Destroy session variable when IE close

2002-08-15 Thread Tim Ward
yes but the variables are still held and would be available if you knew the session id. until the garbage collection clears it out the session variables are still there. the session doesn't die when the browser closes, just the browser's reference to it. Tim Ward Please re

RE: [PHP] String Question

2002-08-01 Thread Tim Ward
or ... while($new = substr($old, $i++ * $strlen, $strlen)) $array[] = $new; Tim Ward www.chessish.com > -Original Message- > From: Richard Baskett [mailto:[EMAIL PROTECTED]] > Sent: 31 July 2002 20:47 > To: Randy Johnson; PHP General > Subject: R

[PHP] RE: dir to array?

2002-08-01 Thread Tim Ward
ir = opendir("/path/to/directory/"); > while($imgs = readdir($dir)) { >if (($imgs != ".") && ($imgs != "..")) { > $cnt[count($imgs)] = $cnt; is this typo in the original code? surely should be " = $imgs;" >} else { > print &q

RE: [PHP] Re: Table formatting <-- PARTIALY SOLVED

2002-07-30 Thread Tim Ward
that? Tim Ward www.chessish.com > -Original Message- > From: César Aracena [mailto:[EMAIL PROTECTED]] > Sent: 29 July 2002 16:39 > To: 'Martin Towell'; [EMAIL PROTECTED] > Subject: RE: [PHP] Re: Table formatting <-- PARTIALY SOLVED > > &

RE: [PHP] beginner in PHP

2002-06-14 Thread Tim Ward
then destroy the session locally by unsetting that array. If I have a function that I want to change session variables at all I make it take the session in as a parameter and pass it back as the return value. Tim Ward > -Original Message- > From: Phillip Perry [SMTP:[EMAI

RE: [PHP] beginner in PHP

2002-06-13 Thread Tim Ward
>From the symptoms it sounds like you're destroying the session okay but leaving the variables In the script. Are you sure you're unsetting them at the appropriate scope level. Tim Ward www.chessish.com <http://www.chessish.com> -- From: Phillip

[PHP] RE: simplicity with 2 queries..

2002-06-10 Thread Tim Ward
ure your code a bit if you want the desired result. Tim Ward www.chessish.com <http://www.chessish.com> [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> -- From: Jule Slootbeek [SMTP:[EMAIL PROTECTED]] Sent: 10 June

RE: [PHP] PHP function for listing number of columns in table

2002-06-10 Thread Tim Ward
Just off the top of my head wouldn't describe then mysql_num_rows() be a lot more efficient. Tim Ward www.chessish.com <http://www.chessish.com> [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> -- From: John Holmes [SMTP:[EMAIL PROTECTED]] Sent:

[PHP] RE: Month Values in UNIX timestamps and workaround(Newbie)

2002-05-30 Thread Tim Ward
If you just want the number of seconds in each month then ... function SecondsInMonth($month, $year) { return mktime(0,0,0,$month + 1, 1, $year) - mktime(0,0,0,$month, 1, $year); } ... works, although you may need to play around with the is_dst parameter to fine tune it. Tim ward

[PHP] RE: Global variables

2002-05-30 Thread Tim Ward
What about storing them in database or (below root) flat files? Tim Ward www.chessish.com <http://www.chessish.com> -- From: serge gedeon [SMTP:[EMAIL PROTECTED]] Sent: 29 May 2002 14:35 To: [EMAIL PROTECTED] Subject: Global var

[PHP] RE: your philosophy on php-design

2002-05-30 Thread Tim Ward
(); echo(""); echo(" Footer(); echo(""); echo(""); } } you get the idea Tim Ward www.chessish.com <http://www.chessish.com> -- From: Wilbert Enserink [SMTP:[EMAI

[PHP] RE: odd class/session/db behaviour

2002-05-29 Thread Tim Ward
the case above but the connection isn't. This may not have anything to do with your problem but it's something that tripped me up when I started doing OOP stuff in PHP. Tim Ward www.chessish.com <http://www.chessish.com> -- From: Nick Wilson [SMTP:[EMAIL

[PHP] RE: array_search in 2-d arrays

2002-05-15 Thread Tim Ward
is no built in way to search down this tree. I think you'll need To walk the array and check the first element of each e.g. Foreach($layerDes as $count=>$array) { if ($array[0] == $searchstring) { $key = $count; break; } } Tim Ward www.chess

[PHP] RE: textarea problem

2002-05-14 Thread Tim Ward
Are you POSTing or GETting the data? Tim Ward www.chessish.com <http://www.chessish.com> -- From: Enrique Vadillo [SMTP:[EMAIL PROTECTED]] Sent: 14 May 2002 01:33 To: [EMAIL PROTECTED] Subject: textarea problem Hi, I

[PHP] RE: An array of objects?

2002-05-14 Thread Tim Ward
$_SESSION["rooms"][1] = array("room_name"=>"Bob's Room", room_status=>1) $_SESSION ["rooms"][2] = array("room_name"=>"Jeff's Room", room_status=>0) etc. then for a given room_id ... echo($_SESSION [

RE: [PHP] problems with

2002-05-10 Thread Tim Ward
I've only just picked up on this thread, but why not put each form inside a element? i.e. ... ... http://www.chessish.com> -- From: David Freeman [SMTP:[EMAIL PROTECTED]] Sent: 09 May 2002 22:24 T

[PHP] RE: Problem with array

2002-04-30 Thread Tim Ward
oop. It doesn't really have any significance in this context. Is there any reason why you're not naming the checkboxes RG[1], RG[2], etc.? This would make everything much easier - you can then do ... Foreach ($HTTP_POST_VARS["RG"] as $value) $RGs[] = $value Tim Ward Inter

RE: [PHP] build array dinamicaly

2002-04-30 Thread Tim Ward
Be careful - I fell into this trap when I first started doing this sort of thing. This code will produce an extra element on your array with value logical false. You need to do ... While ($array = mysql_fetch_array($result)) $myarray[] = $array; ... to avoid this Tim Ward Internet Chess

[PHP] RE: Array indices

2002-04-24 Thread Tim Ward
Why not just... Foreach (array_diff($array1, $array2) as $value) { $newarray[] = $value; } or am I missing something? Tim Ward Internet Chess www.chessish.com <http://www.chessish.com> -- From: esivertsen [SMTP:[EMAIL PROTECTED]] Sent: 23 April 2

RE: [PHP] .inc over .php

2002-04-19 Thread Tim Ward
I've settled on .inc.php, .class.php, etc. that way you get the best of both worlds. Your files are identified as what they are and don't get sent out unparsed Tim Ward Internet Chess www.chessish.com <http://www.chessish.com> -- From: Jason W

[PHP] RE: how to get row by row from CSV file

2002-04-19 Thread Tim Ward
sv that you can walk through in php. Using fopen and while fgets may be more efficient, especially if you don't want the whole file If ($fhandle = fopen("yourfile.csv", "r")) { while ($row = fgets($fhandle)) { ... // etc. } } Tim Ward Internet Ch

RE: [PHP] save html created by loop in variable

2002-04-18 Thread Tim Ward
} } Please treat this as pseudo code, but you get the idea. Arrays of arrays can be really powerful for stuff like this. Tim Ward Internet Chess www.chessish.com <http://www.chessish.com> -- From: Jason Dulberg [SMTP:[EMAIL PROTECTED]] Sent: 18 April

RE: [PHP] Is While needed in MySQL Result with a Limit of 1

2002-04-11 Thread Tim Ward
Why not just use an if instead of a while? This way you test for a result and get it at the same time If ($array = mysql_fetch_array($result)) { foreach($array as $key=?$value) echo("$key=?$value"); } else echo("sorry didn't get anything"); Tim Ward Internet Che

RE: [PHP] Re: mysql

2002-04-11 Thread Tim Ward
That's not quite right, if (!$result = mysql_query($sql, $db)) { echo "Query failed"; } else { if (!$row = mysql_fetch_row($result)) { echo "No records found."; } } Tim Ward Internet Che

[PHP] RE: simple question

2002-04-03 Thread Tim Ward
vailable as variables in the php page the form submits to (the action property of the form tag, which can be the same page). Tim Ward Internet Chess www.chessish.com <http://www.chessish.com> -- From: Denis L. Menezes [SMTP:[EMAIL PROTECTED]] Sent: 0

RE: [PHP] check form - save arrays in hidden fields?

2002-03-26 Thread Tim Ward
Why in a scalar? Why not pass the array through, i.e. Foreach($test as $element) { echo(""); } Tim Ward Internet Chess www.chessish.com <http://www.chessish.com> -- From: Fabian Krumbholz - 2k web solutions [SMTP:[EMAIL PROTECTED]] Sent

[PHP] RE: Browser Detection without use of browsecap.ini file

2002-03-22 Thread Tim Ward
$HTTP_ENV_VARS["HTTP_USER_AGENT"] contains this info if it's been sent Tim Ward Internet Chess www.chessish.com <http://www.chessish.com> -- From: R'twick Niceorgaw [SMTP:[EMAIL PROTECTED]] Sent: 21 March 2002 17:06

RE: [PHP] Re: Return the column names of MySQL table?

2002-03-20 Thread Tim Ward
ield as $key => $val) { echo "$key : $val |"; } echo(""); } } Tim Ward Internet Chess www.chessish.com <http://www.chessish.com> -- From: Kevin Stone [SMTP:[EMAIL PROTECTED]]

[PHP] RE: Invalid Argument ??? Not sure how to debug this

2002-03-18 Thread Tim Ward
Try ... If ($result = ...) { ... ... } else echo(mysql_error()); I always do querying like this anyway (without the error echo in live stuff obviously) Tim Ward Internet Chess www.chessish.com <http://www.chessish.com> -- From: Daniel Negron/KBE

RE: [PHP] OBJECT£ºWHAT'S THE RALATION BETWEEN A,B AND C?

2002-03-18 Thread Tim Ward
The line you've marked prints the "value" attribute of $a->b->a, which is a pointer to the base object ($a). You have just changed the "value" attribute of this to 11 and it prints 11 ... what's wrong? Tim Ward Internet Chess www.c

RE: [PHP] Re: A stupid question...

2002-03-11 Thread Tim Ward
uot; ... if you mean sort all records but don't sort past the first letter then "SELECT ..., LEFT(lastname, 1) AS lastname_first ... ORDER BY lastname_first" or you might even be able to do " ... ORDER BY LEFT(lastname, 1)" you'll have to experiment with t

RE: [PHP] Re: User accounts

2002-03-08 Thread Tim Ward
Surely an empty string is == false. In fact I'd be interested if anyone can come up with a situation where !$x doesn't return the same as empty($x) i.e. can anyone get a value of $x such that !$x !== empty($x) Tim Ward Internet Chess www.chessish.com <http://www

RE: [PHP] Does anyone follow?

2002-03-05 Thread Tim Ward
" "); echo($author.""); echo("(". count[$ids] .") ["); foreach ($ids as $id) echo($id); // need something a bit fancier here, but you get the idea echo("]\n"); } Tim Ward Internet chess www.chessish.

[PHP] RE: Help with showing tables in DB

2002-02-27 Thread Tim Ward
} I think you'll find the field you want is something like "Tables_in_dbname". Tim Ward www.chessish.com <http://www.chessish.com> -- From: Ron Clark [SMTP:[EMAIL PROTECTED]] Sent: 26 February 2002 21:02 To: [EMAIL PROTECTED]

[PHP] RE: Sessions and switching between php and htm documents

2002-02-27 Thread Tim Ward
I haven't experienced this myself, but I'd have thought that if you're propagating the session via the URL rather than a cookie then it won't get added if the page isn't parsed. If it's not passed on just once it's lost. Tim Ward Internet chess www.ch

[PHP] RE: word wrapping again

2002-02-26 Thread Tim Ward
This is really an html issue. HTML will only text wrap (in a compliant browser) on white space. If you want a server side solution to solve this you'll need to break up long words with a space or line-break. Tim Ward Internet chess www.chessish.com <http://www.ches

RE: [PHP] Re: php - assigning date variables

2002-02-26 Thread Tim Ward
arlier then make the startdate blank, etc. Tim Ward Internet chess www.chessish.com <http://www.chessish.com> -- From: Craig Westerman [SMTP:[EMAIL PROTECTED]] Sent: 25 February 2002 19:32 To: Lerp Cc: [EMAIL PROTECTED] Subject: RE

[PHP] RE: str_replace and associative arrays

2002-02-26 Thread Tim Ward
as the subject the search and replace was performed on the string "array". Tim Ward Internet chess www.chessish.com <http://www.chessish.com> -- From: Michael Crowl [SMTP:[EMAIL PROTECTED]] Sent: 25 February 2002 22:01 To: [EMAIL PROTE

RE: [PHP] overwriting PHP_SELF and PHP_AUTH_xxxx

2002-02-22 Thread Tim Ward
Forgive me if I'm treating pseudo as real but surely print ""; should be print ""; same goes for the array element in the sql statement Tim Ward Internet chess www.chessish.com <http://www.chessish.com> -- From:

[PHP] RE: timestamp confusion

2002-02-21 Thread Tim Ward
Time() returns unix timestamp (which is GMT), date() is interpreting that according to the local time zone. Tim Ward internet chess at www.chessish.com <http://www.chessish.com> -- From: Justin French [SMTP:[EMAIL PROTECTED]] Sent: 21 February 2002

[PHP] RE: novice question -- array_push($real[$i][$j],$s[$j]);????????

2002-02-20 Thread Tim Ward
e. if you have $fred[0] = array(1,2,3); $fred[1] = array(4,5,6); array_push($fred[1], 7) will leave $fred[0] = array(1,2,3); $fred[1] = array(4,5,6,7); or array_push($fred[0], 7) will leave $fred[0] = array(1,2,3,7); $fred[1] = array(4,5,6); Tim Ward www.chessish.com <http://www.ches

RE: [PHP] What Do You Think?

2002-02-19 Thread Tim Ward
Timothy Taylor's and Sam Smith's are much better example of Yokshire beer. I know people who've found bottled Sam's all over the world Tim Ward www.chessish.com <http://www.chessish.com> -- From: Richard Crawford [SMTP:[EMAIL PROTECTED]]

RE: [PHP] HTTP_POST_VARS problem

2002-02-08 Thread Tim Ward
Make the name of the select an array e.g. http://www.chessish.com> -- From: [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED]] Sent: 08 February 2002 02:47 To: [EMAIL PROTECTED] Subject: Re: [PHP] HTTP_POST_VARS problem Please ignore my questi

RE: [PHP] Limit 15 where "Newest"

2002-02-05 Thread Tim Ward
If (!$start) $start=0; $sql="select author, title, chapter from table order by date DESC limit $start, 15"; ... and a link on the same page: echo("next"); or something like that Tim www.chessish.com

[PHP] RE: Initializing Array

2002-01-29 Thread Tim Ward
As far as using them is concerned they are already zero (as indeed are undefined elements). If you want force the type you'll have to step through the array. $pos[17][7][3] = 0; // will only set the value of that element, in PHP or C Tim www.chessish.com -

RE: [PHP] RE: phpwiki save button

2002-01-24 Thread Tim Ward
x27;d be surprised if the table doesn't already have a field like that. Tim www.chessish.com > -Original Message- > From: Tim Bogart [SMTP:[EMAIL PROTECTED]] > Sent: 24 January 2002 15:43 > To: Tim Ward; [EMAIL PROTECTED] > Subject:

[PHP] RE: phpwiki save button

2002-01-24 Thread Tim Ward
TED]] > Sent: 24 January 2002 15:01 > To: Tim Ward; [EMAIL PROTECTED] > Subject: Re: phpwiki save button > > On Thursday 24 January 2002 06:36 am, Tim Ward wrote: > > What is it you actually want to do? Add the current date/time or a > > timestamp entered on the submitti

[PHP] RE: One Line text boxes vs. Multiline text boxes

2002-01-24 Thread Tim Ward
Sounds to like you're not putting the value in quotes. i.e. you can get away with you can't. 's (what I assume you are referring to as multiline text boxes) are different as the value goes between the tabs and seems to be treated as prefdefined text (like between tags) Tim www.chessish.com

[PHP] RE: phpwiki save button

2002-01-24 Thread Tim Ward
What is it you actually want to do? Add the current date/time or a timestamp entered on the submitting form? See date() for the former. Once you've got your stamp in a format you want just add it to the front of the story before saving. Give us a bit more detail about what it is that isn't working

RE: [PHP] RE: Printing structure and data of array

2002-01-22 Thread Tim Ward
om > -Original Message- > From: Sandeep Murphy [SMTP:[EMAIL PROTECTED]] > Sent: 22 January 2002 15:25 > To: 'Tim Ward'; PHP List > Subject: RE: [PHP] RE: Printing structure and data of array > > > Hey! > > No need to apologise!!! If it werent

RE: [PHP] RE: Printing structure and data of array

2002-01-22 Thread Tim Ward
uot;length"=>30, "width"=>20); $fred[0][3] = "Hello world"; $fred[1] = "another string"; if this isn't what you're trying to do I apologise for misinterpreting the question Tim Ward Senior Systems Engineer Please refe

RE: [PHP] RE: Printing structure and data of array

2002-01-22 Thread Tim Ward
{ echo("=>$value"); } echo("") } echo(""); } // end of fn ShowArray Tim www.chessish.com > -Original Message- > From: Sandeep Murphy [SMTP:[EMAIL PROTECTED]] > Sent: 22 January 2002 12:01 > To: &

  1   2   3   >