RE: [PHP] Can I modify a MySQL object?

2011-03-23 Thread admin
Depends on where you want to manipulate. In mysql you can $query = 'select first_name as FNAME from tablename'; In this result you changed the column name from first_name to FNAME for the result only. In this example we can change the data returned in a particular field by using an if statement

Re: [PHP] Can I modify a MySQL object?

2011-03-23 Thread Paul M Foster
On Wed, Mar 23, 2011 at 05:12:00PM -0700, Brian Dunning wrote: > I should have said "modify the contents of a MySQL resource". > > On Mar 23, 2011, at 5:06 PM, Brian Dunning wrote: > > > Let's say I do a query: > > > > $result = mysql_query("select * from tablename"); > > > > Is there some way

Re: [PHP] Re: echo?

2011-03-23 Thread David Robley
Jim Giner wrote: > I am outputting to a on an html page. A doesn't work, nor > does \n, hence the . Of course, if I don't need the & then I've > just saved two keystrokes. :) Also - I do believe I tried ($i+1) and > that didn't work either. > > "Paul M Foster" wrote in message > news:201

Re: [PHP] Can I modify a MySQL object?

2011-03-23 Thread Brian Dunning
I should have said "modify the contents of a MySQL resource". On Mar 23, 2011, at 5:06 PM, Brian Dunning wrote: > Let's say I do a query: > > $result = mysql_query("select * from tablename"); > > Is there some way I can manually update the contents of certain > columns/records in $result? I do

[PHP] Can I modify a MySQL object?

2011-03-23 Thread Brian Dunning
Let's say I do a query: $result = mysql_query("select * from tablename"); Is there some way I can manually update the contents of certain columns/records in $result? I don't want to actually update MySQL, just the results that I'm holding in memory for this script. Can I do it without convertin

Re: [PHP] help with _get error

2011-03-23 Thread Donovan Brooke
Jack wrote: Hello All, I'm having a problem with this line of code which worked fine for years: $l_url2 = ".".$_GET[SERVER_NAME]; Here is the error: [Wed Mar 23 13:33:49 2011] [error] [client 16.139.201.61] PHP Notice: Use of undefined constant SERVER_NAME - assumed 'SERVER_NAME' in /hom

Re: [PHP] looking for a newsgroup for JS

2011-03-23 Thread Ken Robinson
At 04:20 PM 3/23/2011, Jim Giner wrote: Anyone know of a working Javascript newsgroup? I googled and tried adding several to my OE newsgroups but couldn't find the servers. I frequent an on-line PHP forum at phpfreaks.com. There is a Javascript section there that seems to be quite active: ht

Re: [PHP] adding objects to $SESSION with serialize()

2011-03-23 Thread Donovan Brooke
Daniele Capuano wrote: Hi, I'm developing a web application using moodle, and I'm trying to create a PHP object tree to be used in $SESSION. Objects are defined as class foo { private $module_name; private $sub_modules = array(); } I have a main module (object) and I use the following funct

RE: [PHP] looking for a newsgroup for JS

2011-03-23 Thread Jay Blanchard
[snip] Anyone know of a working Javascript newsgroup? I googled and tried adding several to my OE newsgroups but couldn't find the servers. [/snip] He jQuery forum also answers JavaScript questions; forum.jquery.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http:/

[PHP] looking for a newsgroup for JS

2011-03-23 Thread Jim Giner
Anyone know of a working Javascript newsgroup? I googled and tried adding several to my OE newsgroups but couldn't find the servers. comp.lang.javascript pl.lang. mozilla.. All of these (can't remember their names now) came up with the same error message. As part of learning php, I su

Re: [PHP] PHP hangs with empty result set

2011-03-23 Thread Curtis Maurand
> The only obvious thing that I can see is that you're checking if the > number of results is greater than a string, not a number. I believe PHP > automagically converts it into an integer for the comparison, but try > changing it to an actual integer and seeing if that resolves it. > > There i

Re: [PHP] PHP hangs with empty result set

2011-03-23 Thread Ashley Sheridan
On Wed, 2011-03-23 at 15:34 -0400, Curtis Maurand wrote: > > I've been having a problem when querying a database with php and the mysql > library the offending code follows. If the result is an empty > set, PHP hangs. I've had to add code to the script to set up a max > execution time to kill t

[PHP] PHP hangs with empty result set

2011-03-23 Thread Curtis Maurand
I've been having a problem when querying a database with php and the mysql library  the offending code follows.  If the result is an empty set, PHP hangs.  I've had to add code to the script to set up a max execution time to kill the script after 30 seconds if it doesn't complete.  This is happen

[PHP] Re: help with _get error

2011-03-23 Thread Shane Rutter
On 23/03/2011 17:46, Jack wrote: Hello All, I'm having a problem with this line of code which worked fine for years: $l_url2 = ".".$_GET[SERVER_NAME]; Here is the error: [Wed Mar 23 13:33:49 2011] [error] [client 16.139.201.61] PHP Notice: Use of undefined constant SERVER_NAME - assumed

Re: [PHP] help with _get error

2011-03-23 Thread David Harkness
On Wed, Mar 23, 2011 at 10:46 AM, Jack wrote: > I'm having a problem with this line of code which worked fine for years: > > $l_url2 = ".".$_GET[SERVER_NAME]; > Place quotes around the key. $l_url2 = ".".$_GET['SERVER_NAME']; Normally PHP treats SERVER_NAME as the name of a constant. There

[PHP] help with _get error

2011-03-23 Thread Jack
Hello All, I'm having a problem with this line of code which worked fine for years: $l_url2 = ".".$_GET[SERVER_NAME]; Here is the error: [Wed Mar 23 13:33:49 2011] [error] [client 16.139.201.61] PHP Notice: Use of undefined constant SERVER_NAME - assumed 'SERVER_NAME' in /home//modules/j

[PHP] adding objects to $SESSION with serialize()

2011-03-23 Thread Daniele Capuano
Hi, I'm developing a web application using moodle, and I'm trying to create a PHP object tree to be used in $SESSION. Objects are defined as class foo { private $module_name; private $sub_modules = array(); } I have a main module (object) and I use the following function to add serialized sub m

Re: [PHP] Upload Progress Meter

2011-03-23 Thread Floyd Resler
On Mar 23, 2011, at 10:10 AM, Steve Staples wrote: > On Wed, 2011-03-23 at 09:59 -0400, Floyd Resler wrote: >> I am in need of an upload progress meter. I've seen plenty of tutorials = >> on-line requiring installing modules, hooks, patches, etc. However, my = >> Wordpress install accomplished

Re: [PHP] Upload Progress Meter

2011-03-23 Thread Steve Staples
On Wed, 2011-03-23 at 09:59 -0400, Floyd Resler wrote: > I am in need of an upload progress meter. I've seen plenty of tutorials = > on-line requiring installing modules, hooks, patches, etc. However, my = > Wordpress install accomplished this without me having to make any = > modifications to my

[PHP] Upload Progress Meter

2011-03-23 Thread Floyd Resler
I am in need of an upload progress meter. I've seen plenty of tutorials = on-line requiring installing modules, hooks, patches, etc. However, my = Wordpress install accomplished this without me having to make any = modifications to my PHP install. So, how is it done? Thanks! Floyd -- PHP Gene

[PHP] Protecting against session hijacking.

2011-03-23 Thread Paul Halliday
I am not sure I am doing this right, I have login.php which does: $ua = $_SERVER['HTTP_USER_AGENT']; $ua .= rand(0,4200); $ua = md5($ua); and upon successful auth, I push them to the main program: header ("Location: squert.php?id=$ua"); at the beginning of squert.php I have: if(!isset($_SESSI

Re: [PHP] Re: echo?

2011-03-23 Thread Paul M Foster
On Wed, Mar 23, 2011 at 07:46:03AM +, Geoff Lane wrote: > Hi Jim, > > On Wednesday, March 23, 2011, 1:42:18 AM, you wrote: > > > ok - here's the code in question. > > $q = 'select * from director_records '; > > $qrslt = mysql_query($q); > > $rows = mysql_num_rows($qrslt); > > for ($i=0; $i<$

Re: [PHP] Re: echo?

2011-03-23 Thread Jim Giner
Thanks for the pointer. Had not run across that tidbit before. "Stuart Dallas" wrote in message news:b43dfd4fa2ac4489aaf538d1bf7a8...@3ft9.com... > http://php.net/manual/en/language.types.string.php > > -Stuart > > -- > Stuart Dallas > 3ft9 Ltd > http://3ft9.com/ > > On Wednesday, 23 March 2011

[PHP] Re: echo?

2011-03-23 Thread Jim Giner
As Richard proved my problem was caused by my use of the archaic cr/lf character pair. Once I found the correct syntax for using \n my output of the loop counter worked. thanks for all the suggestions. My first experience on a PHP newsgroup and it was a postiive one. I've spent the last 12+

Re: [PHP] Re: echo?

2011-03-23 Thread Stuart Dallas
http://php.net/manual/en/language.types.string.php -Stuart -- Stuart Dallas 3ft9 Ltd http://3ft9.com/ On Wednesday, 23 March 2011 at 12:39, Jim Giner wrote: > Very Interesting - '\n' doesn't work, but "\n" does work. > "Steve Staples" wrote in message > news:1300883645.5100.973.camel@webdev

Re: [PHP] Re: echo?

2011-03-23 Thread Jim Giner
Very Interesting - '\n' doesn't work, but "\n" does work. "Steve Staples" wrote in message news:1300883645.5100.973.camel@webdev01... > On Wed, 2011-03-23 at 08:28 -0400, Jim Giner wrote: >> I am outputting to a on an html page. A doesn't work, >> nor >> does \n, hence the . Of course, if

Re: [PHP] Re: echo?

2011-03-23 Thread Jim Giner
it was as complete as need be to demonstrate my dilemma, as Richard has discovered above "Frank Arensmeier" wrote in message news:7cfb015a-c530-4712-9ebc-fbdf5b0ed...@gmail.com... 23 mar 2011 kl. 02.42 skrev Jim Giner: > ok - here's the code in question. > $q = 'select * from director_records

Re: [PHP] Re: echo?

2011-03-23 Thread Jim Giner
not the concern in this posting "Richard Quadling" wrote in message news:aanlktindqu7bzeamtcwh6y9f3m9yjxqpt-ime9ysh...@mail.gmail.com... On 23 March 2011 07:46, Geoff Lane wrote: > Hi Jim, > > On Wednesday, March 23, 2011, 1:42:18 AM, you wrote: > >> ok - here's the code in question. >> $q = 'se

Re: [PHP] Re: echo?

2011-03-23 Thread Steve Staples
On Wed, 2011-03-23 at 08:28 -0400, Jim Giner wrote: > I am outputting to a on an html page. A doesn't work, nor > does \n, hence the . Of course, if I don't need the & then I've > just saved two keystrokes. :) Also - I do believe I tried ($i+1) and that > didn't work either. > > "Paul M

[PHP] Re: echo?

2011-03-23 Thread Jim Giner
By george - I think you've solved it! As for my coding choice - that's the beauty of programming - everybody has a way of solving a problem/creating a solution. Unless you are concerned with performance(which in this particular case is not a concern), there is no 'wrong way'. "Geoff Lane" wro

Re: [PHP] Re: echo?

2011-03-23 Thread Jim Giner
I am outputting to a on an html page. A doesn't work, nor does \n, hence the . Of course, if I don't need the & then I've just saved two keystrokes. :) Also - I do believe I tried ($i+1) and that didn't work either. "Paul M Foster" wrote in message news:20110323034621.go1...@quillandm

Re: [PHP] Re: echo?

2011-03-23 Thread Richard Quadling
On 23 March 2011 07:46, Geoff Lane wrote: > Hi Jim, > > On Wednesday, March 23, 2011, 1:42:18 AM, you wrote: > >> ok - here's the code in question. >> $q = 'select * from director_records '; >> $qrslt = mysql_query($q); >> $rows = mysql_num_rows($qrslt); >> for ($i=0; $i<$rows; $i++) >>     { >>  

Re: [PHP] Re: echo?

2011-03-23 Thread Ricardo Martinez
Hi after of the for, u can use it shoulds back the class of variable, by example "its is string" "its is int" etc for ($i=0;$i<$rows;$i++) echo $i.' '.$row['itemname']; echo gettype($i); Can be that you must define before the class of this variable, because, the system is thinking this i

Re: [PHP] Re: echo?

2011-03-23 Thread Frank Arensmeier
23 mar 2011 kl. 02.42 skrev Jim Giner: > ok - here's the code in question. > $q = 'select * from director_records '; > $qrslt = mysql_query($q); > $rows = mysql_num_rows($qrslt); > for ($i=0; $i<$rows; $i++) >{ >$j = $i+1; >$row = mysql_fetch_array($qrslt); >echo $j.'-'.$row['user

[PHP] Re: echo?

2011-03-23 Thread Geoff Lane
Hi Jim, On Wednesday, March 23, 2011, 1:42:18 AM, you wrote: > ok - here's the code in question. > $q = 'select * from director_records '; > $qrslt = mysql_query($q); > $rows = mysql_num_rows($qrslt); > for ($i=0; $i<$rows; $i++) > { > $j = $i+1; > $row = mysql_fetch_array($qrslt); >